pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Monnerie <michael.monnerie@is.it-management.at>
To: pgsql-admin@postgresql.org
Subject: Re: Question on Index usage
Date: Wed, 21 Jan 2009 16:32:41 +0100
Message-ID: <200901211632.41348@zmi.at> (raw)
In-Reply-To: <2116.1232551538@sss.pgh.pa.us>
References: <200901210854.28091@zmi.at>
	<20090121142829.GE4038@alvh.no-ip.org>
	<2116.1232551538@sss.pgh.pa.us>

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




view thread (6+ messages)  latest in thread

Message-ID: <200901211632.41348@zmi.at>
Permalink:  ../200901211632.41348@zmi.at/
Also on:    postgresql.org/message-id/200901211632.41348@zmi.at

 · 

reply

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-admin@postgresql.org
  Cc: michael.monnerie@is.it-management.at
  Subject: Re: Question on Index usage
  In-Reply-To: <200901211632.41348@zmi.at>

* 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