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.