You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm opening a new issue because the existing ones are all closed for different reasons, please let me know if you prefer to move the conversation elsewhere.
There is currently no way to use multiple cursors in a RW transaction, which can be problematic when you want to read multiple data sets within the same transaction before applying some changes.
Example:
iterate over set A (with a given prefix)
for each element of set A, iterate over set B and apply some changes
The goal is to have a consistent view of the database before doing some changes.
If that can help, here is concrete use cases of mine. I need to run something equivalent to this request UPDATE t SET foo = 'bar' WHERE baz > 10. In this example, I need to:
iterate over all the records of table t (which are keys with a certain prefix in the Badger DB)
for each matching record, iterate over the indexes (which are keys with another prefix stored in the same DB) and delete the entries who refer to this record
This is obviously a dumb algorithm, but it is just given as an example of nested operations within the same transaction.
Do you think there is a way to allow having multiple cursors within the same rw transaction?
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue was marked as stale and no activity has occurred since then, therefore it will now be closed. Please, reopen if the issue is still relevant.
What version of Go are you using (
go version
)?What version of Badger are you using?
v1.6.0
Does this issue reproduce with the latest master?
Yes
I'm opening a new issue because the existing ones are all closed for different reasons, please let me know if you prefer to move the conversation elsewhere.
There is currently no way to use multiple cursors in a RW transaction, which can be problematic when you want to read multiple data sets within the same transaction before applying some changes.
Example:
The goal is to have a consistent view of the database before doing some changes.
If that can help, here is concrete use cases of mine. I need to run something equivalent to this request
UPDATE t SET foo = 'bar' WHERE baz > 10
. In this example, I need to:t
(which are keys with a certain prefix in the Badger DB)This is obviously a dumb algorithm, but it is just given as an example of nested operations within the same transaction.
Do you think there is a way to allow having multiple cursors within the same rw transaction?
The text was updated successfully, but these errors were encountered: