Re: indexing lat lon

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: indexing lat lon
Дата
Msg-id 14720.1088377460@sss.pgh.pa.us
обсуждение исходный текст
Ответ на indexing lat lon  ("Jonathan Raemdonck" <jonathan_raemdonck@hotmail.com>)
Список pgsql-general
"Jonathan Raemdonck" <jonathan_raemdonck@hotmail.com> writes:
> These are the steps I take now:
> 1 'draw' a box around the lat/lon position we have as input
> 2 search the DB for all the points in this box
> 3 measure the distance to each point in the box

Right.  All you need is an index amenable to step 2.

> Is there a good way of indexing the lat/lon column so lookup is faster?

Yeah, you can store the lat/long as a point, build an rtree index on it,
and use box-overlap as the indexable operator.  I seem to recall that
you actually have to store the lat/long as a box of zero size to get
this to work with the present set of rtree-indexable operators.  If you
look in the archives you will find some previous similar cases.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: tables can have at most 1600 columns
Следующее
От: Jay
Дата:
Сообщение: postgresql perl connectivity