Re: [HACKERS] Declarative partitioning - another take
От | Dmitry Ivanov |
---|---|
Тема | Re: [HACKERS] Declarative partitioning - another take |
Дата | |
Msg-id | b9d98afc-d8fe-4221-bf4d-e8e791a93e0c@postgrespro.ru обсуждение исходный текст |
Ответ на | Re: Declarative partitioning - another take (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: [HACKERS] Declarative partitioning - another take
|
Список | pgsql-hackers |
Hi everyone, Looks like "sql_inheritance" GUC is affecting partitioned tables: explain (costs off) select * from test; QUERY PLAN ------------------------------ Append -> Seq Scan on test -> Seq Scan on test_1 -> Seq Scan on test_2 -> Seq Scan on test_1_1 -> Seq Scan on test_1_2 -> Seq Scan on test_1_1_1 -> Seq Scan on test_1_2_1 (8 rows) set sql_inheritance = off; explain (costs off) select * from test; QUERY PLAN ------------------ Seq Scan on test (1 row) I might be wrong, but IMO this should not happen. Queries involving update, delete etc on partitioned tables are basically broken. Moreover, there's no point in performing such operations on a parent table that's supposed to be empty at all times. I've come up with a patch which fixes this behavior for UPDATE, DELETE, TRUNCATE and also in transformTableEntry(). It might be hacky, but it gives an idea. I didn't touch RenameConstraint() and renameatt() since this would break ALTER TABLE ONLY command. -- Dmitry Ivanov Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Вложения
В списке pgsql-hackers по дате отправления: