pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Brian Herlihy <btherl@yahoo.com.au>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query planner is using wrong index.
Date: Fri, 07 Apr 2006 10:34:53 -0400
Message-ID: <11739.1144420493@sss.pgh.pa.us> (raw)
In-Reply-To: <20060407064108.49532.qmail@web52315.mail.yahoo.com>
References: <20060407064108.49532.qmail@web52315.mail.yahoo.com>

Brian Herlihy <btherl@yahoo.com.au> writes:
> Before I go, I have a question - From discussions on the Postgresql irc
> channel, and from reading the TODO list on the website, I am under the
> impression that there are no plans to allow optimizer hints, such as "use index
> table_pkey".  Is this really true?

I personally don't think it's a good idea: the time spent in designing,
implementing, and maintaining a usable hint system would be significant,
and IMHO the effort is better spent on *fixing* the optimizer problems
than working around them.  There are also good arguments about how hints
wouldn't be future-proof --- for instance, the recent addition of bitmap
indexscan capability would've obsoleted an awful lot of hints, had
anyone had any on their queries.  We'd then be faced with either turning
off the hints or being forced by them to adopt inferior plans.

The direction I'd like to see us go to solve your problem is maintaining
cross-column statistics.  It's not practical to store joint stats for
every set of columns, but the existence of an index on (p2,p3) ought to
cue us that p2/p3 stats would be worth having.

			regards, tom lane



view thread (12+ messages)

Message-ID: <11739.1144420493@sss.pgh.pa.us>
Permalink:  ../11739.1144420493@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11739.1144420493@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, btherl@yahoo.com.au
  Subject: Re: Query planner is using wrong index.
  In-Reply-To: <11739.1144420493@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox