by TurkTurkleton · 6y ago · 0 comments
This is from the perspective of trying to get queries to run in 5 minutes instead of 30 minutes instead of hours or days or forever, not brief transactions measured in milliseconds. And it's not something I figured out on my own, but by paying attention to the guy who never talked but was consistently 10x faster in producing reports than anyone.
The thing you should not do, that I also saw people do, is use procedural PL/SQL or T-SQL to process things in a loop - that can be orders of magnitude slower.
Honestly, Postgres does it right - you can enforce your query plan to any level of detail you want.
https://pghintplan.osdn.jp/pg_hint_plan.html
(available on some cloud providers as well)