minor optimization of the append_event sproc