Skip to content

Conversation

@cap10morgan
Copy link
Member

This allows longer-running analytics queries to be easier on the rest of the system

@cap10morgan cap10morgan marked this pull request as ready for review November 11, 2025 22:48
@cap10morgan cap10morgan requested a review from a team November 11, 2025 22:48
@kriszyp
Copy link
Member

kriszyp commented Nov 12, 2025

I guess I didn't explain this well: this isn't implemented for Table.search (yet). It is an option available for lmdb-js's getRange() method (and will be in rocksdb-js as well). So we would need to pass it through to there. I suppose it might make the most sense to add this as a property on the context, which is accessible by searchByIndex where the getRange usually takes place. But snapshot: false implies that we aren't keeping the read transaction, and the transaction is also kept open for the duration of the iteration with the useReadTxn method (until doneReadTxn). So we would probably want to turn that off as well in this scenario.

@cap10morgan cap10morgan marked this pull request as draft November 12, 2025 20:05
@cap10morgan
Copy link
Member Author

I guess I didn't explain this well: this isn't implemented for Table.search (yet). It is an option available for lmdb-js's getRange() method (and will be in rocksdb-js as well). So we would need to pass it through to there. I suppose it might make the most sense to add this as a property on the context, which is accessible by searchByIndex where the getRange usually takes place. But snapshot: false implies that we aren't keeping the read transaction, and the transaction is also kept open for the duration of the iteration with the useReadTxn method (until doneReadTxn). So we would probably want to turn that off as well in this scenario.

Want to see if I understand. You're saying that we should:

  1. Make get_analytics call searchByIndex directly
  2. Modify searchByIndex to look for a snapshot: false in the context and, if present:
    1. Pass that down to getRange()'s arg
    2. Close the read txn right away (by just calling doneReadTxn?)

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.

3 participants