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

From Jorge Sarmiento
Subject Re: Strange behaviour of SELECT ... IN
Date
Msg-id 200206270944.13485.jsarmiento@ccom.org
Whole thread Raw
In response to Re: Strange behaviour of SELECT ... IN  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: Strange behaviour of SELECT ... IN  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
> 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?

> 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?

> Oh, you did use VACUUM ANALYZE right?

yep...






pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: One source of constant annoyance identified
Next
From: Martijn van Oosterhout
Date:
Subject: Re: How should I do this?