Re:SQL: One of the most valuable skills
by dorgo on Wednesday February 13, 2019 @01:38PM
(#19155459)
>save the query plan forever
is this even possible? Afaik, the query plan can depend on the data distribution and needs to be re-optimized when the data distribution changes.
Yeah, some of it is based on statistics, although in my experience, the relative distributions of rows don't massively change in my databases, so an ostensibly optimal query plan on day one isn't likely to be rubbish later. You can obviously imagine other people's mileage varying.
I've be very much in the market for something more modular than SQL, which had a much more customisable query planner so you could say "I don't care if you go away and compile this for an hour as long as you make it as quick as physically possible and then save the query plan forever".