pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert.Farrugia@go.com.mt
Cc: pgsql-admin@postgresql.org
Subject: Re: After VACUUM, statistics become skewed
Date: Sun, 25 May 2003 00:12:12 -0400
Message-ID: <3276.1053835932@sss.pgh.pa.us> (raw)
In-Reply-To: <20030523093733.0F9AC924DF1@developer.postgresql.org>
References: <20030523093733.0F9AC924DF1@developer.postgresql.org>

Robert.Farrugia@go.com.mt writes:
> Running a slightly modified query i.e. removing the in and using an 
> equality, the planner uses the "correct" index this time.

Hm.  What were the definitions of the two indexes, exactly?

There is an asymmetry in the planner's handling of AND/OR clauses that
can cause it to fail to recognize that a multicolumn index is usable,
depending on whether the OR clause (the IN part of your query) applies
to the first index column or a later one.  I'm not sure if this relates
to your problem or not, though...

			regards, tom lane



view thread (8+ messages)  latest in thread

Message-ID: <3276.1053835932@sss.pgh.pa.us>
Permalink:  ../3276.1053835932@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3276.1053835932@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, Robert.Farrugia@go.com.mt
  Subject: Re: After VACUUM, statistics become skewed
  In-Reply-To: <3276.1053835932@sss.pgh.pa.us>

* 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