Most Popular

1500 questions
45
votes
2 answers

InnoDB: Error: Table "mysql"."innodb_table_stats" not found after upgrade to mysql 5.6

I upgraded to mysql 5.6 from 5.5, and now my logs are littered with such messages on startup I found a possible solution here, but it does not seem official. http://forums.mysql.com/read.php?22,578559,579891#msg-579891 2013-12-06 21:08:00…
giorgio79
  • 1,407
  • 7
  • 19
  • 19
45
votes
7 answers

How to handle TimeZone properly in SQL Server?

My local development server is in the Middle East, but my production server is in the UK. I need to show the date to the user in their time zone. For example, if a user is in Saudi Arabia then I need to show the time according to Saudi Arabia…
45
votes
9 answers

How to see list of databases in Oracle?

Is there an equivalent to MySQL SHOW DATABASES statement? Is it possible to find databases in a cluster? i.e. databases present on the network on some other system? Could I analyze the files present on an Oracle installation to find the same? Given…
Kshitiz Sharma
  • 3,237
  • 9
  • 31
  • 35
45
votes
5 answers

Benefits of using backtick (`) in MySQL queries?

In MySQL we can create queries with or without the backtick (`) symbol. Example: SELECT * FROM TEST; SELECT * FROM `TEST`; Both works fine in mysql-console. Is there any technical difference between them? Is there any benefit using (`) over over…
Satish Pandey
  • 683
  • 1
  • 7
  • 13
45
votes
1 answer

Commonly Used Acronyms by Database Administrators

What are the most commonly used acronyms among database administrators and what are their correlated meanings? This is for the community and those searching for meanings of commonly used terms and acronyms when working with databases, etc.
tacotuesday
  • 611
  • 1
  • 7
  • 10
45
votes
5 answers

Unit testing of stored procedures

I've been considering this for quite a long time now. The basic question is: how to unit test stored procedures? I see that I can set up unit tests relatively easily for functions in the classic sense (I mean they get zero or more arguments and…
András Váczi
  • 31,278
  • 13
  • 101
  • 147
45
votes
4 answers

Is it possible to install just the mongo Shell?

I have Docker installed and am running a MongoDB container for my local development on my Mac. The problem is that I can't connect to said DB easily from CLI. I have Robo 3T installed, but I would prefer to use the CLI client instead. Is there a…
CodeChimp
  • 553
  • 1
  • 4
  • 5
45
votes
3 answers

Is it possible to limit timeout on Postgres server?

I set connection and command timeout to 10 minutes in my application (client side). Than my application runs a simple query: SELECT pg_sleep(65) On some servers it works fine, but other servers close the connection after 60 seconds. Could this be…
Andrzej Gis
  • 561
  • 1
  • 4
  • 3
45
votes
3 answers

How do you calculate mysql max_connections variable?

How do you calculate mysql max_connections ? What do you take into consideration ?
Gabriel Solomon
  • 985
  • 2
  • 10
  • 13
44
votes
4 answers

How do I change the DEFINER of a VIEW in Mysql?

When I run mysqldump, I get an error: mysqldump: Got error: 1449: The user specified as a definer ('root'@'foobar') does not exist when using LOCK TABLES This makes sense because foobar is a legacy machine that no longer exists. How do I change the…
kfmfe04
  • 849
  • 2
  • 8
  • 12
44
votes
3 answers

Is the concept of a clustered index in a DB design sensical when using SSDs?

When designing a SQL server data schema and the subsequent queries, sprocs, views, etc. does the notion of a clustered index and order of data on disk make any sense to consider for DB designs made explicitly to be deployed on SSD…
Matthew
  • 1,682
  • 2
  • 17
  • 27
44
votes
2 answers

Outer Apply vs Left Join Performance

I am Using SQL SERVER 2008 R2 I just came across APPLY in SQL and loved how it solves query problems for so many cases, Many of the tables I was using 2 left join to get the result, I was able to get in 1 outer apply. I have small amount of data in…
Pratyush Dhanuka
  • 559
  • 1
  • 5
  • 9
44
votes
6 answers

Checking whether two tables have identical content in PostgreSQL

This has already been asked on Stack Overflow, but only for MySQL. I'm using PostgreSQL. Unfortunately (and surprisingly) PostgreSQL does not seem to have something like CHECKSUM table. A PostgreSQL solution would be fine, but a generic one would be…
Faheem Mitha
  • 1,039
  • 2
  • 12
  • 18
44
votes
5 answers

Can I provide a default for a left outer join?

Suppose I have tables a (with column a1) and b (with columns b1 and b2) and I perform a left outer join SELECT * FROM a LEFT OUTER JOIN b ON a.a1 = b.b1 Then b1 and b2 will be NULL where a value of a1 has no matching value of b1. Can I provide a…
Tom Ellis
  • 1,599
  • 3
  • 15
  • 14
44
votes
4 answers

Why is my database still fragmented after I rebuilt and reindexed everything?

I have a database which I tried to defragment all the tables at once by running this T-SQL: SELECT 'ALTER INDEX all ON ' + name + ' REORGANIZE;' + CHAR(10) + 'ALTER INDEX all ON ' + name + ' REBUILD;' FROM sys.tables And then…
Justin Dearing
  • 2,677
  • 6
  • 35
  • 51