Re: Clustered index to preserve data locality in a multitenant application? - Mailing list pgsql-general

From Nicolas Grilly
Subject Re: Clustered index to preserve data locality in a multitenant application?
Date
Msg-id CAG3yVS5dCEozBSqSzL78QJthP9aveRF56JTv71_KxVaAGpgA_g@mail.gmail.com
Whole thread Raw
In response to Clustered index to preserve data locality in a multitenant application?  (Nicolas Grilly <nicolas@vocationcity.com>)
Responses Re: Clustered index to preserve data locality in a multitenant application?
List pgsql-general
Eduardo Morras wrote:
 
Check BRIN indexs, they are "designed for handling very large tables in
which certain columns have some natural correlation with their physical
location within the table", I think they fit your needs.

Yes, a BRIN index on the tenant ID would be very useful if the rows in the heap were naturally sorted by the tenant ID, but they are not. They are naturally sorted by their order of insertion, which is completely unrelated. The first step in solving this is to find a way to keep rows belonging to the same tenant close to each other. The second step could be to use a BRIN index.

pgsql-general by date:

Previous
From: Nicolas Grilly
Date:
Subject: Re: Clustered index to preserve data locality in a multitenant application?
Next
From: Nicolas Grilly
Date:
Subject: Re: Clustered index to preserve data locality in a multitenant application?