mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-24 22:38:09 -05:00
tdb_sql: Use IN instead of ORs for fetching things.
Postgres likes this a lot.
This commit is contained in:
@@ -515,8 +515,8 @@ def fetch_query(table, id_col, thing_id):
|
||||
single = True
|
||||
thing_id = (thing_id,)
|
||||
|
||||
s = sa.select([table], sa.or_(*[id_col == tid
|
||||
for tid in thing_id]))
|
||||
s = sa.select([table], id_col.in_(thing_id))
|
||||
|
||||
try:
|
||||
r = add_request_info(s).execute().fetchall()
|
||||
except Exception, e:
|
||||
|
||||
Reference in New Issue
Block a user