logoalt Hacker News

hinkley • 11/20/2024 • 1 reply • view on HN

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


Replies

jjice • 11/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.