Fix tag query performance problems (#657)

* Fix sql tracing
* Disable query by marker count
* Disable unit test
This commit is contained in:
WithoutPants
2020-07-09 08:42:07 +10:00
committed by GitHub
parent f5784246ce
commit e9141b5dfc
5 changed files with 60 additions and 39 deletions

View File

@@ -311,9 +311,12 @@ func executeFindQuery(tableName string, body string, args []interface{}, sortAnd
}
countQuery := buildCountQuery(body)
countResult, countErr := runCountQuery(countQuery, args)
idsQuery := body + sortAndPagination
// Perform query and fetch result
logger.Tracef("SQL: %s, args: %v", idsQuery, args)
countResult, countErr := runCountQuery(countQuery, args)
idsResult, idsErr := runIdsQuery(idsQuery, args)
if countErr != nil {
@@ -325,9 +328,6 @@ func executeFindQuery(tableName string, body string, args []interface{}, sortAnd
panic(idsErr)
}
// Perform query and fetch result
logger.Tracef("SQL: %s, args: %v", idsQuery, args)
return idsResult, countResult
}