From 61461b98814ebf43e37c1213b7ac2083d11bfc63 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 11 Dec 2020 21:45:37 -0800 Subject: [PATCH] Don't bother with least_common if less than 10 values --- sqlite_utils/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlite_utils/db.py b/sqlite_utils/db.py index ae77f6a..b7f6084 100644 --- a/sqlite_utils/db.py +++ b/sqlite_utils/db.py @@ -1975,7 +1975,7 @@ class Table(Queryable): ] if num_distinct <= common_limit: # No need to run the query if it will just return the results in revers order - least_common = most_common[::-1] + least_common = None else: least_common = [ (r[0], r[1])