Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> We toyed with another approach to avoiding having to track old_record by first checking to see if the `record_id` exists in the audit table, and then inserting a row with the OLD values with a `SNAPSHOT` `operation` if it does not.

> Even though that query/check was operating on an index, the performance overhead was higher than we were comfortable with.

Was this done inside the trigger function? Couldn't you just insert the SNAPSHOT values first before applying the trigger? Seems wasteful to me to track both NEW and OLD for all subsequent operations just to ensure the initial value is covered.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: