~/talk

Beware of nondeterministic T-SQL code

Talkat SQLBits 2019 · 2019-02-27..03-02· [databases]
links:none on file
slides:none on file

Shows concrete nondeterminism bugs and fixes: pagination with OFFSET/FETCH returns duplicate rows unless ordering is a strict total order (add a unique tiebreaker like orderID), TOP can use different indexes so include the tiebreaker or use TOP ... WITH TIES carefully, ROW_NUMBER vs RANK/DENSE_RANK choices change results, CTEs inline and can be evaluated twice causing different row numbers, running totals need RANGE or grouping+window sum, and a trick to avoid sorting uses a non‑foldable constant expression.

AI-written summary · about

  1. 0:00Introduction to the session
  2. 1:14Understanding determinism
  3. 4:21Pagination and ordering issues
  4. 6:47Offset fetch design
  5. 9:30Fixing non-deterministic pagination
  6. 16:31Handling ties in top filters
  7. 21:23Separating filtering and presentation
  8. 27:02Window functions and ranking
  9. 35:12Running totals and scope
  10. 45:46Advanced non-deterministic tricks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.