-
Notifications
You must be signed in to change notification settings - Fork 15
Insert and Trim in Batches for HeadTracker ORM #141
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
Conversation
|
👋 yashnevatia, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
pkg/heads/orm.go
Outdated
| for i, head := range heads { | ||
| offset := i * 7 | ||
| placeholders = append(placeholders, | ||
| fmt.Sprintf("($%d, $%d, $%d, now(), $%d, $%d, $%d, $%d)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems error-prone. It might be better to use NamedExecContext. Example:
chainlink-evm/pkg/logpoller/orm.go
Line 580 in 45280ea
| ON CONFLICT DO NOTHING` |
This reverts commit ea9dd76.
HeadTracker insert/deletes are very heavy on the db because its being done per block.
We are trying to batch it here to make it more efficient.
Slack thread -> https://chainlink-core.slack.com/archives/C07PHTC2WJC/p1751473048720999
Ticket: