logoalt Hacker News

recursive11/20/20241 replyview on HN

It's not obviously true at all. Optimizing out `'' = 'x'` can be done for a fixed cost regardless of record count.


Replies

lovasoa11/20/2024

Optimizing out static expressions can be done in linear time at best. So if the number of clauses in WHERE is huge and the size of the underlying table is tiny (such as in the examples shown in the article we are commenting on), it will be better not to run the optimization.

But of course, in normal life, outside of the world of people having fun with Homomorphisms, queries are much smaller than databases.

show 1 reply