provenance-io / explorer-service

The server side of the blockchain Explorer app. Allows for UI browsing of the blockchain.
Apache License 2.0
6 stars 3 forks source link

Remove `running_count` and `total_count` columns from the `missed_blocks` table #549

Open nullpointer0x00 opened 1 month ago

nullpointer0x00 commented 1 month ago

Summary

Remove running_count and total_count columns from the missed_blocks table.

Problem Definition

The running_count and total_count are no longer calculated or stored in the database as of this pull request. These calculations were removed due to significant performance drains, especially since they can be easily computed via query. The total_count can be derived by counting records where the block height is less than or equal to a given height, and running_count can be calculated from block heights that appear in sequence.

Additionally, these values were not used in any endpoints or other parts of the code; they were simply calculated and stored unnecessarily.

This issue will require a Flyway database update to remove the columns and the related code. The table currently holds over 8 million records, so dropping these columns could take a considerable amount of time.

Proposal

  1. Update Flyway to drop the running_count and total_count columns from the missed_blocks table.
  2. Remove any code references related to these columns.

For Admin Use