You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[influxdb] Move keep() after ordering/pagination for query performance
Applying keep() before last()/sort()/limit() prevents InfluxDB from using
time-series index pushdown optimisations. For the common restore-on-startup
case (DESCENDING + pageSize=1), keep() → last() forces a full data scan
before last() can run; reversing the order to last() → keep() allows the
query planner to seek directly to the most recent record.
The reordering also fixes a latent correctness issue: the state-value filter
uses r._field, which keep() was dropping before the filter ran.
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
Copy file name to clipboardExpand all lines: bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/influx2/InfluxDB2FilterCriteriaQueryCreatorImpl.java
Copy file name to clipboardExpand all lines: bundles/org.openhab.persistence.influxdb/src/test/java/org/openhab/persistence/influxdb/internal/InfluxFilterCriteriaQueryCreatorImplTest.java
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -85,8 +85,8 @@ public void testSimpleItemQueryWithoutParams() {
0 commit comments