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 petabytes.
Another thing we must always keep in mind is that not all tables grow at the same rate or to the same level; there are tables that will be bigger than other tables and there will be indexes too that will be bigger than other indexes.
We also need to know that there is a part of our server's RAM memory shared among all the Postgres processes that is used to manage the data that is 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 disks.
- Data is placed in shared buffers.
- Data is processed in shared buffers.
- Data is downloaded to disks.
Typically, in a dedicated server only for PostgreSQL...