logoalt Hacker News

hinkley11/20/20241 replyview on HN

Why would it be too expensive to optimize out static subexpressions?


Replies

jjice11/20/2024

My guess is that the expense can be tricky to calculate since the additional optimization prior to executing the query may take longer than if the query was just able to run (depending on the dataset, of course). I wonder if it's too expensive to calculate a heuristic as well, so it just allows it to execute.

Just a guess.