Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux