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 like your workaround, it's smart! We had already thought about the batch processing previously, but haven't done any tests or benchmarks. So, next are just my speculations.
This task likely could be solved more efficiently on the framework level, since DipDup opens new transactions for every level there are handlers matched regardless of the number of SQL ops inside. It could be that empty transactions are somehow optimized either by Tortoise or by PostgreSQL, but they are definitely not free.
If you'd like to help with this task and dive into DipDup's guts, an entry point for experiments is dipdup.transactions.TransactionsManager.in_transaction method. It should be patched to reuse the same transaction until the batch is full (or even by time intervals). Something similar to your handler-level solution.
What feature would you like to see in DipDup?
I want to create handler that handle batch of events instead of single event.
Current setup:
I want my handler have option like
batch: true
on_pair_sync
will process batch of events instead of single events.Why do you need this feature, what's the use case?
Most of my index handlers are only inserting raw events to the postgresql table.
All processing logic are implemented in hooks.
Batch handler will speed up the indexing process.
Is there a workaround currently?
I'm experimenting with batch sender that looks like this:
The text was updated successfully, but these errors were encountered: