min()/max() with BRIN indexes

From: Wayne <lists-pgsql(at)useunix(dot)net>
To: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: min()/max() with BRIN indexes
Date: 2020-02-29 16:50:24
Message-ID: 20200229165024.GD20190@ln-1.useunix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have rather large tables that use a time stamp as an index. New entries
are continuously added to the table with the current time. If I convert
from BTREE to BRIN indexes and select records with specific date ranges
the BRIN is used and performance is acceptable. However I often want to
get the latest time stamp using the max() function. I didn't expect that
this would result in a sequential scan of the table and skip the BRIN
index.

Is this expected behavior?

Thanks,
Wayne

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2020-02-29 19:37:15 Re: min()/max() with BRIN indexes
Previous Message Steve Midgley 2020-02-25 22:32:09 Re: Documentation of the pg_service file