Skip to content

Commit bbf4b2d

Browse files
authored
feat: add indexes for index_block_hash on BNS tables (#1304)
* feat: add bns indexes for index_block_hash * fix: go back to default log level before importing subdomains
1 parent 040eb7e commit bbf4b2d

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

src/event-replay/event-replay.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as path from 'path';
22
import * as fs from 'fs';
33
import { cycleMigrations, dangerousDropAllTables, PgDataStore } from '../datastore/postgres-store';
44
import { startEventServer } from '../event-stream/event-server';
5-
import { getApiConfiguredChainID, httpPostRequest, logger } from '../helpers';
5+
import { defaultLogLevel, getApiConfiguredChainID, httpPostRequest, logger } from '../helpers';
66
import { findBnsGenesisBlockData, findTsvBlockHeight, getDbBlockHeight } from './helpers';
77
import { importV1BnsNames, importV1BnsSubdomains, importV1TokenOfferingData } from '../import-v1';
88

@@ -179,6 +179,7 @@ export async function importEventsFromTsv(
179179
}
180180
await db.finishEventReplay();
181181
if (process.env.BNS_IMPORT_DIR) {
182+
logger.level = defaultLogLevel;
182183
await importV1BnsSubdomains(db, process.env.BNS_IMPORT_DIR, tsvGenesisBlockData);
183184
}
184185
console.log(`Event import and playback successful.`);

src/migrations/1608030374841_namespaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export async function up(pgm: MigrationBuilder): Promise<void> {
9191
},
9292
});
9393

94+
pgm.createIndex('namespaces', 'index_block_hash');
9495
pgm.createIndex('namespaces', [
9596
{ name: 'ready_block', sort: 'DESC' },
9697
{ name: 'microblock_sequence', sort: 'DESC' },

src/migrations/1608030374842_names.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export async function up(pgm: MigrationBuilder): Promise<void> {
8484
});
8585

8686
pgm.createIndex('names', 'namespace_id');
87+
pgm.createIndex('names', 'index_block_hash');
8788
pgm.createIndex('names', [
8889
{ name: 'registered_at', sort: 'DESC' },
8990
{ name: 'microblock_sequence', sort: 'DESC' },

src/migrations/1610030345948_subdomains.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export async function up(pgm: MigrationBuilder): Promise<void> {
8585
});
8686

8787
pgm.createIndex('subdomains', 'name');
88+
pgm.createIndex('subdomains', 'index_block_hash');
8889
pgm.createIndex('subdomains', [
8990
{ name: 'block_height', sort: 'DESC' },
9091
{ name: 'microblock_sequence', sort: 'DESC' },

0 commit comments

Comments
 (0)