You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The metadata_table in Clarity is normally queried by (key, blockhash) for which there is an index (due to the UNIQUE constraint), but during block commits, the metadata is moved from a placeholder blockhash to the final blockhash. This invokes UPDATE … WHERE blockhash = ? which requires a SCAN. With some naive perf analysis, this represented 388 samples out of 470 perf samples with process_next_nakamoto_block. Obviously, this could be a skewed sample, but adding an index here should be an easy performance boost:
CREATE INDEX IF NOT EXISTS md_blockhashes ON metadata_table(blockhash)
The text was updated successfully, but these errors were encountered:
The
metadata_table
in Clarity is normally queried by(key, blockhash)
for which there is an index (due to theUNIQUE
constraint), but during block commits, the metadata is moved from a placeholder blockhash to the final blockhash. This invokesUPDATE … WHERE blockhash = ?
which requires aSCAN
. With some naiveperf
analysis, this represented 388 samples out of 470 perf samples withprocess_next_nakamoto_block
. Obviously, this could be a skewed sample, but adding an index here should be an easy performance boost:The text was updated successfully, but these errors were encountered: