Postgresql – DISTINCT ON needing Bitmap Heap Scan
I have a query like: SELECT DISTINCT ON (services.group_id) services.service_id, ... FROM services WHERE services.group_id IN ('67240181b97477f054f9b1bc', '67240181b97477f054f9b1be') I have an index on group_id. Why does Postgres need to do an extra heap scan? I just want any 1st match…