Re: Allowing extensions to supply operator-/function-specific info

From: Paul Ramsey <pramsey(at)cleverelephant(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allowing extensions to supply operator-/function-specific info
Date: 2019-03-04 19:20:45
Message-ID: CACowWR3fZRV6fGrH7vsVLqLz0TQJpmzb=wcipqAQBVZSn0sT4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

So I am getting much closer to a working implementation in PostGIS,
but have just run into an issue which I am assuming is my
misunderstanding something...

https://github.com/pramsey/postgis/blob/92268c94f3aa1fc63a2941f2b451be15b28662cf/postgis/gserialized_supportfn.c#L287

I had what seemed to be working code except for a couple rare cases,
but when I fixed those cases it turned out that I had a major problem:
building a <var> OP <const> expression works fine, but building a
<const> OP <var> expression returns me an error.

create table f as select st_makepoint(200*random() - 100, 200*random()
- 100) as g from generate_series(0, 100000);
create index f_g_x on f using gist (g);
explain select * from baz where st_coveredby('POINT(5 0)', geom);
explain select * from f where st_coveredby(g, 'POINT(5 0)');

QUERY PLAN
-----------------------------------------------------------------------------------
Bitmap Heap Scan on f (cost=13.36..314.58 rows=33334 width=32)
Filter: st_coveredby(g,
'010100000000000000000014400000000000000000'::geometry)
-> Bitmap Index Scan on f_g_x (cost=0.00..5.03 rows=100 width=0)
Index Cond: (g @
'010100000000000000000014400000000000000000'::geometry)

postgis=# explain select * from f where st_coveredby('POINT(5 0)', g);

ERROR: index key does not match expected index column

Any thoughts?

P

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2019-03-04 19:31:09 Re: Checksum errors in pg_stat_database
Previous Message Andres Freund 2019-03-04 19:06:12 Re: POC: converting Lists into arrays