Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PATCH] create_range_partitions large distance between DATE or TIMESTAMP values #208

Open
@GuramDuka

Description

postgresql 11.5, pathman 1.5

If there is a large distance between the values ​​in the table, a lot of partitions are created, which is why the operation may never be completed (if the number of partitions exceeds 1000).
For example, in the table there are two records of the field by which the table is ranged with the values ​​2010年01月01日 and 3999年12月01日 and the month interval is set.
SELECT create_range_partitions (relid, '_period', '1 mon' :: interval);
I propose a patch that solves the problem by creating partitions only for which there are values ​​in the table, and then, when automatically creating partitions, only those are created for which the value in the record falls into the interval.

При наличии в таблице большого разрыва между значениями создается очень много партиций, отчего операция может не завершится никогда (если количество партиций превышает 1000).
Например в таблице две записи поля по которому ранжируется таблица со значениями 2010年01月01日 и 3999年12月01日 и задается интервал например месяц или ещё меньше.
SELECT create_range_partitions(relid, '_period', '1 mon'::interval);
Предлагаю патч который решает проблему путем создания партиций только тех для которых есть значения в таблице и далее при автоматическом создании партиций создаются только те для которых значение в записи попало в интервал.

postgresql-pg_pathman_.patch.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /