Re: Order by optimisations? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Order by optimisations?
Date
Msg-id 7590.1121403584@sss.pgh.pa.us
Whole thread Raw
In response to Re: Order by optimisations?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: Order by optimisations?
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> OK, so what's going on here?

> usa=> explain select * from users_myfoods_map where user_id=1 and 
> date='2003-11-03' order by date;
>                                                      QUERY PLAN 

> -------------------------------------------------------------------------------------------------------------------
>   Sort  (cost=4.84..4.85 rows=2 width=22)
>     Sort Key: date
>     ->  Index Scan using users_myfoods_map_user_id_date_key on 
> users_myfoods_map  (cost=0.00..4.83 rows=2 width=22)
>           Index Cond: ((user_id = 1) AND (date = '2003-11-03'::date))
> (4 rows)

Well, date evidently isn't the high-order key of this index.  But why
exactly are you worried about a sort of 2 rows?
        regards, tom lane


pgsql-hackers by date:

Previous
From: David Wheeler
Date:
Subject: Segfault Exiting psql
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Order by optimisations?