Re: Have I b0rked something? Slow comparisons on "where x in (...)" - Mailing list pgsql-general

From Richard Huxton
Subject Re: Have I b0rked something? Slow comparisons on "where x in (...)"
Date
Msg-id 4639AA68.2040003@archonet.com
Whole thread Raw
In response to Re: Have I b0rked something? Slow comparisons on "where x in (...)"  (Stephen Harris <lists@spuddy.org>)
Responses Re: Have I b0rked something? Slow comparisons on "where x in (...)"
List pgsql-general
Stephen Harris wrote:
> On Wed, May 02, 2007 at 12:45:08PM -0700, Dann Corbit wrote:
>> Have you done a vacuum on the table recently?
>
> We vacuum daily and cluster weekly after the nightly activities have been
> performed.
>
>> IN list, then the IN list might benefit from a bit of analysis for
>
> The IN list is just a set of integers (it's an integer index) generated
> from some selects on other tables earlier in our processing.  I don't
> have any choice as to what is in the IN list :-)

Try creating a temporary table, populating with the list and joining
against it. That's probably your best bet for a long list of target values.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: forcing use of a specific (expression) index?
Next
From: Alban Hertroys
Date:
Subject: Re: Cross-schema inheritence problem