Most Popular
1500 questions
18
votes
1 answer
Is it possible to create an alias or synonym for a database?
Is it possible to create a database alias or synonym? What I am hoping to be able to do is have NewDatabaseName aliased as OldDatabaseName to prevent having to rewrite a ton of code.
Backstory:
I was approached by a client with a ridiculous…

datagod
- 7,016
- 4
- 35
- 56
18
votes
1 answer
Term for a one-row table?
Is there a specific term to describe a relation with a cardinality of one?
I'm thinking particularly of RDBMS "special" one-row tables, for example, DUAL (Oracle), SYSIBM.SYSDUMMY1 (DB2, Derby) and RDB$DATABASE (Interbase, Firebird).

pilcrow
- 350
- 1
- 6
18
votes
2 answers
Difference between row-based and statement-based replication in MySQL?
What is the actual difference between row-based and statement-based replication. I am actually looking in terms of replication's effect on the slave.
If I am using row-based replication then what is the effect on the slave and if I am using…

Abdul Manaf
- 9,379
- 14
- 68
- 83
18
votes
2 answers
Scaling PostgreSQL TRIGGER(s)
How Postgres triggers mechanism scales ?
We have a large PostgreSQL installation and we are trying to implement an event based system using log tables and TRIGGER(s).
Basically we would like to create a TRIGGER for each table we want to be…

Ugo Matrangolo
- 181
- 1
- 1
- 3
18
votes
1 answer
What are the optimal mysqldump settings?
After some search I ended up with the following settings:
mysqldump\
--host=localhost\
--port=3306\
--databases ****\
--user=****\
--password=****\
--default-character-set=utf8\
--add-drop-database\
…

user706838
- 303
- 1
- 3
- 7
18
votes
1 answer
MySQL open_files_limit - cannot change this variable
I'm running into issues because my open_files_limit for mysql is only 1024.
Centos 7, MySQL Community Server 5.6.22-log
It's actually a vps dedicated to mysql for a WHM server (remote mysql), but that should be beside the point.
Config…

user24601
- 503
- 1
- 3
- 8
18
votes
6 answers
Transaction Log won't shrink, DB thinks it is replicating
I've got a SQL Server 2008 R2 Express database running Kaspersky Security Center, and I have no idea under what circumstances the install happened, but the database appears to think that it's being replicated and will not free any space from the…

Sammitch
- 306
- 1
- 3
- 9
18
votes
4 answers
SQL Server Max Memory not limiting use of RAM
I would like your input on this. I have a sql server 2008r2 Ent. Ed. 64bit with 16 cores and 64GB RAM. There is one instance of SQL server patched fully as of 20111014.
The max ram is set to 60000MB. Amount of free ram is 0 according to task manager…

Martin Sjöberg
- 663
- 1
- 6
- 12
18
votes
3 answers
EXCEPT operator vs NOT IN
The EXCEPT operator was introduced in SQL Server 2005 but what is the difference between NOT IN and EXCEPT ?
Does it do the same? I would like a simple explanation with an example.

Heisenberg
- 1,447
- 5
- 18
- 30
18
votes
7 answers
What is a good way to store a large number of columns?
I have a problem deciding how to store this data in my database. Any suggestions on the best way to do it? I don't know a hell of a lot about databases, I might add.
I have data coming in formatted like so, but rather than 4, the number of columns…

James
- 241
- 2
- 6
18
votes
1 answer
How to index a query with `WHERE field IS NULL`?
I have a table with lots of inserts, setting one of the fields (uploaded_at) to NULL. Then a periodic task selects all the tuples WHERE uploaded_at IS NULL, processes them and updates, setting uploaded_at to current date.
How should I index the…

Kirill Zaitsev
- 283
- 1
- 2
- 7
18
votes
2 answers
What are database statistics, and how can I benefit from them?
I've heard mention of statistics that SQL Server keeps by default. What are they tracking, and how can I use this information to improve my database?

goric
- 1,536
- 3
- 17
- 24
18
votes
2 answers
"Copying to tmp table" extremely slow
This is my example of query:
SELECT
nickname,
CASE class_id
WHEN 1 THEN 'Druid'
WHEN 2 THEN 'Necromancer'
WHEN 3 THEN 'Mage'
WHEN 4 THEN 'Priest'
WHEN 5 THEN 'Warrior'
WHEN 6 THEN 'Stalker'
WHEN 7…

Gofrolist
- 181
- 1
- 1
- 3
18
votes
1 answer
PostgreSQL complaining about shared memory, but shared memory seems to be OK
I've been performing kind of intensive schema dropping and creating over a PostgreSQL server, but now complains..:
WARNING: out of shared memory
ERROR: out of shared memory
HINT: You might need to increase max_locks_per_transaction.
But the…

48347
- 56
- 2
- 7
- 26
18
votes
4 answers
Is there any benefit of a primary key that comprises all columns of the table?
I have a table with four columns that are all non-nullable, and the data is such that all four are needed to distinguish a unique record. This means that if I were to make a primary key, it would need to comprise all columns. Queries against the…

goric
- 1,536
- 3
- 17
- 24