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

Split batch inserts to pieces of the known size #231

Open
telezhnaya opened this issue Jan 18, 2022 · 1 comment
Open

Split batch inserts to pieces of the known size #231

telezhnaya opened this issue Jan 18, 2022 · 1 comment
Assignees

Comments

@telezhnaya
Copy link
Contributor

telezhnaya commented Jan 18, 2022

During #224, we discussed that it's better to put the data to the DB by pieces (e.g., 100 or 500 rows at a time), as we are doing it for receipts and/or transactions implementation. I've checked: we don't do that anywhere except storing genesis https://github.com/near/near-indexer-for-explorer/blob/master/src/db_adapters/genesis.rs#L63

I think it's a really good idea, especially with the increased load on the DB.

@telezhnaya
Copy link
Contributor Author

https://explorer.mainnet.near.org/blocks/3N1J6F2V5LUmoAiHdQJVM8Lo4DSSmXyF8HpJKM22YWjo
85 tx, 129 receipts

select * from account_changes where account_changes.changed_in_block_hash = '3N1J6F2V5LUmoAiHdQJVM8Lo4DSSmXyF8HpJKM22YWjo';

254 rows with one batch insert

not that bad, actually, but it's better to fix it before it provides us with the problems

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

No branches or pull requests

2 participants