Re: Sorting a query on a view ignores an index

Поиск
Список
Период
Сортировка
От Mathieu De Zutter
Тема Re: Sorting a query on a view ignores an index
Дата
Msg-id 20030821162448.GC973@pleyel.kotnet.org
обсуждение исходный текст
Ответ на Re: Sorting a query on a view ignores an index  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Sorting a query on a view ignores an index
Список pgsql-performance
On Thu, Aug 21, 2003 at 10:59:11AM -0400, Tom Lane wrote:
> Mathieu De Zutter <mathieu@dezutter.org> writes:
> > However, i dont want the view to be presorted, but sort it in the
> > queries that use the view. When I do that, the index I have on that
> > field seems to be ignored. It stretches so far that, when I sort the
> > view on A and sort the query on A too, the query will try to sort
> > _again_ _without_ index and thus lose all performance.
>
> This is a limitation of the 7.3 query planner.  7.4 should do better.

Ok I'll have to live with that I guess.
Apart from avoiding views or subselects when sorting afterwards and
putting the whole bunch in a huge SQL statement (which i'll have to
produce on-the-fly), do you have an other alternative?
The 2 seconds is way to much, as the database will eventually run on a
machine that is 10 times slower.

With kind regards,

    Mathieu

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Sorting a query on a view ignores an index
Следующее
От: Bill Moran
Дата:
Сообщение: Re: Tests