Skip to content

Commit c2f9c5a

Browse files
committed
add composite index for hash+block number
1 parent 9e35fc3 commit c2f9c5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/xrp/entities.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ type Block struct {
88
}
99

1010
type Transaction struct {
11-
Hash string `gorm:"primaryKey;type:varchar(64)"`
12-
BlockNumber uint64 `gorm:"index"`
11+
Hash string `gorm:"primaryKey;type:varchar(64);index:idx_block_hash_composite,priority:2,option:CONCURRENTLY"`
12+
BlockNumber uint64 `gorm:"index:idx_block_hash_composite,priority:1,option:CONCURRENTLY"`
1313
Timestamp uint64 `gorm:"index"`
1414
PaymentReference string `gorm:"index;type:varchar(64);default:null"`
1515
Response string `gorm:"type:varchar"`

0 commit comments

Comments
 (0)