Skip to content

Commit

Permalink
perf(db): add block number index
Browse files Browse the repository at this point in the history
  • Loading branch information
PJColombo committed Jun 20, 2024
1 parent 49455b8 commit 3e15dd1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-planets-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blobscan/db": patch
---

Added block number index
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX "block_number_idx" ON "block"("number");
9 changes: 5 additions & 4 deletions packages/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ model BlockchainSyncState {

//TODO: Rename to SwarmBatchStorage
model BlobStoragesState {
id Int @id @default(autoincrement())
swarmDataId String? @map("swarm_data_id") // TODO: rename to batchId
swarmDataTTL Int? @map("swarm_data_ttl") // TODO: rename to batchTtl
updatedAt DateTime @default(now()) @map("updated_at")
id Int @id @default(autoincrement())
swarmDataId String? @map("swarm_data_id") // TODO: rename to batchId
swarmDataTTL Int? @map("swarm_data_ttl") // TODO: rename to batchTtl
updatedAt DateTime @default(now()) @map("updated_at")
@@map("blob_storages_state")
}
Expand Down Expand Up @@ -126,6 +126,7 @@ model Block {
transactions Transaction[]
transactionForks TransactionFork[]
@@index([number])
@@index([insertedAt])
@@map("block")
}
Expand Down

0 comments on commit 3e15dd1

Please sign in to comment.