Re: cannot use multicolumn index

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: MirrorX <mirrorx(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: cannot use multicolumn index
Date: 2011-09-19 02:39:16
Message-ID: CAOR=d=2dPOryEJ4di129RwhGR1pC3eCxrhUnboML9t23+Xv+Sw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Sep 14, 2011 at 6:50 AM, MirrorX <mirrorx(at)gmail(dot)com> wrote:
> any ideas on how i should write to query to use this index? thx in advance

You can do something like:

set enable_seqscan=off;
explain select yourqueryhere;

and see if the plan it comes up with is any better. Use explain
analyze to see how long it really takes. Basically if the index isn't
selective enough a seq scan will be a win, especially in pgsql where
it has to hit the table anyway, whether it uses the index or not.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2011-09-19 02:58:02 Re: How to make hash indexes fast
Previous Message Scott Marlowe 2011-09-19 02:37:44 Re: cannot use multicolumn index