pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ryan Holmes <ryan@hyperstep.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: IN operator causes sequential scan (vs. multiple OR expressions)
Date: Sat, 27 Jan 2007 18:53:06 -0500
Message-ID: <24016.1169941986@sss.pgh.pa.us> (raw)
In-Reply-To: <AE23623B-65E0-4CC8-8F7E-3920E4B42FDC@hyperstep.com>
References: <AE23623B-65E0-4CC8-8F7E-3920E4B42FDC@hyperstep.com>

Ryan Holmes <ryan@hyperstep.com> writes:
> I have a relatively simple query where the planner chooses a  
> sequential scan when using the IN operator but chooses an index scan  
> when using logically equivalent multiple OR expressions.

EXPLAIN ANALYZE for both, please?

If you set enable_seqscan = off, does that force an indexscan, and if so
what does EXPLAIN ANALYZE show in that case?

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <24016.1169941986@sss.pgh.pa.us>
Permalink:  ../24016.1169941986@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24016.1169941986@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, ryan@hyperstep.com
  Subject: Re: IN operator causes sequential scan (vs. multiple OR expressions)
  In-Reply-To: <24016.1169941986@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