Re: BRIN indexes for MAX, MIN, ORDER BY?
От | Heikki Linnakangas |
---|---|
Тема | Re: BRIN indexes for MAX, MIN, ORDER BY? |
Дата | |
Msg-id | 56095B6D.6030106@iki.fi обсуждение исходный текст |
Ответ на | Re: BRIN indexes for MAX, MIN, ORDER BY? (Marti Raudsepp <marti@juffo.org>) |
Список | pgsql-hackers |
On 09/28/2015 05:28 PM, Marti Raudsepp wrote: > Note that Alexander Korotkov already started work in 2013 on a > somewhat similar feature called partial sort: > http://www.postgresql.org/message-id/CAPpHfdscOX5an71nHd8WSUH6GNOCf=V7wgDaTXdDd9=goN-gfA@mail.gmail.com > > In particular, see the 2nd patch for KNN sort -- it uses known > bounding boxes from the GiST index for sorting, which in many ways is > similar to min/max BRIN ranges. > >> *partial-knn-1.patch* >> >> KNN-GiST provides ability to get ordered results from index, but this order >> is based only on index information. For instance, GiST index contains >> bounding rectangles for polygons, and we can't get exact distance to >> polygon from index (similar situation is in PostGIS). In attached patch, >> GiST distance method can set recheck flag (similar to consistent method). >> This flag means that distance method returned lower bound of distance and >> we should recheck it from heap. > > Unfortunatley this work has stalled. No, that was actually committed for 9.5. It's this item in the release notes: > Allow queries to perform accurate distance filtering of > bounding-box-indexed objects (polygons, circles) using GiST indexes > (Alexander Korotkov, Heikki Linnakangas) > > Previously, a common table expression was required to return a large > number of rows ordered by bounding-box distance, and then filtered > further with a more accurate non-bounding-box distance calculation. - Heikki
В списке pgsql-hackers по дате отправления: