Re: Aggregate not using BRIN index on timestamp

From: Jeremy Finzel <finzelj(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Aggregate not using BRIN index on timestamp
Date: 2019-08-05 15:10:06
Message-ID: CAMa1XUh4zy8uSLjQMH3UH_=bW84meeEduAci+_o2w_-paLgKRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> 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.
>

Thanks Tom. So, this is a very general question, but would it be possible
to develop that feature into BRIN, given what it stores? Even if it does
not have ordering information, doesn't it know which blocks would contain
the lowest values, so it could choose to do a "bitmap scan ordered sort" or
something, depending on the number of rows sought? Or is the problem that
it has no way of determining what value actually would be the "minimum"
without the query specifying a particular date, such as less than
"2013-04-01"?

Thanks!
Jeremy

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message PegoraroF10 2019-08-05 15:16:04 Re: why toasted is created when domain is used ?
Previous Message Tom Lane 2019-08-05 14:20:30 Re: Aggregate not using BRIN index on timestamp