Skip to content

Draft: Resolve "POC II - Add helpers to reduce size of a partition manager managed partition"

I am introducing a POC to allow partition size adjustments in this merge request.

Currently, when we select a partition strategy for a given table, we don't have a way to adjust the strategy in the future if needed.

For example, the table web_hook_logs uses a monthly strategy, but due to performance issues, we want to start using a weekly strategy in the future.

To achieve this goal, I am introducing a new table where we track the partition strategy changes.

Example:

 id |          created_at           |          updated_at           |  table_name   |    strategy     | start_id   | end_id
----+-------------------------------+-------------------------------+---------------+-----------------+------------+-------------
  1 | 2024-02-12 13:45:34.141989+00 | 2024-02-12 13:45:34.141989+00 | web_hook_logs | MonthlyStrategy |            | 2024-02-22 |
  2 | 2024-02-12 13:45:34.141989+00 | 2024-02-12 13:45:34.141989+00 | web_hook_logs | WeeklyStrategy. | 2024-02-22 |            |

In the example above, we use a monthly strategy for the table web_hook_logs between "-infinite" and 2024-02-22. After 2024-02-22, we will start using a weekly strategy.

The partition manager will use this table to know when a partition strategy change happens.

Related to #413849

Edited by Diogo Frazão

Merge request reports