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

Keep eth.header_cids as a standard table, not hypertable. #137

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

telackey
Copy link
Contributor

@telackey telackey commented Jul 21, 2023

Anytime we need to lookup by block hash, we join on the eth.header_cids table. However, if the table is partitioned by block_number, we make looking up by hash less efficient, since we also partition the index and need to check each one.

As this is by far the smallest major table (1 row per block, averaging about 1KB per row), the need for partitioning is already doubtful. Combined with slower lookups by hash, the performance impact tips negative rather than positive.

@telackey telackey self-assigned this Jul 21, 2023
@roysc
Copy link
Collaborator

roysc commented Jul 21, 2023

Nice, then we can also drop the header_result type; actually the get_child function can also go, since it was only used by canonical_header_from_array.

Copy link
Collaborator

@roysc roysc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

NB. this and #138 will functionally conflict (but git may not detect it).

Copy link
Collaborator

@i-norden i-norden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks! Is this waiting on additional changes?

@telackey telackey marked this pull request as ready for review July 21, 2023 18:27
@telackey telackey merged commit 8779bb2 into v5 Jul 21, 2023
2 checks passed
@telackey telackey deleted the telackey/header branch July 21, 2023 18:27
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

Successfully merging this pull request may close these issues.

3 participants