Re: index scan with index cond on first column doesn't

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: index scan with index cond on first column doesn't
Дата
Msg-id 20030213141639.I50402-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: index scan with index cond on first column doesn't recognize sort order of second column  (Greg Stark <gsstark@mit.edu>)
Список pgsql-general
On 13 Feb 2003, Greg Stark wrote:

> Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
>
> > On 13 Feb 2003, Greg Stark wrote:
> >
> > > Here's a corner case where the optimizer is doing a redundant sort. I'm not
> > > sure if I'm doing something wrong or if it's just something the optimizer
> > > doesn't notice.
> >
> > I'm guessing that it doesn't realize that in this case the sort is
> > redundant since I think it's only necessarily redundant for = singlevalue
> > with no ors.
>
> I'm not sure. reading the code there does seem to be a special code path for
> ors anyways. This codepath claims to be for non-'or' restriction clauses.

Right, but it's more than just 'or' restrictions.  It's any case where the
condition returns more than one value of the first column that causes the
sort to be non-redundant AFAICS.  I'm at work so I can't really spend time
going through code, so I don't know if the code you're pointing to only
applies to conditions using equality, but I think greater than, less than,
would be examples where it'd not be redundant.






В списке pgsql-general по дате отправления:

Предыдущее
От: Patrick Nelson
Дата:
Сообщение: pgtcl way of specifying a user
Следующее
От: Dennis Gearon
Дата:
Сообщение: 'Universal' schedule table defintion