Most Popular

1500 questions
46
votes
5 answers

How to estimate/predict data size and index size of a table in MySQL

I am finding what is the best way to estimate size of a table for that I have studied lot of blogs and forums but unable to find any accurate answer For example, we have a table City with InnoDB engine,lets say in future (in next 1 year) it will…
Abdul Manaf
  • 9,587
  • 16
  • 73
  • 84
46
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…
46
votes
5 answers

How to SELECT from SHOW TABLE STATUS results

I'd like to limit the rows and columns that come back from the SHOW TABLE STATUS command in MySQL 5.1. Is there a way to get this same information through a SELECT statement so I can manipulate the results in a normal way?
Leopd
  • 825
  • 1
  • 7
  • 10
46
votes
10 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,357
  • 9
  • 33
  • 35
46
votes
12 answers

How could DBAs be more 'programmer friendly'?

The answers and comments on the dba.se version and programmers.se version of the question "What are the arguments against or for putting application logic in the database layer?" are very revealing about the divide between DBAs and programmers in…
Jack Douglas
  • 40,517
  • 16
  • 106
  • 178
46
votes
3 answers

Database Design: New Table versus New Columns

(This was suggested to be be repost here from StackOverflow) Currently have a table .. and need to start adding new data columns to it. Not every record (even going forward with new data after adding the new data columns) will have data. So I am…
cgmckeever
  • 585
  • 1
  • 4
  • 7
46
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
  • 571
  • 1
  • 4
  • 3
46
votes
9 answers

How should deletions be handled in the database?

I'd like to implement an "undelete" feature in a web application such that a user can change her mind and recover a deleted record. Thoughts on how to implement this? Some options I've considered are actually deleting the record in question and…
Abie
  • 885
  • 1
  • 8
  • 9
46
votes
7 answers

How to cast an integer to a boolean in a MySQL SELECT clause?

I'm new here so be kind to me. I have the following scenario: I have many tables which, for the sake of simplicity, are represented in a View in my MySQL database. My problem is that I need a value in this view representing if it is one kind of…
Bruno
  • 563
  • 1
  • 4
  • 5
45
votes
2 answers

What is the impact of LC_CTYPE on a PostgreSQL database?

So, I've few Debian servers with PostgreSQL on it. Historically, those servers and PostgreSQL are localized with the Latin 9 charset and back then it was fine. Now we have to handle things like Polish, Greek or Chinese, so changing it become a…
Gregoire D.
  • 553
  • 1
  • 4
  • 6
45
votes
2 answers

MySQL - varchar length and performance

Is declaring VARCHAR size make sense for performance? Is there any difference (in speed) between VARCHAR(50) and VARCHAR(255)? Or defining length is logic/design constraint?
Sonique
  • 553
  • 1
  • 4
  • 5
45
votes
4 answers

Can I install SQL Server Management Studio locally?

Can I install SQL Server Management Studio on my desktop to access a database on a SQL Server 2012 instance? If so, where can I find the installer? Google searches only return 'express' versions whereas, I am looking for the full SQL Server…
pgunston
  • 665
  • 2
  • 8
  • 11
45
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,049
  • 2
  • 12
  • 18
45
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,639
  • 3
  • 16
  • 14
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