Couting requests with CTE uses trivial SQL

This commit is contained in:
Gwendal Roué committed 2020-12-02 08:26:35 +01:00
1 parent 1d0adaacf6
commit eb2346dfce
1 file changed
+1 -1
+1 -1
View File
@@ -101,7 +101,7 @@ extension SQLQuery {
}
private func countQuery(_ db: Database) throws -> SQLQuery {
guard groupPromise == nil && limit == nil else {
guard groupPromise == nil && limit == nil && ctes.isEmpty else {
// SELECT ... GROUP BY ...
// SELECT ... LIMIT ...
return trivialCountQuery