pgsql: Reduce the memory footprint of large pending-trigger-event lists,

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Reduce the memory footprint of large pending-trigger-event lists,
Дата
Msg-id 20081024234236.0053C7545A4@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Reduce the memory footprint of large pending-trigger-event lists, as per my
recent proposal.  In typical cases, we now need 12 bytes per insert or delete
event and 16 bytes per update event; previously we needed 40 bytes per
event on 32-bit hardware and 80 bytes per event on 64-bit hardware.  Even
in the worst case usage pattern with a large number of distinct triggers being
fired in one query, usage is at most 32 bytes per event.  It seems to be a
bit faster than the old code as well, due to reduction of palloc overhead.

This commit doesn't address the TODO item of allowing the event list to spill
to disk; rather it's trying to stave off the need for that.  However, it
probably makes that task a bit easier by reducing the data structure's
dependency on pointers.  It would now be practical to dump an event list to
disk by "chunks" instead of individual events.

Modified Files:
--------------
    pgsql/src/backend/commands:
        trigger.c (r1.237 -> r1.238)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/trigger.c?r1=1.237&r2=1.238)
    pgsql/src/include/commands:
        trigger.h (r1.68 -> r1.69)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/trigger.h?r1=1.68&r2=1.69)

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

Предыдущее
От: mha@postgresql.org (Magnus Hagander)
Дата:
Сообщение: pgsql: Replace now unnecessary goto statements by using return directly.
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix an old bug in after-trigger handling: AfterTriggerEndQuery