gorm func order change, maybe better perf
This commit is contained in:
parent
965b4ccac6
commit
bb632199f1
1 changed files with 1 additions and 1 deletions
|
@ -734,7 +734,7 @@ func storeFilterResult(filter *Filter, db *gorm.DB, debug bool) {
|
||||||
|
|
||||||
func getFilterResultConditionDiff(filter *Filter, db *gorm.DB) {
|
func getFilterResultConditionDiff(filter *Filter, db *gorm.DB) {
|
||||||
var previousOutput FilterOutput
|
var previousOutput FilterOutput
|
||||||
db.Model(&FilterOutput{}).Order("time desc").Where("watch_id = ? AND name = ?", filter.WatchID, filter.Var2).Limit(1).Find(&previousOutput)
|
db.Model(&FilterOutput{}).Limit(1).Order("time desc").Where("watch_id = ? AND name = ?", filter.WatchID, filter.Var2).Find(&previousOutput)
|
||||||
for _, parent := range filter.Parents {
|
for _, parent := range filter.Parents {
|
||||||
for _, result := range parent.Results {
|
for _, result := range parent.Results {
|
||||||
if previousOutput.WatchID == 0 {
|
if previousOutput.WatchID == 0 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue