Re: Adding an "and is not null" on an indexed field slows the query down immensely.

From: Tim Uckun <timuckun(at)gmail(dot)com>
To: pasman pasmański <pasman(dot)p(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Adding an "and is not null" on an indexed field slows the query down immensely.
Date: 2011-01-15 13:08:50
Message-ID: AANLkTik+HPHC3umeBrTA9VjhVCAv24Q=36Hc7B1zr423@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2011/1/16 pasman pasmański <pasman(dot)p(at)gmail(dot)com>:
> I think this is a planner's bug. Can you send these explains to pgsql-bugs ?
>

Sure. BTW I thought I would change the query a little by putting a AND
index_value .>100 instead of index_delta and it didn't help at all. I
thought maybe using another index would help but it didn't.

So what I did was add NULLS LAST which was more bearable.

This really should be a pretty quick query, there are only twenty
records after all and all criteria fields are indexed.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-01-15 13:21:41 Re: Install PostgreSQL as part of a desktop application, but how to coop with existing installations?
Previous Message pasman pasmański 2011-01-15 12:43:13 Re: Adding an "and is not null" on an indexed field slows the query down immensely.