Basic concepts
First of all, let’s try to understand why we have to partition data. We should start by saying that a common constant of all databases is that their size always grows. It is, therefore, possible that a database, after a few months of growth, can reach a size of gigabytes, terabytes, or even petabytes.
Another thing we must always keep in mind is that not all tables grow at the same rate or to the same level; some tables are bigger than others and some indexes too are bigger than other indexes.
We also need to know that there is a part of our server’s RAM, shared among all the PostgreSQL processes, that is used to manage the data present in tables. This part of the server’s RAM is called shared_buffers
.
The way PostgreSQL works is as follows:
- Data is taken from hard disks.
- Data is placed in shared buffers.
- Data is processed in shared buffers.
- Data is downloaded to disks.
Typically, in a dedicated...