Re: Not using index - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Not using index
Date
Msg-id 402B3757.8010309@frodo.hserus.net
Whole thread Raw
In response to Not using index  ("Bas Scheffers" <bas@scheffers.net>)
List pgsql-general
Bas Scheffers wrote:
> Then I discovered "set enable_seqscan to off". It started using the index
> again. This is certainly not a case of it not being beneficial to use the
> index; using the index drops the query time from 260ms to 36ms!
>
> In most references I have seen, setting enable_seqscan to off is something
> only to be done for testing. But obviously if Postgres doesn't start
> behaving properly, I can't go to production without it. Is this the case
> or do many use this feature in production?
>
> Can you give Postgres index hints like you can do in Oracle and Sybase?

What is the exact query and table schema?

Are you sure it is not problem of cross data-types in where clause and indexes?

Postgresql uses indexes if it sees fit. Usually it is a better choice to let it
decide what it wants.

  Shridhar

pgsql-general by date:

Previous
From: "Bas Scheffers"
Date:
Subject: Not using index
Next
From: JM
Date:
Subject: Migrating 7.1.3 to 7.3.4 problem