From 2ba4b1fef0f1aafd40b5b92b23f53fe4cf468396 Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Fri, 1 Apr 2022 17:41:38 -0400 Subject: [PATCH] optimize query in `GET /u/` (`=` in place of `IN`) --- blueprints/frontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints/frontend.py b/blueprints/frontend.py index 6714f240..898d46f3 100644 --- a/blueprints/frontend.py +++ b/blueprints/frontend.py @@ -306,7 +306,7 @@ async def profile_select(id): user_data = await glob.db.fetch( 'SELECT name, safe_name, id, priv, country ' 'FROM users ' - 'WHERE safe_name IN (%s) OR id IN (%s) LIMIT 1', + 'WHERE safe_name = %s OR id = %s LIMIT 1', [utils.get_safe_name(id), id] )