From 6a3155fa93f684caabc00bfc4742a56872479376 Mon Sep 17 00:00:00 2001 From: Keyan <34140557+huumn@users.noreply.github.com> Date: Wed, 23 Jul 2025 14:34:49 -0500 Subject: [PATCH] short cirtuit out of live comment query if possible (#2318) --- api/resolvers/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index c1f2474c..43a2c7ec 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -749,7 +749,7 @@ export default { FROM "Item" -- comments can be nested, so we need to get all comments that are descendants of the root ${whereClause( - '"Item".path <@ (SELECT path FROM "Item" WHERE id = $1)', + '"Item".path <@ (SELECT path FROM "Item" WHERE id = $1 AND "Item"."lastCommentAt" > $2)', activeOrMine(me), '"Item"."created_at" > $2' )}