RE: Questions about btree_gin vs btree_gist for low cardinality columns

From: Steven Winfield <Steven(dot)Winfield(at)cantabcapital(dot)com>
To: Morris de Oryx <morrisdeoryx(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: RE: Questions about btree_gin vs btree_gist for low cardinality columns
Date: 2019-06-03 09:28:37
Message-ID: E9FA92C2921F31408041863B74EE4C2001BD706255@ccpmaildag02.cantab.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>As an example, we're dealing with millions of rows where we often want to find or summarize by a category value. So, maybe 6-10 categories that are used in various queries. It's not realistic for us to anticipate every field combination the category field is going to be involved in to lay down multi-column indexes everywhere.

Apologies if I’ve missed this somewhere else in the thread, but I’ve not seen anyone suggest that bloom indexes[1] be thrown into the mix.
Depending on your use case, you might be able to replace many multi-column btree indexes with a single bloom index, optimizing its size vs. performance using the “length” parameter. You could even reduce the number of bits generated for low cardinality columns to 1, which should reduce the number of false positives that are later removed by a condition recheck.
Maybe there’s a good reason for their omission, but I’d like to learn this I’m completely off the mark!

Steve.

[1] https://www.postgresql.org/docs/11/bloom.html

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daulat Ram 2019-06-03 09:55:56 Cause: org.postgresql.util.PSQLException: ERROR: could not resize shared memory segment "/PostgreSQL.1946998112" to 8388608 bytes: No space left on device
Previous Message Tom K 2019-06-03 04:48:04 Re: psql: FATAL: the database system is starting up