How to force the parser to use index scan instead of sequential scan

Поиск
Список
Период
Сортировка
От ck
Тема How to force the parser to use index scan instead of sequential scan
Дата
Msg-id 1160199136.689868.167010@c28g2000cwb.googlegroups.com
обсуждение исходный текст
Ответы Re: How to force the parser to use index scan instead of sequential scan  ("Jaime Casanova" <systemguards@gmail.com>)
Список pgsql-general
Hello,

         I am using PostgreSQL 7.3.2. I have a large table in a
database , its primary key field is int8.
Almost all of my queries are written relaing to that field. That field
is B-Tree indexed. When i check the query plan i found that all the
queries are using sequential scan and index was not used. So my queries
are likely to be slow. But when i tried to convert the values given to
that field to int8 in a where condition then the parser is using the
index scan, Eg
select * from h057 where h057001 = 1142::int8
the above query uses index scan
select * from h057 where h057001 = 1142
the above query uses sequential scan.
Since there are large number of queries written and being used in the
production it is impossible to change all the queries. Please help me
by giving a suggestion to improve my query performance. I mean any
configuration level changes that helps to force the parser to use index
scan instead of sequential scan in the above case.
Thanks in advance.

ck


В списке pgsql-general по дате отправления:

Предыдущее
От: Matthew Peter
Дата:
Сообщение: Re: increment row number function question
Следующее
От: Rafal Pietrak
Дата:
Сообщение: predefined functions