Re: Slow query problem

Поиск
Список
Период
Сортировка
От Dennis Björklund
Тема Re: Slow query problem
Дата
Msg-id Pine.LNX.4.44.0401090955490.13405-100000@zigo.dhs.org
обсуждение исходный текст
Ответ на Re: Slow query problem  (Richard Huxton <dev@archonet.com>)
Ответы Re: Slow query problem  (Richard Huxton <dev@archonet.com>)
Re: Slow query problem  (Bradley Tate <btate@objectmastery.com>)
Список pgsql-performance
On Fri, 9 Jan 2004, Richard Huxton wrote:

> > > select invheadref, invprodref, sum(units)
> > > from invtran
> > > group by invheadref, invprodref
>
> > For the above query, shouldn't you have one index for both columns
> > (invheadref, invprodref). Then it should not need to sort at all to do the
> > grouping and it should all be fast.
>
> Not sure if that would make a difference here, since the whole table is being
> read.

The goal was to avoid the sorting which should not be needed with that
index (I hope). So I still think that it would help in this case.

--
/Dennis Björklund


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Slow query problem
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Slow query problem