LQO 0.3.0 adds active mode to lqo serve. Until now the proxy only learned and reported. With --mode active it applies each setting it has proven, such as nested loops switched off, to the live calls of that query shape. The setting goes in with SET LOCAL in the same round trip, so it ends with that statement’s transaction, and only for a statement that is its own transaction. The application sees the same replies it would without LQO.
A share of the calls, 10% by default, runs without the setting, and a guard compares the two four times a second. A setting that runs more than 10% slower live is taken back. lqo switch off stops them all at once, and nothing is applied while the replica or the state file is unavailable. In the test run, calls to the demo’s trap query took a median of 1,077 ms with the setting and 2,174 ms without it. Shadow mode stays the default.