Fix KV benchmark lookups to order in subqueries before SELECT VALUE
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m13s

This avoids Surreal parse errors and allows arbitrary context key/value benchmarks to run successfully.
This commit is contained in:
Joseph Doherty
2026-02-22 16:58:17 -05:00
parent 8e97061ab8
commit 3b9ff69adc

View File

@@ -143,14 +143,16 @@ public class SurrealLogStorageBenchmarks
await ExecuteQueryAsync(
$"""
LET $logIds = (
SELECT VALUE logId FROM {LogKvTable}
WHERE loggerName = $loggerName
AND key = $contextKey
AND valueStr = $contextValueStr
AND timestamp >= $fromTs
AND timestamp <= $toTs
ORDER BY timestamp DESC
LIMIT 200
SELECT VALUE logId FROM (
SELECT logId, timestamp FROM {LogKvTable}
WHERE loggerName = $loggerName
AND key = $contextKey
AND valueStr = $contextValueStr
AND timestamp >= $fromTs
AND timestamp <= $toTs
ORDER BY timestamp DESC
LIMIT 200
)
);
SELECT * FROM {LogTable}
WHERE id INSIDE $logIds
@@ -173,14 +175,16 @@ public class SurrealLogStorageBenchmarks
await ExecuteQueryAsync(
$"""
LET $logIds = (
SELECT VALUE logId FROM {LogKvTable}
WHERE loggerName = $loggerName
AND key = $contextKey
AND valueNum = $contextValueNum
AND timestamp >= $fromTs
AND timestamp <= $toTs
ORDER BY timestamp DESC
LIMIT 200
SELECT VALUE logId FROM (
SELECT logId, timestamp FROM {LogKvTable}
WHERE loggerName = $loggerName
AND key = $contextKey
AND valueNum = $contextValueNum
AND timestamp >= $fromTs
AND timestamp <= $toTs
ORDER BY timestamp DESC
LIMIT 200
)
);
SELECT * FROM {LogTable}
WHERE id INSIDE $logIds