Re: [RFC] speed up count(*) - Mailing list pgsql-hackers

From John Naylor
Subject Re: [RFC] speed up count(*)
Date
Msg-id CAFBsxsFMe9FrRoAaEB1nwGy0v6fo6urtxxoMQ1E+pDxz+R2tLA@mail.gmail.com
Whole thread Raw
In response to Re: [RFC] speed up count(*)  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
List pgsql-hackers

On Wed, Oct 20, 2021 at 2:41 PM Tomas Vondra <tomas.vondra@enterprisedb.com> wrote:

> BTW you mentioned using BRIN indexes for min/max - I've been thinking
> about using BRIN indexes for ordering/sorting, which seems related. And
> I think it's actually doable, so I wonder why you concluded using BRIN
> indexes for min/max is not possible?

I just gathered it was not implemented in the planner, going by the explain plan in the toy query I tried, and then I got the lightbulb in my head about count(*).

--
John Naylor
EDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Interrupts vs signals
Next
From: Mark Dilger
Date:
Subject: Re: Extending amcheck to check toast size and compression