Merge pull request #1319 from nymkappa/feature/index-blocks-timestamps
Index blocks.blockTimestamp for faster hashrates indexing
This commit is contained in:
commit
d504d0ecc0
@ -140,6 +140,10 @@ class DatabaseMigration {
|
|||||||
await this.$executeQuery(connection, 'ALTER TABLE `hashrates` ADD UNIQUE `hashrate_timestamp_pool_id` (`hashrate_timestamp`, `pool_id`)');
|
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();
|
connection.release();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
connection.release();
|
connection.release();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user