Not using index
От | Bas Scheffers |
---|---|
Тема | Not using index |
Дата | |
Msg-id | 10158.80.177.109.207.1076573638.squirrel@io.scheffers.net обсуждение исходный текст |
Ответы |
Re: Not using index
Re: Not using index |
Список | pgsql-general |
Hi, I have a table with about 100K rows, on which I have created a btree index of the type table_name(int, int, int, timestamp). At first postgres was using it for my AND query on all four columns, but after dropping it and creating different ones and testing, it suddenly stopped using it. Vaccuuming, reindexing, recreating the table and even recreating the database all didn't help. 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? Any clues? Thanks, Bas.
В списке pgsql-general по дате отправления: