Reputation
5,801
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
10 28
Newest
 sql
Impact
~314k people reached

Mar
1
awarded  Yearling
Feb
3
answered Source control makes sure my code is never lost, how do I make sure my users/orders database is never lost?
Jan
7
awarded  Popular Question
Sep
30
comment Do natural keys provide higher or lower performance in SQL Server than surrogate integer keys?
"Custom operations like ON UPDATE CASCADE might be ommited, because key values not changing." The effect of surrogate keys is to make every foreign key reference the equivalent of "ON UPDATE CASCADE". The key doesn't change, but the value it represents does.
Sep
28
comment Simple table normalisation
I've written about it here and on SO. Think about a "lookup" table--one column of data and an id number. Now drop the id number, write foreign keys to reference the data, and you avoid a join altogether. With other tables, you avoid a join every time the data you need is in a referenced key. (I was surprised how often this happens.) The tradeoff is between join performance and disk I/O. Prototypes indicated that natural keys would perform better in the test suite (dozens of queries) for decades without improvements in hardware (like SSDs).
Sep
28
comment Simple table normalisation
Have you measured the efficiency? (I have. You'll probably be surprised.)
Sep
28
answered Simple table normalisation
Sep
9
answered Is there any rule of thumb to optimize sql queries like this
Sep
4
answered How to get the total days per month between two dates?
Aug
13
comment How to create Combination of records (Order does not matter, no repetition allowed) in mySQL tables
"I needed to create a new table (recipe_index) that would show every possible combination of every recipe in recipe_table as a set of 3..." (and 4, and 5, and 6) For all practical purposes, 2.1E13 rows is not possible.
Aug
13
comment How to create Combination of records (Order does not matter, no repetition allowed) in mySQL tables
500 recipes taken 3 at a time is about 20 million combinations. 500 recipes taken 4 at a time is about 2.5 billion. 500 taken 5 at a time is about 255 billion. 500 taken 6 at a time is about 2.1E13. You don't need to do this more efficiently; you need to do something completely different.
Jul
31
answered What is a standard or conventional name for a column representing display order?
Jul
23
comment pgsql slow query on table of 500 million rows
Is the only information you want from the database the total number of rows?
Jul
23
answered Plan for storing transactions in an easily retrievable manner, indefinitely
Jul
22
revised Constraint on Composite Type
Documented to work in 8.0+
Jul
22
answered Constraint on Composite Type
Jul
21
revised How do I know what indexes to create for a table
added 91 characters in body
Jul
14
answered optimizing MySQL for traffic analytics system
Jul
12
comment Dump PostgreSQL without DROP DATABASE
I think DROP DATABASE is included only when you use both -c and -C options on pg_restore. As far as I can tell, pg_dump never includes DROP DATABASE.
Jul
11
comment Is it possible to keep track of changes to tables structure?
In a disciplined development environment, you'd use your version control system--subversion, mercurial, git, even RCS in a pinch.