Reputation
12,381
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
21 46
Impact
~711k people reached

3h
revised Every “INSERT” query check a combination of column's records
added 248 characters in body
3h
answered Every “INSERT” query check a combination of column's records
2d
awarded  database-design
2d
revised novice-design: Are FOREIGN KEYs always necessary? Joins on columns which are not PK
Added note about FKs not implying indexes
2d
answered novice-design: Are FOREIGN KEYs always necessary? Joins on columns which are not PK
Feb
4
revised Foreign Keys doesn't work as I expect
Corrected update->insert, expended "if your UI" to include why it might
Feb
4
answered Foreign Keys doesn't work as I expect
Feb
3
revised Enforce NOT NULL for set of columns with a CHECK constraint only for new rows
added 364 characters in body
Feb
3
answered Enforce NOT NULL for set of columns with a CHECK constraint only for new rows
Jan
26
answered In Oracle what is the difference between STDEV and STDEV_SAMP functions?
Jan
21
revised 1062 Duplicate entry but there are no duplicates?
Added text about `ON DUPLICATE` (from comments), `MERGE` and `UPSERT`. Also spelling.
Jan
20
comment How to optimize indexes on MySQL query with various sorts
It could be as little as just three data pages, plus a one or two internal index (branch) pages that need to be read to locate those data (leaf) pages.
Jan
20
comment How to optimize indexes on MySQL query with various sorts
Reading 1,000 rows is very unlikely to be 1,000 IO operations. I'm no expert on InnoDB's internal structures but as it is based on some variation of b-trees it can't be unrecognisably different to MS SQL Server or similar. It apparently uses 16Kb pages, so with those column sizes that is between ~40 and ~400 rows per page for the base data so assuming an index that covers everything and little fragmentation that is 25 pages or less, and depending on allocation method they might be sequential (or close to) on disk rendering random-IO-per-second figures less meaningful.
Jan
20
comment How can I monitor the progress of an import of a large .sql file?
@snapfractalpop pv won't be overly accurate in many cases because some chunks of SQL will take more time to process than others. A line that constitutes a simple insert will run a lot faster than one that creates on index on a table that already has many rows, for instance. But a a rough idea of progress the output should be helpful unless the read buffer used by mysql is particularly large (for a 7Gb input the buffer would need to be very large to render pv's output not useful at all.
Jan
19
revised SQL Server comparing dates algorithm
added 75 characters in body
Jan
18
revised SQL Server comparing dates algorithm
added 162 characters in body
Jan
18
answered SQL Server comparing dates algorithm
Jan
14
revised Kick a single user out of the database
added 4 characters in body
Jan
14
answered Kick a single user out of the database
Jan
12
revised Index Seek vs Index Scan
Added notes about incomplete scans when other logic allows early abort.