Quesion on the use of indexes

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

 



A little background – I have various multi-column indexes whenever I have queries which restrict the output based on the values of the 2 fields (for example, a client code and the date of a transaction).

Is there a performance gain using this approach as opposed to using 2 separate indexes, one on the first column and one on the second column?

 

The reason I am asking is that my coding convetion goes back to the days where I used ISAM tables, so the systems did not know how to use more than a single index.

In some cases, I may have an index on (columna, columnb)  and one on (columnb, columna) due to the data access patterns.  If there are no performance gains in having these multi-part indexes, and performance will be the same as having one index solely on columna and one solely on columnb, then I can reduce the disk usage significantly in some cases.


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

  Powered by Linux