Re: Question on Index usage

From: Michael Monnerie <michael(dot)monnerie(at)is(dot)it-management(dot)at>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Question on Index usage
Date: 2009-01-21 15:32:41
Message-ID: 200901211632.41348@zmi.at
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-admin

On Mittwoch 21 Januar 2009 Tom Lane wrote:
> No, AFAIR the planner will *always* include every possibly relevant
> condition for a given index.  If the condition is useless or nearly
> so, that might prompt it to pick a different index instead, but not
> to omit the indexqual.  I'm thinking it's not believing it can use
> the status condition with that index, perhaps for datatype reasons.
>  What is status declared as, exactly?

OK, now I'm sure you're speaking in a direction I didn't mean ;-)
But still, it could use the index _7 for the status field, as that's
sorted and 0,1,2 would be all together.

status | smallint | not null default (0)::smallint

Maybe it doesn't do because it could well be 0,1,3 also, and it's not
checking if all the values in the IN() statement appear in a row?

> Also, what PG version is this?

8.3 on openSUSE 11.1: select version();
PostgreSQL 8.3.5 on x86_64-unknown-linux-gnu, compiled by GCC gcc (SUSE
Linux) 4.3.2 [gcc-4_3-branch revision 141291]

mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Andreas Wenk 2009-01-21 15:34:40 Re: autovacuum daemon
Previous Message Merlin Moncure 2009-01-21 15:32:02 Re: [GENERAL] bytea size limit?