pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tim Jones <TJones@optio.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: strange query behavior
Date: Wed, 13 Dec 2006 14:16:32 -0500
Message-ID: <10648.1166037392@sss.pgh.pa.us> (raw)
In-Reply-To: <47668A1334CDBF46927C1A0DFEB223D39F79A5@mail.optiosoftware.com>
References: <47668A1334CDBF46927C1A0DFEB223D39F79A5@mail.optiosoftware.com>

"Tim Jones" <TJones@optio.com> writes:
>   I have a query that uses an IN clause and it seems in perform great
> when there is more than two values in it but if there is only one it is
> really slow. Also if I change the query to use an = instead of IN in the
> case of only one value it is still slow.

Please provide EXPLAIN ANALYZE output for both cases.

> Possibly I need to reindex this
> particular index?

More likely you need to ANALYZE the table so that the planner has
up-to-date stats ...

			regards, tom lane



view thread (14+ messages)  latest in thread

Message-ID: <10648.1166037392@sss.pgh.pa.us>
Permalink:  ../10648.1166037392@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10648.1166037392@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, TJones@optio.com
  Subject: Re: strange query behavior
  In-Reply-To: <10648.1166037392@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