Re: Query planner is using wrong index.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brian Herlihy <btherl(at)yahoo(dot)com(dot)au>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query planner is using wrong index.
Date: 2006-04-07 03:17:16
Message-ID: 3544.1144379836@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Brian Herlihy <btherl(at)yahoo(dot)com(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Brian Herlihy 2006-04-07 06:41:08 Re: Query planner is using wrong index.
Previous Message Brian Herlihy 2006-04-07 00:15:38 Re: Query planner is using wrong index.