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

Reconsider how "rethinkdb export" calculates progress #3483

Closed
timmaxw opened this issue Jan 1, 2015 · 2 comments
Closed

Reconsider how "rethinkdb export" calculates progress #3483

timmaxw opened this issue Jan 1, 2015 · 2 comments
Assignees
Milestone

Comments

@timmaxw
Copy link
Member

timmaxw commented Jan 1, 2015

Currently rethinkdb export runs r.table(...).count() and then r.table(...). As it reads documents from the stream returned by r.table(...), it counts the number of documents; then it uses this value as the numerator of the progress fraction, with the result of r.table(...).count() as the denominator.

This means that the server must traverse the entire data set twice: once to count the number of documents, and again to stream them to the client. For a data set that doesn't fit into RAM, this could make rethinkdb export take twice as long as it needs to. Until the first traversal is finished, rethinkdb export will report 0% progress.

We should consider using a distribution query to estimate the denominator for the progress fraction instead. We can do this by running r.table(...).info()['doc_count_estimates'].sum(). This won't give exact results, but it will run in constant time instead of reading the entire table.

@danielmewes danielmewes added this to the 1.16-polish milestone Jan 2, 2015
@Tryneus Tryneus self-assigned this Jan 2, 2015
@Tryneus
Copy link
Member

Tryneus commented Jan 2, 2015

This is up in review 2426.

@Tryneus
Copy link
Member

Tryneus commented Jan 2, 2015

This has been approved and merged into next in commit 92c7390. Will be in release 1.16.

@Tryneus Tryneus closed this as completed Jan 2, 2015
@AtnNn AtnNn modified the milestones: 1.16-polish, 1.16 Jan 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants