Earlier quoted context omitted.
This is about to bake your noodle: https://www.postgresql.org/docs/current/geqo-pg-intro.html
GEQO is not to get a better plan than the traditional optimizer, it is to be able to get a plan at all when the query is large. And it's widely known for creating poor plans.
Training a 4B model to produce 81% faster query plans than Postgres
121–126 of 126 posts
Re: Training a 4B model to produce 81% faster query plans than Postgres
#122Earlier quoted context omitted.
The immediate problem: How do you know which one is better without running them?
Could you A/B at random, use that to collect data and eventually feed that back in to prefer A or B depending on the shape of the query?
Re: Training a 4B model to produce 81% faster query plans than Postgres
#123Earlier quoted context omitted.
> fixable and verifiable By people with a specific skill set. LLMs generation can also be fixed and verified by people with a certain skill set, and non-deterministic computing doesn't automatically mean unpredictable. When people say that the LLMs are a black box, it means unpredictability in unknown situations. You do structured output, input validation, output validation, lower temperature, limit decisions, RL, et…
Only if someone is planning on running a pinned self hosted version of an LLM alongside the DB to fix the problem. The developer can change the binary easy enough and test it but the LLM approach just seems either theoretical or bending ourselves in knots to justify using an LLM.
I just find the "all llms are non dererministic and therefore unreliable" narrative a bit backwards. All software that has more than 0 users needs to deal with non-determinism anyway :)
Re: Training a 4B model to produce 81% faster query plans than Postgres
#124Earlier quoted context omitted.
I’ve played with it already. I don’t think this is the use case. I think Jev’s use case is fast, cheap and somewhat easy classification. It’s not trainable in the way you would want here. Even though it’s fast it wont be faster than pgs query optimizer. At least as I understand things. How did you plan to use Jev for query optimization?
I am still struggling to understand a use-case for Jev. Isn't what was explained in this article a classification problem? I.e. find and aggregate data?
Re: Training a 4B model to produce 81% faster query plans than Postgres
#125Earlier quoted context omitted.
GEQO is not to get a better plan than the traditional optimizer, it is to be able to get a plan at all when the query is large. And it's widely known for creating poor plans.
Yes, but it's exactly the kind of hybrid between a regular planner and something generative (writ broadly) that they were asking about. Practically speaking if you're hitting the GEQO you've already failed as a query writer unless it's a purely OLAP on a dedicated beefy machine.
And yes, large joins is definitely for OLAP use. If you have 20-way joins for OLTP, you're either crazy or you're using an ORM.
Re: Training a 4B model to produce 81% faster query plans than Postgres
#126Earlier quoted context omitted.
pardon but aren't disks usually the bottleneck? im all for CUDA acceleration and CUDA accelerating culture
not necessarily, no. With SSDs you get much better IOPS for cold data, and many datasets fit in RAM. So a lot of (OLTP/HTAP) workloads can become CPU-bound due to sorting/hashing - bread and butter of joins.