From 02846db78bd22097f35fdcee33eaa1d2798a4146 Mon Sep 17 00:00:00 2001 From: Tlazypanda <33183263+Tlazypanda@users.noreply.github.com> Date: Sat, 8 Aug 2020 01:57:47 +0530 Subject: [PATCH] optimise qids query to select smaller subset --- app/controllers/tag_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/tag_controller.rb b/app/controllers/tag_controller.rb index 1d0f10f2ef..053c8d8e57 100644 --- a/app/controllers/tag_controller.rb +++ b/app/controllers/tag_controller.rb @@ -129,7 +129,7 @@ def show end end - @qids = Node.questions.where(status: 1) + @qids = Node.questions.where(status: 1).where('term_data.name LIKE ?', "question:#{params[:id]}") .collect(&:nid) if @qids.empty? @notes = nodes