3 ms·
Boolean short circuiting is not guaranteed in SQL
- throwaway5250 8y agoIndeed, SQL is a declarative language. It'd be quite shocking if short circuiting were happening.
- karmakaze 8y agoIt's much better to think of SQL like math, as in sets and commutative operations than as a procedural language. And always use EXPLAIN to spot check performance assumptions, realizing that even then that can vary with data or usage. I usually find the opposite surprising, when I write an expression and the query planner hasn't re-arranged what I wrote into whatever it thought was best based on available indexes and gathered statistics.