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