Re: [DOCS] Partition: use triggers instead of rules
От | Tom Lane |
---|---|
Тема | Re: [DOCS] Partition: use triggers instead of rules |
Дата | |
Msg-id | 14455.1196353045@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [DOCS] Partition: use triggers instead of rules ("Joshua D. Drake" <jd@commandprompt.com>) |
Ответы |
Re: [DOCS] Partition: use triggers instead of rules
|
Список | pgsql-patches |
"Joshua D. Drake" <jd@commandprompt.com> writes: > Rules are extremely slow in comparisons and not anywhere near as > flexible. As I said up post yesterday... they work well in the basic > partitioning configuration but anything else they are extremely deficient. I think that the above claim is exceedingly narrow-minded. A trigger will probably beat a rule for inserts/updates involving a small number of rows. For large numbers of rows, like an INSERT/SELECT from another large table, the rule is likely to win, because its overhead is paid once per query not once per row. Also, if you implement the trigger with an EXECUTE (forcing a planning cycle) intead of hard-coded commands, the speed advantage becomes even more dubious. regards, tom lane
В списке pgsql-patches по дате отправления: