Order frames by id to make things go faster.
This commit is contained in:
parent
a1b9fc7ac4
commit
a5978c2289
|
@ -80,7 +80,7 @@ def select_frames(conn, n, url_params):
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
# Workaround to deal with missing value in WHERE
|
# Workaround to deal with missing value in WHERE
|
||||||
field_where_query = "" if field_where_str == "" else "WHERE "+field_where_str
|
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)
|
print(sql)
|
||||||
cur.execute(sql)
|
cur.execute(sql)
|
||||||
rows = cur.fetchall()
|
rows = cur.fetchall()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user