Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a PK/id field on audit table for ordered reads #48

Closed
shayonj opened this issue Feb 21, 2022 · 0 comments · Fixed by #49
Closed

Introduce a PK/id field on audit table for ordered reads #48

shayonj opened this issue Feb 21, 2022 · 0 comments · Fixed by #49
Labels
bug Something isn't working enhancement New feature or request p1

Comments

@shayonj
Copy link
Owner

shayonj commented Feb 21, 2022

There is a potential edge case right now when reading from audit table. Since the read uses the primary_key of the primary table, it may be out of order if two updates happen for the same row.

Its rather better to have a dedicated id field (PK) on the audit table, that way when reading we can have ordered entries w/o using a timestamp field

SELECT * FROM #{audit_table} ORDER BY #{primary_key} LIMIT #{PULL_BATCH_COUNT};

This field name, needs to be non conflicting (with primary table) as well. Similar to: #47

@shayonj shayonj added bug Something isn't working enhancement New feature or request p1 labels Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant