Re: Aggregate not using BRIN index on timestamp - Mailing list pgsql-general

From Tom Lane
Subject Re: Aggregate not using BRIN index on timestamp
Date
Msg-id 12589.1565014830@sss.pgh.pa.us
Whole thread Raw
In response to Aggregate not using BRIN index on timestamp  (Jeremy Finzel <finzelj@gmail.com>)
Responses Re: Aggregate not using BRIN index on timestamp
List pgsql-general
Jeremy Finzel <finzelj@gmail.com> writes:
> I have a very large table with 4 billion rows and a BRIN index on timestamp
> spanning from 2013 to present.  I am running this simple query:
> SELECT MIN(created_at) FROM table;
> It is choosing a parallel seq scan as opposed to a BRIN bitmap scan.

> I can provide more info.  But first - am I missing something obvious?

Yes: BRIN indexes don't provide any ordering information.  A btree
index on created_at could be used to optimize this query, but without
one of those, seqscanning the whole table is the only possibility.

            regards, tom lane



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: why toasted is created when domain is used ?
Next
From: Jeremy Finzel
Date:
Subject: Re: Aggregate not using BRIN index on timestamp