Re: Selectivity and row count estimates for JSONB columns

2021-11-03 Thread Tom Lane
Joel Perren writes: > - generic_restriction_selectivity() returns the default value (0.01) for > data types that Postgres doesn't collect standard MCV and/or histogram > statistics for. I think this is what happens with Table B which (quite > correctly) does not have these statistics in pg_stats

Re: Selectivity and row count estimates for JSONB columns

2021-10-20 Thread Joel Perren
After some further investigation I think I might have actually got this the wrong way round. I now strongly suspect that what I am seeing is related to the presence of histogram_bounds for Table A (possibly a bug? or me being silly). Looking into the code ( https://github.com/postgres/postgres/blo

Selectivity and row count estimates for JSONB columns

2021-10-20 Thread Joel Perren
Hi all I have a Postgres/PostGIS database with two separate database tables each of which has the following column structure: - identifier (text) - geometry (geometryz,27700) - properties (jsonb) I have created a GIN index (jsonb_path_ops) over the properties column on both tables. As I underst