Re: Strange behaviour of SELECT ... IN - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Strange behaviour of SELECT ... IN
Date
Msg-id 20020628091413.A15124@svana.org
Whole thread Raw
In response to Re: Strange behaviour of SELECT ... IN  (Jorge Sarmiento <jsarmiento@ccom.org>)
List pgsql-general
On Thu, Jun 27, 2002 at 09:44:13AM -0400, Jorge Sarmiento wrote:
> > Wrong. The number of rows has everything to do with it. If the number of
> > rows exceeds 50% of the table, a sequential scan is faster than an index
> > scan.
>
> Mi database has 3 000 000 registries, my queries are usually of 50 - 100
> rows... so index is faster right?

Well, you'll need to send the EXPLAIN ANALYZE output because my ESP module
doesn't appear to be working. There is no easy explanation for why a query
doesn't use an index scan.

> > You can use enable_seq_scan=off to force it. Let us know if the index scan
> > is actually significantly faster.
>
> I have inserted that line in postgresql.conf, and received an error.
> where should it be put?

In psql: set enable_seq_scan=off

or something like that.

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.



pgsql-general by date:

Previous
From: Patrick Bakker
Date:
Subject: Wrap-around undo/redo log of temporal/time travel/versioned table
Next
From: s
Date:
Subject: transfer data from oracle to postgres