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

Major DB schema changes #9457

Open
3 tasks
vbaranov opened this issue Feb 23, 2024 · 1 comment
Open
3 tasks

Major DB schema changes #9457

vbaranov opened this issue Feb 23, 2024 · 1 comment
Labels

Comments

@vbaranov
Copy link
Member

vbaranov commented Feb 23, 2024

Blockscout DB schema changes for the next major release:

@k1rill-fedoseev
Copy link
Collaborator

Potential logs and token_transfers table optimizations:

  • Drop one of logs_block_number_ASC__index_ASC_index, logs_block_number_DESC__index_DESC_index as keeping two of them is redundant. (4% of total table size)
  • Drop one of token_transfers_block_number_ASC_log_index_ASC_index, token_transfers_block_number_DESC_log_index_DESC_index as keeping two of them is redundant. (4% of total table size)
  • Replace logs_pkey with one of the following:
    • with UNIQUE btree(block_hash, index) (7% of total table size)
    • with UNIQUE btree(transaction_hash, index) AND drop logs_transaction_hash_index_index (20% of total table size)
  • Replace token_transfers_pkey with one of the following:
    • with UNIQUE btree(block_hash, log_index) (7% of total table size)
    • with UNIQUE btree(transaction_hash, log_index) AND drop token_transfers_transaction_hash_log_index_index (20% of total table size)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants