From a5978c2289488069f3b1f310a2fe0968c38a351b Mon Sep 17 00:00:00 2001 From: W1CDN Date: Wed, 20 Nov 2024 19:27:51 -0600 Subject: [PATCH] Order frames by id to make things go faster. --- api_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api_app.py b/api_app.py index de0a777..0e20777 100644 --- a/api_app.py +++ b/api_app.py @@ -80,7 +80,7 @@ def select_frames(conn, n, url_params): cur = conn.cursor() # Workaround to deal with missing value in WHERE field_where_query = "" if field_where_str == "" else "WHERE "+field_where_str - sql = 'SELECT * FROM frames {field_where_query} ORDER BY created DESC LIMIT {n}'.format(field_where_query=field_where_query, n=n) + sql = 'SELECT * FROM frames {field_where_query} ORDER BY id DESC LIMIT {n}'.format(field_where_query=field_where_query, n=n) print(sql) cur.execute(sql) rows = cur.fetchall()