Re: many 'OR' in WHERE-condition

From: Richard Huxton <dev(at)archonet(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: many 'OR' in WHERE-condition
Date: 2007-04-20 11:03:44
Message-ID: 46289E10.9060302@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

A. Kretschmer wrote:
> in a SELECT with a condition 'WHERE foo IN (1,2,3,4,...)' with a large
...
> But if the list increase the planner choose an seq-scan. The amount of
> values in the list is about 200 and the table has about 250.000 rows.
>
> How can we avoid the seq-scan?

Are you sure you'd want to? What plan have you found to be faster with
200 tests?

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2007-04-20 11:14:23 Re: We all are looped on Internet: request + transport = invariant
Previous Message Dmitry Turin 2007-04-20 09:08:19 Re: We all are looped on Internet: request + transport = invariant