Re: Index usage for sorted query

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

 




Instead of :

WHERE cd='ca' ORDER BY l_postcode;

Write :

WHERE cd='ca' ORDER BY cd, l_postcode;

You have a multicolumn index, so you should specify a multicolumn sort exactly the same as your index, and the planner will get it.


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

  Powered by Linux