Bounds and history
A query accepts four bounds that protect the engine. bind reads the database
at an earlier transaction, or over facts that you supply for one query. Each
example reads the same five entities as Queries.
Bounds
Each bound is a member of the query document. Zero gives no explicit bound.
Queries still receive a dynamic cost budget when maxCost is zero. Each bound
has its own rejection.
| Bound | Limits | Rejection |
|---|---|---|
maxCost | CPU time on the query's execution thread, in 100-nanosecond ticks | Work_Limit_Exceeded |
maxResults | the number of rows in the result | Result_Limit_Exceeded |
maxBytes | the size of the result | Byte_Limit_Exceeded |
maxWorkRows | the rows that the engine handles | Work_Rows_Limit_Exceeded |
maxResults counts the rows that remain after orderBy, distinct and the
window clauses. The engine rejects five result rows against a bound of two.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 5C 3F6E616D65 | txt "?name" |
| 0A | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 17 | 2C 3F65 | txt "?e" |
| 1A | 6C 73616C617279 | txt "salary" |
| 21 | 4C 3F73616C | txt "?sal" |
| 26 | 0E 15 00 0700 030000 00 17000000 1A0000 00 21000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @17 → @1A → @21 |
| 3B | 2C 3F65 | txt "?e" |
| 3E | 4C 6E616D65 | txt "name" |
| 43 | 5C 3F6E616D65 | txt "?name" |
| 49 | 0E 15 00 0700 030000 00 3B000000 3E0000 00 43000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @3B → @3E → @43 |
| 5E | 0E 11 00 0300 020000 00 26000000 490000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @26 → @49 |
| 6F | 5C 3F6E616D65 | txt "?name" |
| 75 | 0E 0D 00 0100 010000 00 6F000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @6F |
| 82 | 5C 7768657265 | txt "where" |
| 88 | 0F 0A 82000000 5E00 0000 | map leaf, size 10: @82 → @5E |
| 92 | AC 6D617852657375 6C7473 | txt "maxResults" |
| 9D | 02 02000000000000 00 | i64 2 |
| A6 | 0F 0A 92000000 9D00 0000 | map leaf, size 10: @92 → @9D |
| B0 | 07 0E 04010000 8800 0000 A6000000 | map branch, size 14, depth 1, slots 2, 8: @88 → @A6 |
| BE | 4C 66696E64 | txt "find" |
| C3 | 0F 0A BE000000 0A00 0000 | map leaf, size 10: @BE → @A |
| CD | 7C 6F726465724279 | txt "orderBy" |
| D5 | 0F 0A CD000000 7500 0000 | map leaf, size 10: @CD → @75 |
| DF | 07 12 2A000000 B000 0000 C3000000 D500 0000 | map branch, size 18, depth 0 (root), slots 1, 3, 5: @B0 → @C3 → @D5 |
| F1 | DF000000 00000000 | root → @DF; previous: none |
Error
Result_Limit_Exceeded
The caller can also give maxCost with the request, beside the document.
Stardust then uses the smaller of the two values.
The engine measures CPU time from the start of query execution through result construction. It includes planning, fact scans, expressions, native helpers and rendering on that thread. It excludes time spent waiting and work on other threads. It varies between runs and is neither a bytecode count nor an instruction count.
The public API returns rows, with optional explain records for individual calls. The query-run record stops before later page reads.
A positive maxCost limits this measured time. A clock read has a cost, so the engine schedules its checks. Checks occur
less often while the limit is far and more often as the limit comes near. It reads the clock again after rendering.
A query can pass the limit by a small amount before the
next check. It can pass it by more when its work suddenly becomes slower or a
single helper runs for a long time. Without a positive maxCost,
Stardust derives a CPU time budget from query structure and rows handled.
The other bounds apply to rows and bytes independently.
Result memory
The database's memory_budget_bytes option also limits result construction.
Ordering, grouping and distinct use temporary sorted runs when their records
do not fit in memory. Collected aggregate inputs and windows read these runs.
The engine removes its temporary runs when their owner closes.
A single collected value, the minimum workspace or a requested output document
can still exceed the budget. That operation returns out_of_memory. Reading
small pages lets a caller process a large result with bounded engine memory.
Each returned page is independent of its cursor and database. Pages that the
caller keeps use caller-owned memory. Binding operations such as all_pages
collect these pages in caller-owned memory and can grow with the full result.
Reading an earlier transaction
bind.with.db reads the database as it was. asOf accepts a transaction id, a
UTC instant, or a duration relative to now. Transaction ids start at 1.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 5C 3F6E616D65 | txt "?name" |
| 00A | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 017 | 2C 3F65 | txt "?e" |
| 01A | 6C 73616C617279 | txt "salary" |
| 021 | 4C 3F73616C | txt "?sal" |
| 026 | 0E 15 00 0700 030000 00 17000000 1A0000 00 21000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @17 → @1A → @21 |
| 03B | 2C 3F65 | txt "?e" |
| 03E | 4C 6E616D65 | txt "name" |
| 043 | 5C 3F6E616D65 | txt "?name" |
| 049 | 0E 15 00 0700 030000 00 3B000000 3E0000 00 43000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @3B → @3E → @43 |
| 05E | 0E 11 00 0300 020000 00 26000000 490000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @26 → @49 |
| 06F | 5C 3F6E616D65 | txt "?name" |
| 075 | 0E 0D 00 0100 010000 00 6F000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @6F |
| 082 | 4C 61734F66 | txt "asOf" |
| 087 | 02 06000000000000 00 | i64 6 |
| 090 | 0F 0A 82000000 8700 0000 | map leaf, size 10: @82 → @87 |
| 09A | 2C 6462 | txt "db" |
| 09D | 0F 0A 9A000000 9000 0000 | map leaf, size 10: @9A → @90 |
| 0A7 | 4C 77697468 | txt "with" |
| 0AC | 0F 0A A7000000 9D00 0000 | map leaf, size 10: @A7 → @9D |
| 0B6 | 5C 7768657265 | txt "where" |
| 0BC | 0F 0A B6000000 5E00 0000 | map leaf, size 10: @B6 → @5E |
| 0C6 | 4C 62696E64 | txt "bind" |
| 0CB | 0F 0A C6000000 AC00 0000 | map leaf, size 10: @C6 → @AC |
| 0D5 | 4C 66696E64 | txt "find" |
| 0DA | 0F 0A D5000000 0A00 0000 | map leaf, size 10: @D5 → @A |
| 0E4 | 07 0E 01200000 CB00 0000 DA000000 | map branch, size 14, depth 1, slots 0, 13: @CB → @DA |
| 0F2 | 7C 6F726465724279 | txt "orderBy" |
| 0FA | 0F 0A F2000000 7500 0000 | map leaf, size 10: @F2 → @75 |
| 104 | 07 12 2A000000 BC00 0000 E4000000 FA00 0000 | map branch, size 18, depth 0 (root), slots 1, 3, 5: @BC → @E4 → @FA |
| 116 | 04010000 00000000 | root → @104; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 6E616D65 | txt "name" |
| 09 | 3C 416461 | txt "Ada" |
| 0D | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 17 | 4C 6E616D65 | txt "name" |
| 1C | 3C 426F62 | txt "Bob" |
| 20 | 0F 0A 17000000 1C00 0000 | map leaf, size 10: @17 → @1C |
| 2A | 4C 6E616D65 | txt "name" |
| 2F | 2C 4379 | txt "Cy" |
| 32 | 0F 0A 2A000000 2F00 0000 | map leaf, size 10: @2A → @2F |
| 3C | 4C 6E616D65 | txt "name" |
| 41 | 3C 44616E | txt "Dan" |
| 45 | 0F 0A 3C000000 4100 0000 | map leaf, size 10: @3C → @41 |
| 4F | 4C 6E616D65 | txt "name" |
| 54 | 3C 457665 | txt "Eve" |
| 58 | 0F 0A 4F000000 5400 0000 | map leaf, size 10: @4F → @54 |
| 62 | 0E 1D 00 1F00 050000 00 0D000000 200000 00 32000000 450000 00 58000000 | array leaf, size 29, shift 0, bitmap 001F, count 5 (root): @D → @20 → @32 → @45 → @58 |
| 7F | 62000000 00000000 | root → @62; previous: none |
The seed patch creates all five entities atomically in transaction 6. A snapshot before that commit holds none of them.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 61734F66 | txt "asOf" |
| 09 | 02 05000000000000 00 | i64 5 |
| 12 | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 1C | 2C 6462 | txt "db" |
| 1F | 0F 0A 1C000000 1200 0000 | map leaf, size 10: @1C → @12 |
| 29 | 4C 77697468 | txt "with" |
| 2E | 0F 0A 29000000 1F00 0000 | map leaf, size 10: @29 → @1F |
| 38 | 4C 62696E64 | txt "bind" |
| 3D | 0F 0A 38000000 2E00 0000 | map leaf, size 10: @38 → @2E |
| 47 | 3D000000 00000000 | root → @3D; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 0E 09 00 0000 000000 00 | array leaf, size 9, shift 0, bitmap 0000, count 0 (root) |
| 0D | 04000000 00000000 | root → @4; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 61734F66 | txt "asOf" |
| 09 | 02 01000000000000 00 | i64 1 |
| 12 | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 1C | 2C 6462 | txt "db" |
| 1F | 0F 0A 1C000000 1200 0000 | map leaf, size 10: @1C → @12 |
| 29 | 4C 77697468 | txt "with" |
| 2E | 0F 0A 29000000 1F00 0000 | map leaf, size 10: @29 → @1F |
| 38 | 4C 62696E64 | txt "bind" |
| 3D | 0F 0A 38000000 2E00 0000 | map leaf, size 10: @38 → @2E |
| 47 | 3D000000 00000000 | root → @3D; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 0E 09 00 0000 000000 00 | array leaf, size 9, shift 0, bitmap 0000, count 0 (root) |
| 0D | 04000000 00000000 | root → @4; previous: none |
A UTC instant selects the newest transaction committed at or before that time. An instant after the last commit selects the head transaction.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 23757463 | txt "#utc" |
| 09 | 14 14 323032372D30 312D30315430303A 30303A30305A | txt "2027-01-01T00:00:00Z" |
| 1F | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 29 | 4C 61734F66 | txt "asOf" |
| 2E | 0F 0A 29000000 1F00 0000 | map leaf, size 10: @29 → @1F |
| 38 | 2C 6462 | txt "db" |
| 3B | 0F 0A 38000000 2E00 0000 | map leaf, size 10: @38 → @2E |
| 45 | 4C 77697468 | txt "with" |
| 4A | 0F 0A 45000000 3B00 0000 | map leaf, size 10: @45 → @3B |
| 54 | 4C 62696E64 | txt "bind" |
| 59 | 0F 0A 54000000 4A00 0000 | map leaf, size 10: @54 → @4A |
| 63 | 59000000 00000000 | root → @59; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 6E616D65 | txt "name" |
| 09 | 3C 416461 | txt "Ada" |
| 0D | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 17 | 4C 6E616D65 | txt "name" |
| 1C | 3C 426F62 | txt "Bob" |
| 20 | 0F 0A 17000000 1C00 0000 | map leaf, size 10: @17 → @1C |
| 2A | 4C 6E616D65 | txt "name" |
| 2F | 2C 4379 | txt "Cy" |
| 32 | 0F 0A 2A000000 2F00 0000 | map leaf, size 10: @2A → @2F |
| 3C | 4C 6E616D65 | txt "name" |
| 41 | 3C 44616E | txt "Dan" |
| 45 | 0F 0A 3C000000 4100 0000 | map leaf, size 10: @3C → @41 |
| 4F | 4C 6E616D65 | txt "name" |
| 54 | 3C 457665 | txt "Eve" |
| 58 | 0F 0A 4F000000 5400 0000 | map leaf, size 10: @4F → @54 |
| 62 | 0E 1D 00 1F00 050000 00 0D000000 200000 00 32000000 450000 00 58000000 | array leaf, size 29, shift 0, bitmap 001F, count 5 (root): @D → @20 → @32 → @45 → @58 |
| 7F | 62000000 00000000 | root → @62; previous: none |
An instant before the first commit gives no facts.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 23757463 | txt "#utc" |
| 09 | 14 14 323032362D30 382D32325431323A 30303A30305A | txt "2026-08-22T12:00:00Z" |
| 1F | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 29 | 4C 61734F66 | txt "asOf" |
| 2E | 0F 0A 29000000 1F00 0000 | map leaf, size 10: @29 → @1F |
| 38 | 2C 6462 | txt "db" |
| 3B | 0F 0A 38000000 2E00 0000 | map leaf, size 10: @38 → @2E |
| 45 | 4C 77697468 | txt "with" |
| 4A | 0F 0A 45000000 3B00 0000 | map leaf, size 10: @45 → @3B |
| 54 | 4C 62696E64 | txt "bind" |
| 59 | 0F 0A 54000000 4A00 0000 | map leaf, size 10: @54 → @4A |
| 63 | 59000000 00000000 | root → @59; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 0E 09 00 0000 000000 00 | array leaf, size 9, shift 0, bitmap 0000, count 0 (root) |
| 0D | 04000000 00000000 | root → @4; previous: none |
A duration adds to the current time, so {#dur PT0S} reads the present. A
negative duration reads the past, as {#dur -PT5S} does for five seconds
ago.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 23647572 | txt "#dur" |
| 09 | 4C 50543053 | txt "PT0S" |
| 0E | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 18 | 4C 61734F66 | txt "asOf" |
| 1D | 0F 0A 18000000 0E00 0000 | map leaf, size 10: @18 → @E |
| 27 | 2C 6462 | txt "db" |
| 2A | 0F 0A 27000000 1D00 0000 | map leaf, size 10: @27 → @1D |
| 34 | 4C 77697468 | txt "with" |
| 39 | 0F 0A 34000000 2A00 0000 | map leaf, size 10: @34 → @2A |
| 43 | 4C 62696E64 | txt "bind" |
| 48 | 0F 0A 43000000 3900 0000 | map leaf, size 10: @43 → @39 |
| 52 | 48000000 00000000 | root → @48; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 6E616D65 | txt "name" |
| 09 | 3C 416461 | txt "Ada" |
| 0D | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 17 | 4C 6E616D65 | txt "name" |
| 1C | 3C 426F62 | txt "Bob" |
| 20 | 0F 0A 17000000 1C00 0000 | map leaf, size 10: @17 → @1C |
| 2A | 4C 6E616D65 | txt "name" |
| 2F | 2C 4379 | txt "Cy" |
| 32 | 0F 0A 2A000000 2F00 0000 | map leaf, size 10: @2A → @2F |
| 3C | 4C 6E616D65 | txt "name" |
| 41 | 3C 44616E | txt "Dan" |
| 45 | 0F 0A 3C000000 4100 0000 | map leaf, size 10: @3C → @41 |
| 4F | 4C 6E616D65 | txt "name" |
| 54 | 3C 457665 | txt "Eve" |
| 58 | 0F 0A 4F000000 5400 0000 | map leaf, size 10: @4F → @54 |
| 62 | 0E 1D 00 1F00 050000 00 0D000000 200000 00 32000000 450000 00 58000000 | array leaf, size 29, shift 0, bitmap 001F, count 5 (root): @D → @20 → @32 → @45 → @58 |
| 7F | 62000000 00000000 | root → @62; previous: none |
asOf, from, and to also accept input variables such as ?timestamp.
Supply a transaction id, UTC instant, or duration through parameters.
You can save the query before you supply the value.
Execution without the required value gives Missing_Parameter.
An asOf query can use a schema clause.
The current schema validates each entity's document at the selected transaction.
The query excludes entities that do not exist at that transaction.
interval reads a window of transactions instead. It has from and to, and
both ends are inside the window. Each end accepts a transaction id, a UTC
instant, or a duration. An instant window that resolves inverted gives no
facts.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 23757463 | txt "#utc" |
| 09 | 14 14 323032362D30 382D30315430303A 30303A30305A | txt "2026-08-01T00:00:00Z" |
| 1F | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 29 | 4C 66726F6D | txt "from" |
| 2E | 0F 0A 29000000 1F00 0000 | map leaf, size 10: @29 → @1F |
| 38 | 2C 746F | txt "to" |
| 3B | 02 1D000000000000 00 | i64 29 |
| 44 | 0F 0A 38000000 3B00 0000 | map leaf, size 10: @38 → @3B |
| 4E | 07 0E 00900000 2E00 0000 44000000 | map branch, size 14, depth 0 (root), slots 12, 15: @2E → @44 |
| 5C | 8C 696E7465727661 6C | txt "interval" |
| 65 | 0F 0A 5C000000 4E00 0000 | map leaf, size 10: @5C → @4E |
| 6F | 2C 6462 | txt "db" |
| 72 | 0F 0A 6F000000 6500 0000 | map leaf, size 10: @6F → @65 |
| 7C | 4C 77697468 | txt "with" |
| 81 | 0F 0A 7C000000 7200 0000 | map leaf, size 10: @7C → @72 |
| 8B | 4C 62696E64 | txt "bind" |
| 90 | 0F 0A 8B000000 8100 0000 | map leaf, size 10: @8B → @81 |
| 9A | 90000000 00000000 | root → @90; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 4C 6E616D65 | txt "name" |
| 09 | 3C 416461 | txt "Ada" |
| 0D | 0F 0A 04000000 0900 0000 | map leaf, size 10: @4 → @9 |
| 17 | 4C 6E616D65 | txt "name" |
| 1C | 3C 426F62 | txt "Bob" |
| 20 | 0F 0A 17000000 1C00 0000 | map leaf, size 10: @17 → @1C |
| 2A | 4C 6E616D65 | txt "name" |
| 2F | 2C 4379 | txt "Cy" |
| 32 | 0F 0A 2A000000 2F00 0000 | map leaf, size 10: @2A → @2F |
| 3C | 4C 6E616D65 | txt "name" |
| 41 | 3C 44616E | txt "Dan" |
| 45 | 0F 0A 3C000000 4100 0000 | map leaf, size 10: @3C → @41 |
| 4F | 4C 6E616D65 | txt "name" |
| 54 | 3C 457665 | txt "Eve" |
| 58 | 0F 0A 4F000000 5400 0000 | map leaf, size 10: @4F → @54 |
| 62 | 0E 1D 00 1F00 050000 00 0D000000 200000 00 32000000 450000 00 58000000 | array leaf, size 29, shift 0, bitmap 001F, count 5 (root): @D → @20 → @32 → @45 → @58 |
| 7F | 62000000 00000000 | root → @62; previous: none |
A fourth term in a fact clause binds the transaction of that fact.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 5C 3F6E616D65 | txt "?name" |
| 0A | 3C 3F7478 | txt "?tx" |
| 0E | 0E 11 00 0300 020000 00 04000000 0A0000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @A |
| 1F | 2C 3F65 | txt "?e" |
| 22 | 4C 6E616D65 | txt "name" |
| 27 | 5C 3F6E616D65 | txt "?name" |
| 2D | 3C 3F7478 | txt "?tx" |
| 31 | 0E 19 00 0F00 040000 00 1F000000 220000 00 27000000 2D0000 00 | array leaf, size 25, shift 0, bitmap 000F, count 4 (root): @1F → @22 → @27 → @2D |
| 4A | 0E 0D 00 0100 010000 00 31000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @31 |
| 57 | 5C 3F6E616D65 | txt "?name" |
| 5D | 0E 0D 00 0100 010000 00 57000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @57 |
| 6A | 5C 7768657265 | txt "where" |
| 70 | 0F 0A 6A000000 4A00 0000 | map leaf, size 10: @6A → @4A |
| 7A | 4C 66696E64 | txt "find" |
| 7F | 0F 0A 7A000000 0E00 0000 | map leaf, size 10: @7A → @E |
| 89 | 7C 6F726465724279 | txt "orderBy" |
| 91 | 0F 0A 89000000 5D00 0000 | map leaf, size 10: @89 → @5D |
| 9B | 07 12 2A000000 7000 0000 7F000000 9100 0000 | map branch, size 18, depth 0 (root), slots 1, 3, 5: @70 → @7F → @91 |
| AD | 9B000000 00000000 | root → @9B; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 5C 236C696E6B | txt "#link" |
| 00A | 02 06000000000000 00 | i64 6 |
| 013 | 0F 0A 04000000 0A00 0000 | map leaf, size 10: @4 → @A |
| 01D | 2C 7478 | txt "tx" |
| 020 | 0F 0A 1D000000 1300 0000 | map leaf, size 10: @1D → @13 |
| 02A | 4C 6E616D65 | txt "name" |
| 02F | 3C 416461 | txt "Ada" |
| 033 | 0F 0A 2A000000 2F00 0000 | map leaf, size 10: @2A → @2F |
| 03D | 07 0E 00C00000 2000 0000 33000000 | map branch, size 14, depth 0 (root), slots 14, 15: @20 → @33 |
| 04B | 5C 236C696E6B | txt "#link" |
| 051 | 02 06000000000000 00 | i64 6 |
| 05A | 0F 0A 4B000000 5100 0000 | map leaf, size 10: @4B → @51 |
| 064 | 2C 7478 | txt "tx" |
| 067 | 0F 0A 64000000 5A00 0000 | map leaf, size 10: @64 → @5A |
| 071 | 4C 6E616D65 | txt "name" |
| 076 | 3C 426F62 | txt "Bob" |
| 07A | 0F 0A 71000000 7600 0000 | map leaf, size 10: @71 → @76 |
| 084 | 07 0E 00C00000 6700 0000 7A000000 | map branch, size 14, depth 0 (root), slots 14, 15: @67 → @7A |
| 092 | 5C 236C696E6B | txt "#link" |
| 098 | 02 06000000000000 00 | i64 6 |
| 0A1 | 0F 0A 92000000 9800 0000 | map leaf, size 10: @92 → @98 |
| 0AB | 2C 7478 | txt "tx" |
| 0AE | 0F 0A AB000000 A100 0000 | map leaf, size 10: @AB → @A1 |
| 0B8 | 4C 6E616D65 | txt "name" |
| 0BD | 2C 4379 | txt "Cy" |
| 0C0 | 0F 0A B8000000 BD00 0000 | map leaf, size 10: @B8 → @BD |
| 0CA | 07 0E 00C00000 AE00 0000 C0000000 | map branch, size 14, depth 0 (root), slots 14, 15: @AE → @C0 |
| 0D8 | 5C 236C696E6B | txt "#link" |
| 0DE | 02 06000000000000 00 | i64 6 |
| 0E7 | 0F 0A D8000000 DE00 0000 | map leaf, size 10: @D8 → @DE |
| 0F1 | 2C 7478 | txt "tx" |
| 0F4 | 0F 0A F1000000 E700 0000 | map leaf, size 10: @F1 → @E7 |
| 0FE | 4C 6E616D65 | txt "name" |
| 103 | 3C 44616E | txt "Dan" |
| 107 | 0F 0A FE000000 0301 0000 | map leaf, size 10: @FE → @103 |
| 111 | 07 0E 00C00000 F400 0000 07010000 | map branch, size 14, depth 0 (root), slots 14, 15: @F4 → @107 |
| 11F | 5C 236C696E6B | txt "#link" |
| 125 | 02 06000000000000 00 | i64 6 |
| 12E | 0F 0A 1F010000 2501 0000 | map leaf, size 10: @11F → @125 |
| 138 | 2C 7478 | txt "tx" |
| 13B | 0F 0A 38010000 2E01 0000 | map leaf, size 10: @138 → @12E |
| 145 | 4C 6E616D65 | txt "name" |
| 14A | 3C 457665 | txt "Eve" |
| 14E | 0F 0A 45010000 4A01 0000 | map leaf, size 10: @145 → @14A |
| 158 | 07 0E 00C00000 3B01 0000 4E010000 | map branch, size 14, depth 0 (root), slots 14, 15: @13B → @14E |
| 166 | 0E 1D 00 1F00 050000 00 3D000000 840000 00 CA000000 110100 00 58010000 | array leaf, size 29, shift 0, bitmap 001F, count 5 (root): @3D → @84 → @CA → @111 → @158 |
| 183 | 66010000 00000000 | root → @166; previous: none |
When a temporal read is rejected
db accepts asOf or interval, and it needs one of them.
| Condition | Reason |
|---|---|
asOf 0 | Transaction ids start at 1 |
A malformed #utc or #dur value | The bound is not a valid temporal value |
interval with from above to, as transaction ids | The window is empty |
asOf and interval together | The two forms exclude each other |
A member that is not asOf or interval | db accepts no other member |
An interval read with a schema clause | Schema matching requires a single snapshot |
Each of these conditions gives one error. This query reads transaction 0:
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 00 | 54 52 4F 4E | magic TRON |
| 04 | 5C 3F6E616D65 | txt "?name" |
| 0A | 0E 0D 00 0100 010000 00 04000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @4 |
| 17 | 2C 3F65 | txt "?e" |
| 1A | 6C 73616C617279 | txt "salary" |
| 21 | 4C 3F73616C | txt "?sal" |
| 26 | 0E 15 00 0700 030000 00 17000000 1A0000 00 21000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @17 → @1A → @21 |
| 3B | 2C 3F65 | txt "?e" |
| 3E | 4C 6E616D65 | txt "name" |
| 43 | 5C 3F6E616D65 | txt "?name" |
| 49 | 0E 15 00 0700 030000 00 3B000000 3E0000 00 43000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @3B → @3E → @43 |
| 5E | 0E 11 00 0300 020000 00 26000000 490000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @26 → @49 |
| 6F | 4C 61734F66 | txt "asOf" |
| 74 | 02 00000000000000 00 | i64 0 |
| 7D | 0F 0A 6F000000 7400 0000 | map leaf, size 10: @6F → @74 |
| 87 | 2C 6462 | txt "db" |
| 8A | 0F 0A 87000000 7D00 0000 | map leaf, size 10: @87 → @7D |
| 94 | 4C 77697468 | txt "with" |
| 99 | 0F 0A 94000000 8A00 0000 | map leaf, size 10: @94 → @8A |
| A3 | 5C 7768657265 | txt "where" |
| A9 | 0F 0A A3000000 5E00 0000 | map leaf, size 10: @A3 → @5E |
| B3 | 4C 62696E64 | txt "bind" |
| B8 | 0F 0A B3000000 9900 0000 | map leaf, size 10: @B3 → @99 |
| C2 | 4C 66696E64 | txt "find" |
| C7 | 0F 0A C2000000 0A00 0000 | map leaf, size 10: @C2 → @A |
| D1 | 07 0E 01200000 B800 0000 C7000000 | map branch, size 14, depth 1, slots 0, 13: @B8 → @C7 |
| DF | 07 0E 0A000000 A900 0000 D1000000 | map branch, size 14, depth 0 (root), slots 1, 3: @A9 → @D1 |
| ED | DF000000 00000000 | root → @DF; previous: none |
Error
Invalid_Temporal
Facts for one query
bind.with.facts adds facts that the database does not hold. Each key is a UTC
timestamp, and its value is a merge patch below entities, keyed by entity
id, as Patches describes. Ada has ID 1 in this fixture.
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 5C 3F6E616D65 | txt "?name" |
| 00A | 4C 3F73616C | txt "?sal" |
| 00F | 0E 11 00 0300 020000 00 04000000 0A0000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @4 → @A |
| 020 | 2C 3F65 | txt "?e" |
| 023 | 6C 73616C617279 | txt "salary" |
| 02A | 4C 3F73616C | txt "?sal" |
| 02F | 0E 15 00 0700 030000 00 20000000 230000 00 2A000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @20 → @23 → @2A |
| 044 | 2C 3F65 | txt "?e" |
| 047 | 4C 6E616D65 | txt "name" |
| 04C | 5C 3F6E616D65 | txt "?name" |
| 052 | 0E 15 00 0700 030000 00 44000000 470000 00 4C000000 | array leaf, size 21, shift 0, bitmap 0007, count 3 (root): @44 → @47 → @4C |
| 067 | 0E 11 00 0300 020000 00 2F000000 520000 00 | array leaf, size 17, shift 0, bitmap 0003, count 2 (root): @2F → @52 |
| 078 | 5C 3F6E616D65 | txt "?name" |
| 07E | 0E 0D 00 0100 010000 00 78000000 | array leaf, size 13, shift 0, bitmap 0001, count 1 (root): @78 |
| 08B | 6C 73616C617279 | txt "salary" |
| 092 | 02 C8000000000000 00 | i64 200 |
| 09B | 0F 0A 8B000000 9200 0000 | map leaf, size 10: @8B → @92 |
| 0A5 | 1C 31 | txt "1" |
| 0A7 | 0F 0A A5000000 9B00 0000 | map leaf, size 10: @A5 → @9B |
| 0B1 | 8C 656E7469746965 73 | txt "entities" |
| 0BA | 0F 0A B1000000 A700 0000 | map leaf, size 10: @B1 → @A7 |
| 0C4 | 14 14 323032302D31 302D33305432333A 32303A32305A | txt "2020-10-30T23:20:20Z" |
| 0DA | 0F 0A C4000000 BA00 0000 | map leaf, size 10: @C4 → @BA |
| 0E4 | 5C 6661637473 | txt "facts" |
| 0EA | 0F 0A E4000000 DA00 0000 | map leaf, size 10: @E4 → @DA |
| 0F4 | 4C 77697468 | txt "with" |
| 0F9 | 0F 0A F4000000 EA00 0000 | map leaf, size 10: @F4 → @EA |
| 103 | 5C 7768657265 | txt "where" |
| 109 | 0F 0A 03010000 6700 0000 | map leaf, size 10: @103 → @67 |
| 113 | 4C 62696E64 | txt "bind" |
| 118 | 0F 0A 13010000 F900 0000 | map leaf, size 10: @113 → @F9 |
| 122 | 4C 66696E64 | txt "find" |
| 127 | 0F 0A 22010000 0F00 0000 | map leaf, size 10: @122 → @F |
| 131 | 07 0E 01200000 1801 0000 27010000 | map branch, size 14, depth 1, slots 0, 13: @118 → @127 |
| 13F | 7C 6F726465724279 | txt "orderBy" |
| 147 | 0F 0A 3F010000 7E00 0000 | map leaf, size 10: @13F → @7E |
| 151 | 07 12 2A000000 0901 0000 31010000 4701 0000 | map branch, size 18, depth 0 (root), slots 1, 3, 5: @109 → @131 → @147 |
| 163 | 51010000 00000000 | root → @151; previous: none |
| Offset (hex) | Bytes (hex) | Meaning |
|---|---|---|
| 000 | 54 52 4F 4E | magic TRON |
| 004 | 3C 73616C | txt "sal" |
| 008 | 02 C8000000000000 00 | i64 200 |
| 011 | 0F 0A 04000000 0800 0000 | map leaf, size 10: @4 → @8 |
| 01B | 4C 6E616D65 | txt "name" |
| 020 | 3C 416461 | txt "Ada" |
| 024 | 0F 0A 1B000000 2000 0000 | map leaf, size 10: @1B → @20 |
| 02E | 07 0E 80800000 1100 0000 24000000 | map branch, size 14, depth 0 (root), slots 7, 15: @11 → @24 |
| 03C | 3C 73616C | txt "sal" |
| 040 | 02 64000000000000 00 | i64 100 |
| 049 | 0F 0A 3C000000 4000 0000 | map leaf, size 10: @3C → @40 |
| 053 | 4C 6E616D65 | txt "name" |
| 058 | 3C 426F62 | txt "Bob" |
| 05C | 0F 0A 53000000 5800 0000 | map leaf, size 10: @53 → @58 |
| 066 | 07 0E 80800000 4900 0000 5C000000 | map branch, size 14, depth 0 (root), slots 7, 15: @49 → @5C |
| 074 | 3C 73616C | txt "sal" |
| 078 | 02 5A000000000000 00 | i64 90 |
| 081 | 0F 0A 74000000 7800 0000 | map leaf, size 10: @74 → @78 |
| 08B | 4C 6E616D65 | txt "name" |
| 090 | 2C 4379 | txt "Cy" |
| 093 | 0F 0A 8B000000 9000 0000 | map leaf, size 10: @8B → @90 |
| 09D | 07 0E 80800000 8100 0000 93000000 | map branch, size 14, depth 0 (root), slots 7, 15: @81 → @93 |
| 0AB | 3C 73616C | txt "sal" |
| 0AF | 02 46000000000000 00 | i64 70 |
| 0B8 | 0F 0A AB000000 AF00 0000 | map leaf, size 10: @AB → @AF |
| 0C2 | 4C 6E616D65 | txt "name" |
| 0C7 | 3C 44616E | txt "Dan" |
| 0CB | 0F 0A C2000000 C700 0000 | map leaf, size 10: @C2 → @C7 |
| 0D5 | 07 0E 80800000 B800 0000 CB000000 | map branch, size 14, depth 0 (root), slots 7, 15: @B8 → @CB |
| 0E3 | 3C 73616C | txt "sal" |
| 0E7 | 02 50000000000000 00 | i64 80 |
| 0F0 | 0F 0A E3000000 E700 0000 | map leaf, size 10: @E3 → @E7 |
| 0FA | 4C 6E616D65 | txt "name" |
| 0FF | 3C 457665 | txt "Eve" |
| 103 | 0F 0A FA000000 FF00 0000 | map leaf, size 10: @FA → @FF |
| 10D | 07 0E 80800000 F000 0000 03010000 | map branch, size 14, depth 0 (root), slots 7, 15: @F0 → @103 |
| 11B | 0E 1D 00 1F00 050000 00 2E000000 660000 00 9D000000 D50000 00 0D010000 | array leaf, size 29, shift 0, bitmap 001F, count 5 (root): @2E → @66 → @9D → @D5 → @10D |
| 138 | 1B010000 00000000 | root → @11B; previous: none |
A value replaces the stored field, and null retracts it. A reference field
uses {#link <id>}. An id that the database does not hold becomes a new
entity for this query alone. Stardust writes none of these facts.