Index-only scan on GIN index for COUNT() queries

From: Seamus Abshere <seamus(at)abshere(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Index-only scan on GIN index for COUNT() queries
Date: 2017-06-15 14:43:58
Message-ID: 1497537838.2262149.1010494488.001BE3EC@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,

We have a GIN index on jsonb_col. We always get Bitmap Index Scan +
Bitmap Heap Scan when we do things like

SELECT COUNT(*) FROM mytable WHERE jsonb_col ? 'key1'

Theoretically, could support be added for Index-only scans on GIN
indexes when only a COUNT() is requested?

Thanks,
Seamus

PS. Here is the real query analyze:
https://gist.github.com/seamusabshere/b9d72132361fa598f7a431fa1bcb120f

--
Seamus Abshere, SCEA
http://faraday.io
https://github.com/seamusabshere
http://linkedin.com/in/seamusabshere

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Lavoie 2017-06-15 16:49:28 CREATE FOREIGN TABLE difficulties
Previous Message Andreas Kretschmer 2017-06-15 10:31:49 Re: Repmgr + pgbouncer - Notification of master promotion to application level ...