Skip site navigation (1) Skip section navigation (2)

Re: strange query behavior

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tim Jones" <TJones(at)optio(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: strange query behavior
Date: 2006-12-13 19:16:32
Message-ID: 10648.1166037392@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Tim Jones" <TJones(at)optio(dot)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

In response to

Responses

pgsql-performance by date

Next:From: Tomeh, HusamDate: 2006-12-13 19:25:00
Subject: Re: Optimizing a query
Previous:From: RagnarDate: 2006-12-13 19:15:11
Subject: Re: strange query behavior

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group