A bit of query optimization
This commit is contained in:
parent
63a767d890
commit
8561d90caf
2 changed files with 7 additions and 8 deletions
|
@ -17,9 +17,9 @@ import (
|
|||
|
||||
type Repo struct {
|
||||
gorm.Model
|
||||
PDS models.ID `gorm:"index:rev_state_index,priority:2"`
|
||||
PDS models.ID `gorm:"index:rev_state_index,priority:2;index:was_indexed,priority:2"`
|
||||
DID string `gorm:"uniqueIndex;column:did"`
|
||||
LastIndexedRev string `gorm:"index:rev_state_index,expression:(last_indexed_rev < first_rev_since_reset),priority:1"`
|
||||
LastIndexedRev string `gorm:"index:rev_state_index,expression:(last_indexed_rev < first_rev_since_reset),priority:1;index:was_indexed,expression:(last_indexed_rev is null OR last_indexed_rev = ''),priority:1"`
|
||||
FirstRevSinceReset string
|
||||
FirstCursorSinceReset int64
|
||||
TombstonedAt time.Time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue