• Tom Lane's avatar
    Remove small inefficiency in ExecARDeleteTriggers/ExecARUpdateTriggers. · 65158f49
    Tom Lane authored
    Whilst poking at nodeModifyTable.c, I chanced to notice that while
    its calls to ExecBR*Triggers and ExecIR*Triggers are protected by
    tests to see if there are any relevant triggers to fire, its calls
    to ExecAR*Triggers are not; the latter functions do the equivalent
    tests themselves.  This seems possibly reasonable given the more
    complex conditions involved, but what's less reasonable is that
    the ExecAR* functions aren't careful to do no work when there is
    no work to be done.  ExecARInsertTriggers gets this right, but the
    other two will both force creation of a slot that the query may
    have no use for.  ExecARUpdateTriggers additionally performed a
    usually-useless ExecClearTuple() on that slot.  This is probably
    all pretty microscopic in real workloads, but a cycle shaved is a
    cycle earned.
    65158f49
trigger.c 179 KB