Why PostgreSQL doesn't have query hints
This is how you make your users upset.<p>Speaking personally I have personally encountered times when PostgreSQL (this was in the 8.2 series) simply Could Not Find The Right Plan.  I looked at the tables and indexes.  I saw the right query plan.  It did not.  I did not have DBA access so I had no ability to try to figure out why.  However I <i>did</i> have the ability to rewrite my query into two, with the first going into a temp table.  This effectively forced PostgreSQL to use the query plan I knew would work, which caused my query to run in under a second as opposed to taking multiple minutes.<p>I had similar experiences with Oracle, and used query hints very successfully.<p>I don't dispute the claim that this likely happens only on 0.1% of queries.  Based on what I've seen in Oracle, I also suspect that most people who use hints use them as voodoo, and most of the time use them incorrectly.<p>However you're much more likely to hit that 0.1% if you're writing very complex queries (which happened to me when my role was devoted to reporting).  People can learn how databases are supposed to work (I certainly did).  Even then I acknowledge that 95-99% of the time it does better than I could.  But it is still really, really helpful to, in the remaining 1-5% of the time when the database goes wrong, be able to tell it the right way to do its job.  And in my personal experiences, the cases where the database gets it wrong, it wasn't a temporary problem - it stayed wrong.<p>But they don't acknowledge the existence of people like me.  They assume that I must be lazy, ignorant, or have had my bad experience decades ago.  Because <i>their</i> wonderful software certainly couldn't have given me bad experiences <i>in the last 3 years</i>.  (I'm no longer in that reporting role, so I don't hit that case any more.