26 ms·
> Ok, from battle trenches: even if there is a perfect index for your query, the slower plan might still win and there is little you can do about it I often wo
by joelthelion 3y ago
> Ok, from battle trenches: even if there is a perfect index for your query, the slower plan might still win and there is little you can do about it
I often wonder why, in addition to sql, we don't have a low level language allowing you to specify exactly how you want your query executed?
- silon42 3y ago+1.. for production I'd like this and disable statistics and also disable table scans on most queries.
- hobs 3y agoIf your query doesn't know its own cardinality and can't scan do you just know you're always going to return one row? I ask because otherwise in my mind disabling statistics is usually a Bad Plan.
- fulafel 3y agoHow good are the language interfaces (eg C) in PG for doing this? If I wanted to do reimplement join, for example.
- mcc1ane 3y agoPostgres (and core team)-specific - https://wiki.postgresql.org/wiki/OptimizerHintsDiscussion https://wiki.postgresql.org/wiki/OptimizerHintsDiscussion
- masklinn 3y agoQuery hints are a very different thing. What I would like, and I assume GP as well, is the ability to write the low-level querying, as in bypass SQL and the planner, and give postgres the post-planner bytecode itself.
- joelthelion 3y agoExactly. I use hints as well, but in the end, you wonder, why waste your time trying to get the optimizer to do what you want, when you could bypass it entirely?