-
Notifications
You must be signed in to change notification settings - Fork 422
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
as_epoch is potentially too inaccurate for safe pagination #1621
Comments
This is my attempt to file a followup to this comment where I found that selecting 10,000 records at a time from 709,000 records caused it to miss two records that had distinctly different ID and distinctly different last_modified, yet they got missed. |
Ok so the mistake is to use |
I though we were precise at the milliseconds so as_epoch should be unique |
No From my database:
|
In case you wonder: kinto/kinto/core/storage/postgresql/schema.sql Lines 5 to 13 in 382adcd
|
What if you have 100 records in the same parent. They all have uniquely different
last_modified
. E.g.2018-04-20 16:21:28.000001
,2018-04-20 16:21:28.000002
,2018-04-20 16:21:28.000003
, etc. Postgres has no problem indexing and sorting these 100% reliably.But they all have the same
as_epoch(last_modified)
:(In this example:
1524241288164
,1524241288164
,1524241288164
, etc.So if you try to paginate these 100 records, in batches of 10, how can you do the second (and third and forth etc.) batch if you use
as_epoch
.The text was updated successfully, but these errors were encountered: