Re: Help optimizing a slow index scan

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Help optimizing a slow index scan
Дата
Msg-id b42b73150603170856j588b268bjd89ce769f4ac7a28@mail.gmail.com
обсуждение исходный текст
Ответ на Help optimizing a slow index scan  (Dan Harris <fbsd@drivefaster.net>)
Ответы Re: Help optimizing a slow index scan
Список pgsql-performance
On 3/16/06, Dan Harris <fbsd@drivefaster.net> wrote:
> explain analyze
> select distinct eventmain.incidentid, eventmain.entrydate,
> eventgeo.long, eventgeo.lat, eventgeo.geox, eventgeo.geoy
> from eventmain, eventgeo
> where
>     eventmain.incidentid = eventgeo.incidentid and
>     ( long > -104.998027962962 and long < -104.985957781349 ) and
>     ( lat > 39.7075542720006 and lat < 39.7186195832938 ) and
>     eventmain.entrydate > '2006-1-1 00:00' and
>     eventmain.entrydate <= '2006-3-17 00:00'
> order by
>     eventmain.entrydate;

As others will probably mention, effective queries on lot/long which
is a spatial problem will require r-tree or gist.  I don't have a lot
of experience with exotic indexes but this may be the way to go.

One easy optimization to consider making is to make an index on either
(incidentid, entrydate) or (incident_id,long) which ever is more
selective.

This is 'yet another query' that would be fun to try out and tweak
using the 8.2 upcoming row-wise comparison.

merlin

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

Предыдущее
От: Dan Harris
Дата:
Сообщение: Re: Help optimizing a slow index scan
Следующее
От: Steve Atkins
Дата:
Сообщение: Re: Background writer configuration