Skip to content

Instantly share code, notes, and snippets.

@ajohnstone
Created June 17, 2013 21:27
Show Gist options
  • Save ajohnstone/5800611 to your computer and use it in GitHub Desktop.
Save ajohnstone/5800611 to your computer and use it in GitHub Desktop.
*************************** 10. row ***************************
Id: 11408
User: root
Host: localhost
db: glt
Command: Query
Time: 212
State: Sending data
Info: SELECT (t1.cid + 1) as gap_starts_at,
(SELECT MIN(t3.cid) -1 FROM acid_event t3 WHERE t3.cid > t1.cid) as gap_ends_at
FROM acid_event t1
WHERE NOT EXISTS (SELECT t2.cid FROM acid_event t2 WHERE t2.cid = t1.cid + 1)
HAVING gap_ends_at IS NOT NULL
Rows_sent: 0
Rows_examined: 1589439392
Rows_read: 1589439392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment