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

Consider implementing has many relation on the BlockEvent model to list BlockEventAttributes #28

Open
pharr117 opened this issue Nov 1, 2023 · 0 comments

Comments

@pharr117
Copy link
Collaborator

pharr117 commented Nov 1, 2023

The first implementation of the BlockEventAttribute model has implemented a belongs to relation on the BlockEvent table. We should consider moving to a has_many relation from BlockEvents -> BlockEventAttributes. This may make insert much faster and reduce the amount of preprocessing needed on the BlockEventAttribute table during batch insert here:

https://github.com/DefiantLabs/cosmos-indexer/blob/45f92b64f76037c9f3e40e0089c087142578f8e7/db/events.go#L108-L136

Its possible this could become a one-liner by passing in the attributes as an array. We would probably still need to pre-process the AttributeKeys and apply them to the items.

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

1 participant