|
|
|
|
|
by phamilton
821 days ago
|
|
I like it as an emergency measure, but I often see them used when there's a shallow understanding of operating the db. Before using a hint or rewriting a query to force a specific plan, I try and push the team to do these things: 1. Run `vacuum analyze` and tune the auto vacuum settings. This fixes issues surprisingly often.
2. Increase statistics on the table.
3. Tweak planner settings globally or just for the query. Stuff like `set local join_collapse_limit=1` can fix a bad plan. This is pretty similar to hinting, so not a huge argument that this is better beyond not requiring an extension. |
|