Thread: [PATCH v2] Introduce spgist quadtree @<(point,circle) operator

[PATCH v2] Introduce spgist quadtree @<(point,circle) operator

From
"Matwey V. Kornilov"
Date:
Hi,

This patch series is to add support for spgist quadtree @<(point,circle)
operator. The first two patches are to refactor existing code before
implemention the new feature. The third commit is the actual implementation
provided with a set of simple unit tests.

Changes since v2:
  - fix coding style
  - add comment to spg_quad_inner_consistent_circle_helper()
  - rework spg_quad_inner_consistent_circle_helper() using HYPOT() to make the
    search consistent with filter scan

Matwey V. Kornilov (3):
  Introduce helper variable in spgquadtreeproc.c
  Introduce spg_quad_inner_consistent_box_helper() in spgquadtreeproc.c
  Add initial support for spgist quadtree @<(point,circle) operator

 src/backend/access/spgist/spgquadtreeproc.c       | 147 +++++++++++++++-------
 src/include/catalog/pg_amop.dat                   |   3 +
 src/test/regress/expected/create_index_spgist.out |  96 ++++++++++++++
 src/test/regress/sql/create_index_spgist.sql      |  32 +++++
 4 files changed, 234 insertions(+), 44 deletions(-)

-- 
2.13.7

-- 
With best regards,
Matwey V. Kornilov

Attachment

Re: [PATCH v2] Introduce spgist quadtree @<(point,circle) operator

From
Michael Paquier
Date:
On Mon, May 20, 2019 at 02:32:39PM +0300, Matwey V. Kornilov wrote:
> This patch series is to add support for spgist quadtree @<(point,circle)
> operator. The first two patches are to refactor existing code before
> implemention the new feature. The third commit is the actual implementation
> provided with a set of simple unit tests.

Could you add that to the next commit fest please?  Here you go:
https://commitfest.postgresql.org/23/
--
Michael

Attachment

Re: [PATCH v2] Introduce spgist quadtree @<(point,circle) operator

From
"Matwey V. Kornilov"
Date:
вт, 21 мая 2019 г. в 08:43, Michael Paquier <michael@paquier.xyz>:
>
> On Mon, May 20, 2019 at 02:32:39PM +0300, Matwey V. Kornilov wrote:
> > This patch series is to add support for spgist quadtree @<(point,circle)
> > operator. The first two patches are to refactor existing code before
> > implemention the new feature. The third commit is the actual implementation
> > provided with a set of simple unit tests.
>
> Could you add that to the next commit fest please?  Here you go:
> https://commitfest.postgresql.org/23/

Done

> --
> Michael



--
With best regards,
Matwey V. Kornilov



Re: [PATCH v2] Introduce spgist quadtree @<(point,circle) operator

From
Alexander Korotkov
Date:
Hi Matwey,

On Tue, May 21, 2019 at 10:23 AM Matwey V. Kornilov
<matwey.kornilov@gmail.com> wrote:
> вт, 21 мая 2019 г. в 08:43, Michael Paquier <michael@paquier.xyz>:
> >
> > On Mon, May 20, 2019 at 02:32:39PM +0300, Matwey V. Kornilov wrote:
> > > This patch series is to add support for spgist quadtree @<(point,circle)
> > > operator. The first two patches are to refactor existing code before
> > > implemention the new feature. The third commit is the actual implementation
> > > provided with a set of simple unit tests.
> >
> > Could you add that to the next commit fest please?  Here you go:
> > https://commitfest.postgresql.org/23/
>
> Done

Thank you for posting this patch.  A took a look at it.

It appears that you make quadrant-based checks.  But it seems to be
lossy in comparison with box-based checks.  Let me explain this on the
example.  Imagine centroids (0,1) and (1,0).  Square (0,0)-(1,1) is
intersection of quadrant 2 of (0,1) and quadrant 4 of (1,0).  And then
imagine circle with center in (2,2) of radius 1.  It intersects with
both quadrants, but doesn't intersect with square.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company