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

table.where reverse iterator #937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

exrich
Copy link

@exrich exrich commented Jan 17, 2022

Rationale:

I had a problem with a table.where (indexed) query returning a lot of results but I only wanted the last row of data for that query. For example if your table represented a timeseries and you only wanted the most recent result before a certain date. Currently table.where would read in the chunks from first to last chunk so you would have to read in the entire iterator to get to your last row. This is slow since you are making a lot of table._read_chunk calls.

With this reverse iterator you can specify a step of -1 and just read in the first value of the iterator resulting in a large speedup.

Changes pass the light test suite. Couldn't get the heavy to run. Are they broken?

functionality improved to take a step of -1 so that you can read the iterator in reverse order (indexed queries only so far)

functionality improved to take a step of -1 so that you can read the iterator in reverse order (indexed queries only so far)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant