Skip to content

Commit

Permalink
Merge pull request #294 from filecoin-project/fix/slow_sql
Browse files Browse the repository at this point in the history
fix: add composite indexes
  • Loading branch information
diwufeiwen authored Mar 21, 2023
2 parents b2bde82 + aa379e7 commit f640fc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/mysql/storage_deal.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type storageDeal struct {
PublishCid DBCid `gorm:"column:publish_cid;type:varchar(256);"`
Miner string `gorm:"column:miner_peer;type:varchar(128);index:miner_state"`
Client string `gorm:"column:client_peer;type:varchar(128);"`
State uint64 `gorm:"column:state;type:bigint unsigned;index;index:miner_state;NOT NULL;"`
State uint64 `gorm:"column:state;type:bigint unsigned;index;index:miner_state;index:idx_cdpprovider_state;NOT NULL;"`

PayloadSize uint64 `gorm:"column:payload_size;type:bigint;NOT NULL;"`
PiecePath string `gorm:"column:piece_path;type:varchar(256);"`
Expand Down Expand Up @@ -67,7 +67,7 @@ type ClientDealProposal struct {
PieceSize uint64 `gorm:"column:piece_size;type:bigint unsigned;NOT NULL;"`
VerifiedDeal bool `gorm:"column:verified_deal;"`
Client DBAddress `gorm:"column:client;type:varchar(256);"`
Provider DBAddress `gorm:"column:provider;type:varchar(256);index"`
Provider DBAddress `gorm:"column:provider;type:varchar(256);index;index:idx_cdpprovider_state"`

// Label is an arbitrary client chosen label to apply to the deal
Label string `gorm:"column:label;type:varchar(256);"`
Expand Down

0 comments on commit f640fc1

Please sign in to comment.