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