Re: Can this query go faster???

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Can this query go faster???
Дата
Msg-id 20051206205048.GB22168@wolff.to
обсуждение исходный текст
Ответ на Re: Can this query go faster???  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-performance
On Tue, Dec 06, 2005 at 10:52:57 +0100,
  Csaba Nagy <nagy@ecircle-ag.com> wrote:
> Joost,
>
> Why do you use an offset here ? I guess you're traversing the table
> somehow, in this case it would be better to remember the last zipcode +
> housenumber and put an additional condition to get the next bigger than
> the last one you've got... that would go for the index on
> zipcode+housenumber and be very fast. The big offset forces postgres to
> traverse that many entries until it's able to pick the one row for the
> result...

The other problem with saving an offset, is unless the data isn't changing
or you are doing all of the searches in one serialized transaction, the
fixed offset might not put you back where you left off.
Using the last key, instead of counting records is normally a better way
to do this.

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Performance degradation after successive UPDATE's
Следующее
От: Alan Stange
Дата:
Сообщение: Re: postgresql performance tuning