Re: Postgresql 11.3 doesn't use gist index on polygon column - Mailing list pgsql-general

From Вадим Самохин
Subject Re: Postgresql 11.3 doesn't use gist index on polygon column
Date
Msg-id CAGVmuwrEBq8D1bd+WQZLbmeGbJR4i2Nub3m-a2NXbTfekUVwng@mail.gmail.com
Whole thread Raw
In response to Re: Postgresql 11.3 doesn't use gist index on polygon column  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Oh, got it, thanks!

чт, 17 нояб. 2022 г. в 18:52, Tom Lane <tgl@sss.pgh.pa.us>:
Вадим Самохин <samokhinvadim@gmail.com> writes:
> 6. But postgresql still doesn't want to use my index:
> postgres=# explain analyze select * from zonez where '(2,2)'::point <@ p;

It can't, because "polygon @> point" isn't one of the operators supported
by that opclass.  You could use a polygon comparison:

=# \dAo gist poly_ops
               List of operators of operator families
  AM  | Operator family |       Operator       | Strategy | Purpose 
------+-----------------+----------------------+----------+----------
 gist | poly_ops        | <<(polygon,polygon)  |        1 | search
 gist | poly_ops        | &<(polygon,polygon)  |        2 | search
 gist | poly_ops        | &&(polygon,polygon)  |        3 | search
 gist | poly_ops        | &>(polygon,polygon)  |        4 | search
 gist | poly_ops        | >>(polygon,polygon)  |        5 | search
 gist | poly_ops        | ~=(polygon,polygon)  |        6 | search
 gist | poly_ops        | @>(polygon,polygon)  |        7 | search
 gist | poly_ops        | <@(polygon,polygon)  |        8 | search
 gist | poly_ops        | &<|(polygon,polygon) |        9 | search
 gist | poly_ops        | <<|(polygon,polygon) |       10 | search
 gist | poly_ops        | |>>(polygon,polygon) |       11 | search
 gist | poly_ops        | |&>(polygon,polygon) |       12 | search
 gist | poly_ops        | <->(polygon,point)   |       15 | ordering
(13 rows)

                        regards, tom lane

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: session_user different from current_user after normal login
Next
From: Alvaro Herrera
Date:
Subject: Re: MERGE output doubt