Order frames by id to make things go faster.

This commit is contained in:
W1CDN 2024-11-20 19:27:51 -06:00
parent a1b9fc7ac4
commit a5978c2289

View File

@ -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()