| От | Tom Lane |
|---|---|
| Тема | Re: Indexing a field of type point |
| Дата | |
| Msg-id | 17550.1186680807@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Indexing a field of type point (David Cottingham <david.cottingham@cl.cam.ac.uk>) |
| Список | pgsql-sql |
David Cottingham <david.cottingham@cl.cam.ac.uk> writes:
> I have a table containing a field named location, of type point, i.e. a
> position in two dimensions. The table has several million records in, and I
> need to extract those records whose location value is contained within a
> certain bounding box.
Given the standard opclasses, your best bet is to convert the point into
a zero-volume box or circle, eg
create index i on t using gist (circle(pointcol,0))
and then express queries as "circle(pointcol,0) overlaps target-box".
PostGIS might have something more nicely adapted ...
regards, tom lane
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера