Re: "Skipping" BitmapHeapScan for simple counts

2021-04-30 Thread Tom Lane
Maarten Mortier writes: > We have a jsonb_ops GIN index on this field, because we query the following > "freeform" match: > SELECT COUNT(id) > FROM records > WHERE data @@ '$.**.label == "person"'; > However, in the case of jsonb queries above, there is no need to do the > BitmapHeapScan really:

"Skipping" BitmapHeapScan for simple counts

2021-04-30 Thread Maarten Mortier
Hello, We have a table with raw jsonb data in a field "data". We have a jsonb_ops GIN index on this field, because we query the following "freeform" match: SELECT COUNT(id) FROM records WHERE data @@ '$.**.label == "person"'; When analysing this plan, it seems the BitmapIndexScan to do this is