Re: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

Поиск
Список
Период
Сортировка
От jian he
Тема Re: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Дата
Msg-id CACJufxGc6e5wT3oXs3B8LHEs9pR4z9gmNx_UrX6EX9=pWzNkHg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Dmitry Koval <d.koval@postgrespro.ru>)
Ответы Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Список pgsql-hackers
hi.

+ /*
+ * For simplify check for ranges of new partitions need to sort all
+ * partitions in ascending order of them bounds (we compare upper
+ * bound only).
+ */
+ lower_bounds = (PartitionRangeBound **)
+ palloc0(nparts * sizeof(PartitionRangeBound *));
+
+ /* Create array of lower bounds. */
+ for (i = 0; i < nparts; i++)
+ {
+ lower_bounds[i] = make_one_partition_rbound(key, i,
+ new_parts[i]->bound->lowerdatums, true);
+ }
+
I am confused by the above comments "we compare upper bound only".

some of the function partition_rbound_cmp can be replaced by marco
compare_range_bounds,
for example in check_two_partitions_bounds_range we can use
compare_range_bounds instead of partition_rbound_cmp
not sure if it's worth it or not.


doc:
<varlistentry id="sql-altertable-split-partition">
should come after
<varlistentry id="sql-altertable-merge-partitions">
I’ve refactored the SPLIT PARTITION docs quite a bit—let me know if they make
sense.
Also tweaked the regression tests a little again.

Вложения

В списке pgsql-hackers по дате отправления: