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: Thu, 06 Apr 2006 23:17:16 -0400
Message-ID: <3544.1144379836@sss.pgh.pa.us> (raw)
In-Reply-To: <20060406092711.8725.qmail@web52315.mail.yahoo.com>
References: <20060406092711.8725.qmail@web52315.mail.yahoo.com>
Brian Herlihy <btherl@yahoo.com.au> writes:
> My options seem to be
> - Fudge the analysis results so that the selectivity estimate changes. I
> have tested reducing n_distinct, but this doesn't seem to help.
> - Combine the columns into one column, allowing postgres to calculate the
> combined selectivity.
> - Drop the (p2, p3) index. But I need this for other queries.
Have you considered reordering the pkey to be (p2,p3,p1) and then
dropping the (p2,p3) index?
regards, tom lane
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: <3544.1144379836@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