2 ms·
Yes, and Postgres remains staunchly opposed to planner hints because the planner knows better! It always computes the optimal query plan! The "optimal query pl
by mike_hock 3y ago
Yes, and Postgres remains staunchly opposed to planner hints because the planner knows better! It always computes the optimal query plan!
The "optimal query plan" changes at the drop of a hat, as you can see in this case. Absolutely trivial syntax changes result in a completely different query, sometimes turning a sequential scan into an index-only scan or vice versa. So, 100x difference in query time, it doesn't just do that for small tables.
- polishdude20 3y agoTo add to this, did you know changing the order of your joins can impact the query plan chosen?