3 ms·
> when Postgres picks a stupid plan and can't be convinced to do something reasonable. In my experience it can always be convinced to make a reasonable plan, b
by s08148692 3y ago
> when Postgres picks a stupid plan and can't be convinced to do something reasonable.
In my experience it can always be convinced to make a reasonable plan, but it's not always trivial. Sometimes it's just adding an index, sometimes it's entirely rewriting a query
- CubsFan1060 3y agoAgreed. I've found this setting to be difficult: https://postgresqlco.nf/doc/en/param/default_statistics_target/ https://postgresqlco.nf/doc/en/param/default_statistics_targ... Too low == bad query plan. Oddly, too high == bad query plan.
- Izkata 3y agoThere's also "the query plan you want won't do what you expect, so I'm giving you the next best thing until you tell me the right way to store the data": https://news.ycombinator.com/item?id=39311536 https://news.ycombinator.com/item?id=39311536