You should be able too index your created_at and updated_at fields in your models using:
created_at
updated_at
type YourModel struct { CreatedAt time.Time `gorm:"index"` UpdatedAt time.Time `gorm:"index"` }