From: | "Bupp Phillips" <hello(at)noname(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Optimizer picks an ineffient plan |
Date: | 2003-09-04 06:05:50 |
Message-ID: | bj6knf$tkh$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Well, it's unfortunate that you feel that way, because SQL Server handles it
correctly.
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in message
news:4375(dot)1062643465(at)sss(dot)pgh(dot)pa(dot)us(dot)(dot)(dot)
> Greg Stark <gsstark(at)mit(dot)edu> writes:
> > "Bupp Phillips" <hello(at)noname(dot)com> writes:
> >> select * from customer order by customer_id, first_name;
> >> [ where customer_id is the primary key ]
>
> > However you do have a point. In this case I don't think postgres even
> > considers using the index.
>
> It will not, since the index does not appear to provide the correct sort
> order.
>
> > However I'm not sure I see a lot of cases where this would come up.
>
> Yes, that's the real crux of the matter. Should the optimizer spend
> cycles on *every* query to detect cases where the user has written
> useless sort keys? I've got grave doubts that it's a win. ISTM such
> an optimization penalizes the folk who write their queries well to
> benefit those who are careless.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Stark | 2003-09-04 06:16:21 | Re: Optimizer picks an ineffient plan |
Previous Message | btober | 2003-09-04 05:46:59 | Re: setting last_value of sequence |