Re: Partitioning syntax

Поиск
Список
Период
Сортировка
От Takahiro Itagaki
Тема Re: Partitioning syntax
Дата
Msg-id 20100118175551.9B43.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответ на Re: Partitioning syntax  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Partitioning syntax  (Robert Haas <robertmhaas@gmail.com>)
Re: Partitioning syntax  (Jaime Casanova <jaime@2ndquadrant.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote:

> A couple of preliminary comments on this:

Thanks.
The attached is rebased on HEAD, with additional documentation.

> 1. If we're thinking that this syntax should eventually result in
> inserts (and updates?) being redirected to the appropriate partition,
> then I think we should have that in the initial version.  I don't
> think we really want to add the syntax with a plan to change its
> behavior incompatibly down the road.

It's true that we need an alternative method for insert triggers,
but I'd like to submit it as another patch in the next development cycle.
I think the syntax proposed here is carefully chosen so that we will
not frequently modify modify them.

> 2. The documentation does not explain what partitioning by list or by
> range means, or what the difference between the two is.  I think some
> kind of general introduction to the subject is essential.

Oops, I've forgotten to update ddl.sgml for the new syntax. I rewrote
ddl-partition section to use the new syntax, with some other changes:

  1. Use PARTITION BY RANGE and CREATE PARTITION for the example.

  2. Recommend to define indexes for the parent table, and copy the
     definition to each partition with CREATE PARTITION or
     CREATE TABLE (LIKE INCLUDING ALL).

  3. Use an EXECUTE USING rather than a huge IF-THEN-ELSE block
     in the insert trigger. The new recommended code is:
       EXECUTE 'INSERT INTO ' || to_relname(NEW) || ' VALUES ($1.*)' USING NEW;
     We don't need to update the trigger function if partitions are
     added or removed with this form.

We could apply changes in 2 and 3 even without the partitioning patch.
I think we can define trigger functions with EXECUTE USING easliy
compared to before. I'm willing to split the doc patch if needed.

> 3. This patch is large enough (+1951/-63) that we have to consider
> whether it makes sense to merge it at this point in the release cycle.
>  It doesn't change much existing code, which is a point in its favor,
> but it's still a big patch.  I guess we can wait until we're a little
> further along to make that decision.

It depends on reviewers :)  But I think the partitioning patch never
go to waste -- I'll continue to improve it if any feedbacks.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center


Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Hot Standby and handling max_standby_delay
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: New XLOG record indicating WAL-skipping