Re: Query about index usage

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

 



Jayadevan M wrote:
One query about PostgreSQL's index usage. If I select just one column on which there is an index (or select only columns on which there is an index), and the index is used by PostgreSQL, does PostgreSQL avoid table access if possible?

PostgreSQL keeps information about what rows are visible or not in with the row data. It's therefore impossible at this time for it to answer queries just based on what's in an index. Once candidate rows are found using one, the database must then also retrieve the row(s) and do a second check as to whether it's visible to the running transaction or not before returning them to the client.

Improving this situation is high up on the list of things to improve in PostgreSQL and the value of it recognized, it just hasn't been built yet.

--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@xxxxxxxxxxxxxxx   www.2ndQuadrant.us


--
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux