From 8c1e9d36a8ed1c60c0928cf6140bca29f8f6d9e3 Mon Sep 17 00:00:00 2001 From: Christoffer Fremling Date: Tue, 8 Sep 2026 18:23:51 -0700 Subject: [PATCH] sequencerd: match integer keys with = instead of like (full table scan on every state update) Co-Authored-By: Claude Fable 5.1 --- sequencerd/sequencer_interface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sequencerd/sequencer_interface.cpp b/sequencerd/sequencer_interface.cpp index 36c07823..070f33fa 100644 --- a/sequencerd/sequencer_interface.cpp +++ b/sequencerd/sequencer_interface.cpp @@ -247,7 +247,7 @@ namespace Sequencer { std::map bindings; if ( use_id ) { - condition = "SET_ID like :setid"; + condition = "SET_ID = :setid"; bindings = { { "setid", mysqlx::Value(setid_in) } }; } else { @@ -403,7 +403,7 @@ namespace Sequencer { } try { - const std::string condition("OBSERVATION_ID like :obsid"); + const std::string condition("OBSERVATION_ID = :obsid"); const std::string order("OBSERVATION_ID"); std::map bindings = { { "obsid", mysqlx::Value(obsid) } }; @@ -533,7 +533,7 @@ namespace Sequencer { // Find a row in the SQL active observations table, // the next one (in order) where state is state_in. // - const std::string condition("SET_ID like :setid && STATE like :state"); + const std::string condition("SET_ID = :setid && STATE like :state"); const std::string order("OBS_ORDER"); std::map bindings = { { "state", mysqlx::Value(state_in) }, { "setid", mysqlx::Value(this->setid) } }; @@ -773,7 +773,7 @@ namespace Sequencer { // vector identifies the fields to retrieve and is initialized by the TargetInfo() // class initializer list. // - const std::string condition("OBSERVATION_ID like :obsid"); + const std::string condition("OBSERVATION_ID = :obsid"); std::map bindings = { { "obsid", mysqlx::Value(this->obsid) } }; // read from active targets table