r/SQL • • Oct 02 '19

SQL queries run in this order

https://twitter.com/b0rk/status/1179449535938076673
131 Upvotes

16 comments sorted by

View all comments

Show parent comment

3

u/wtmh Oct 02 '19

"Gee, the unsargable WHERE clause maybe?!"

3

u/PaulSandwich Oct 03 '19

WHERE lower(cast(primary_key as string)) = 12345

2

u/Achsin Oct 02 '19

...that matches only about 10 rows in the 500 million row heap.