Re: Index usage for sorted query - Mailing list pgsql-performance

From Pierre-Frédéric Caillaud
Subject Re: Index usage for sorted query
Date
Msg-id opshrtzhakcq72hf@musicbox
Whole thread Raw
In response to Index usage for sorted query  (Markus Schaber <schabios@logi-track.com>)
Responses Re: Index usage for sorted query
List pgsql-performance
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.

pgsql-performance by date:

Previous
From: Markus Schaber
Date:
Subject: Index usage for sorted query
Next
From: Tom Lane
Date:
Subject: Re: Index usage for sorted query