Merge pull request #1319 from nymkappa/feature/index-blocks-timestamps

Index blocks.blockTimestamp for faster hashrates indexing
This commit is contained in:
softsimon 2022-03-08 17:23:12 +01:00 committed by GitHub
commit d504d0ecc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,10 @@ class DatabaseMigration {
await this.$executeQuery(connection, 'ALTER TABLE `hashrates` ADD UNIQUE `hashrate_timestamp_pool_id` (`hashrate_timestamp`, `pool_id`)');
}
if (databaseSchemaVersion < 10 && isBitcoin === true) {
await this.$executeQuery(connection, 'ALTER TABLE `blocks` ADD INDEX `blockTimestamp` (`blockTimestamp`)');
}
connection.release();
} catch (e) {
connection.release();