Hacker News new | past | comments | ask | show | jobs | submit login

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.




To add to this, did you know changing the order of your joins can impact the query plan chosen?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: