# When High Correlation Makes PostgreSQL BRIN Indexes Slower

DevFeed: [When High Correlation Makes PostgreSQL BRIN Indexes Slower](<https://devfeed.tech/articles/when-good-correlation-is-not-enough-33921.md>)

Original publisher: [Read original article](<https://hakibenita.com/postgresql-correlation-brin-multi-minmax>)

Author: Haki Benita

Published: 2023-07-26T21:00:00Z

Content type: article

Language: en

Sources: [Haki Benita](<https://devfeed.tech/sources/haki-benita.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [articles](<https://devfeed.tech/tags/articles.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [performance](<https://devfeed.tech/tags/performance.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

This article explains how PostgreSQL block range indexes (BRIN) work and why high correlation can still produce significantly slower execution under certain reproducible conditions. It describes lossy index behavior and presents a recent PostgreSQL feature as a possible remedy.

## Source excerpt

Choosing to use a block range index (BRIN) to query a field with high correlation is a no-brainer for the optimizer. However, under some easily reproducible circumstances, a BRIN index can result in significantly slower execution even when the indexed field has very high correlation. In this article I describe how using a BRIN index in presumably "ideal circumstances" can result in degraded performance, and suggest a recent new feature of PostgreSQL as a remedy.