Most Popular
1500 questions
22
votes
1 answer
postgresql rename a foreignkey after renaming a table
I renamed a table, and apparently a foreignkey in it doesn't get changed, and causing problems,
Although when I \d error I get:
"error_test_id_fkey" FOREIGN KEY (test_id) REFERENCES test(id) ON DELETE CASCADE
Which the only relation to error name,…
Boaz
- 323
- 1
- 2
- 4
22
votes
5 answers
Using IF in T-SQL weakens or breaks execution plan caching?
It has been suggested to me that the use of IF statements in t-SQL batches is detrimental to performance. I'm trying to find some confirmation or validate this assertion. I'm using SQL Server 2005 and 2008.
The assertion is that with the following…
AnthonyWJones
- 321
- 2
- 5
22
votes
7 answers
Get last full backup and transaction log backup for each database
How to write script or a query that will display the last full backup and the last log backup for each database on each of the production servers using the system table "backupset" and related backup tables.
Janice
- 325
- 1
- 3
- 4
22
votes
2 answers
Postgres incomplete startup packet error
I am attempting to install Postgres 9.3 on Ubuntu 14.04 and I am getting an irksome error on startup. Here's what I'm seeing:
$ sudo service postgresql restart
* Restarting PostgreSQL 9.3 database server
* Error: could not exec…
andrewniesen
- 661
- 4
- 10
- 15
22
votes
3 answers
Why not rebuild indexes with page count <1000?
I use Ola Hallengrens script for Index maintenance. Before I did that, I used the following query to see which indexes are fragmented most:
SELECT dbschemas.[name] as 'Schema',
dbtables.[name] as 'Table',
dbindexes.[name] as…
user1261104
- 415
- 2
- 4
- 7
22
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
- 343
- 1
- 3
- 7
22
votes
4 answers
Why won't some DBMS's allow rollback for certain DDL statements?
Recently I found out that MySQL doesn't support rollback of DDL such as "alter table"... Being used to PostgreSQL, that struck me as odd, but a friend of mine told me that even Oracle doesn't allow it.. Are there technical reasons for not supporting…
Joril
- 441
- 1
- 5
- 10
22
votes
2 answers
PostgreSQL maximize performance SSD
I will have a huge PostgreSQL 9.3 database with many tables with more than 100M entries per table. This database will be basically be read-only (once I fill all the necessary tables and build the indexes no more write operations on the DB) and…
Alexandros
- 1,022
- 4
- 12
- 23
22
votes
5 answers
Does restarting SQL Server speed it up?
I have noticed that some DBAs restart SQL Server very frequently, sometimes even nightly. I believe they do it to free up some memory, or perhaps to speed up queries too. I know that after a restart query plans have to be recompiled, but even…
MAK
22
votes
2 answers
Does amazon rds PostgreSQL require vacuum?
It isn't clear if auto vacuum is running in rds. Thanks!
Chris kinsman
- 221
- 1
- 2
- 3
22
votes
3 answers
Copy maintenance plans to a different server
Is there a way to copy maintenance plans from one SQL Server 2012 to another? Both servers are not accessible via the same copy of Management Studio at the same time (on different networks).
Greg Bala
- 1,025
- 3
- 10
- 20
22
votes
3 answers
How to Log All mysql queries into log file?
I am using Mysql 5.6.12 under Wamp server environment. Now I want to log All queries into ".log" file, the queries which are running by PHP or from PHPMyAdmin, I want to log them...
Qazi
- 323
- 1
- 2
- 8
22
votes
2 answers
Get postgres snapshot from Amazon RDS
I can not find a simple way to get a copy of the nightly backup I take of my Amazon RDS postgres instance so I can restore it on my local machine to play with.
Right now I'm doing a pg_dump when I need a copy, but it would be nicer (and faster,…
Hsiu Dai
- 351
- 1
- 2
- 5
22
votes
3 answers
How to determine MySQL queries per day?
I'm investigating the big switch from MySQL to a NoSQL DBaaS and I've run into an issue trying to forecast expenses. Essentially, I can't figure out how many queries my current MySQL server handles per day to try and estimate the number of requests…
AJB
- 395
- 1
- 3
- 8
22
votes
4 answers
MySQL - Alter table to automatically put in a UUID
Ok, I know I've done this before. But I cannot for the life of me figure it out. I created a table. One of the columns is labled "LogID", it is also the primary key.
How do I alter it so that this column generates a UUID for each new entry?…
Matt Winer
- 395
- 1
- 3
- 7