Repository navigation
Conversation
This was referenced Nov 20, 2026
cldellow
force-pushed
the
all-changes
branch
from
November 21, 2026 12:52
313fdd2 to
c700fa3
Compare
cldellow
force-pushed
the
all-changes
branch
from
November 21, 2026 18:31
9a79a66 to
4915c0f
Compare
cldellow
force-pushed
the
all-changes
branch
from
November 21, 2026 21:14
f2cd8e0 to
f116b76
Compare
This was referenced Nov 22, 2026
ways_contained_in tests the candidate ways against the input's ways and
relations taken as areas. It walked every candidate way tile by tile,
building each way's geometry in Tilewise_Way_Iterator, even when there
were no such areas (the usual case, area[...]->.a; way(area.a)) or after
the last one had been passed, and then discarded it all.
Return before building the way iterator if the area iterator is empty,
and leave the loop once it is exhausted. Both ways_contained_in overloads
(current and attic).
Geofabrik Nova Scotia extract with areas, warm cache, 25 alternating pairs:
[out:csv(::count)]; area[name="Halifax Regional Municipality"]->.a; way[building](area.a); out count;
1607 ms -> 1163 ms (-28%)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJUqyDw9zM3Bkh2W2QT
Query_Statement collects candidates in chunks and filters each chunk
before collecting the next; MAX_CHUNK_ACCOUNTED_SIZE ends a chunk once
eval_map counts that much. eval_map counts a node as 8 bytes, so 64 MiB
let a chunk hold 8 million nodes, about 100 MB in memory. Queries whose
candidates fit under that, such as a tag filter over a city-sized box,
held all of them at once.
The cap is now 16 MiB accounted (2 million nodes or 128k ways). Chunks end
at index boundaries, so filtering a chunk repeats no work of the previous
one.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
peak RSS, CPU as the median of 7 alternating runs:
node["amenity"](42.2,-71.3,42.5,-70.9); out meta;
174 MB -> 77 MB, CPU x0.94
[date:"2018-06-01T00:00:00Z"]; (node["amenity"](42.2,-71.3,42.5,-70.9); way["amenity"](42.2,-71.3,42.5,-70.9);); out meta;
543 MB -> 171 MB, CPU x0.98
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit 4b95ce3)
Query_Statement::filter_by_tags checks tags late for candidates collected
by area: generate_ids_by_coarse copied the id of every candidate into a
map of per-cell id lists, and filter_ids_by_tags then narrowed each list
to the matching ids. All candidate ids were held at once, alongside the
candidates themselves, although only one cell's are needed at a time.
filter_by_tags now creates the map's entries (one per cell, still needed
for the range query and filter_by_ids) without ids, and fill_cell_ids
fills a cell's ids from the items, and attic items at a past date, just
before that cell is filtered. Each list then shrinks to its matches, so
the map ends up holding only those.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median of 3 alternating runs:
node["amenity"](42.2,-71.3,42.5,-70.9); out meta;
peak RSS 174 MB -> 137 MB, CPU 1.46 s -> 1.29 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit d4cc14a)
…p map
Tag_Entry_Listener_Value_Regex::filter_ids keeps the candidates whose
tag matched at the requested date. It looked each candidate up with
timestamps[*it], and operator[] inserts a map entry for every candidate
without a matching tag entry, only to reject it. For a cell of a common
key that is a node allocation per candidate.
It now uses find(); a candidate absent from the map is rejected as before.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median CPU of 3 alternating runs:
[adiff:"2025-01-01T00:00:00Z","2026-11-01T00:00:00Z"]; (node["amenity"](42.2,-71.3,42.5,-70.9); way["building"](42.3,-71.15,42.4,-71.0); ); out geom;
16.68 s -> 15.36 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit 563e4b5)
Query_Statement::apply_all_filters runs metadata-only filters first and
the others in query order. An (if:) filter builds what its expression
needs for every element it evaluates (Set_With_Context::prefetch); for
geometry that is a way or relation geometry store over all candidates.
Written before a spatial filter, as in wr(if:length()>10)(around:10,...),
it computed the geometry of every relation in the coarse candidate ranges,
which the exact around test then nearly all dropped.
Query_Constraint gains filter_needs_geometry(). Filter_Constraint answers
it from its criterion's request_context() (Set_Usage::GEOMETRY), and
apply_all_filters runs such filters in a last pass. (if:) filters on tags,
ids or metadata keep their place, so they still drop candidates before an
expensive spatial test. The filters only remove elements, so the order
doesn't change the result.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median of 5 alternating runs:
[out:json]; wr(if:length()>10)(around:10,40.580976,-75.522374)->.s0; way(r.s0:"house")->.s1; rel.s0(39.638451,-80.311484,39.819817,-80.194662)->.s2; .s2 <<->.s3; .s2 out meta center qt 20;
CPU 5.44 s -> 0.14 s, peak RSS 187 MB -> 23 MB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit 9acbe90)
Changed_Constraint::get_*_ids_within reads the changelog for the given
period and keeps the changed ids among those the other constraints allow.
filter() then read the whole changelog for the period again, to keep the
collected elements that changed. That second read is redundant: an element
outside the known ids fails another constraint anyway, so the ids from the
first read decide the same.
The constraint keeps the ids get_*_ids_within found, per element type, and
filter() uses them instead of reading the changelog again. get_*_ids (the
path without known ids) clears them, so a statement executed again, as in a
loop, can't reuse a previous execution's ids.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median of 3 alternating runs:
node["electrified"="no"](around:250,42.437849,-70.979304)["tiger:zip_left_1"~"^17"](changed:"2008-03-26T21:18:32Z")->.s0; foreach.s0->.it{ .it out ids; (.it; .it >;)->.x; .x out count; } .s0 out meta bb asc;
CPU 16.21 s -> 9.18 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit 4c30af0)
A union of query statements of one type with the same filters apart
from tag filters, such as node statements around the same point with
different tags, reads and decompresses the same blocks once per
statement. While such a union runs, each block read from a compressed
read-only file is kept decompressed, and later reads copy it instead of
decompressing it again. Other queries keep nothing.
The cache belongs to the transaction, which gives it to the indexes of
its read-only files, so it lives no longer than the snapshot it was read
from, and flush() empties it. It keeps only a block's used bytes, holds
at most a quarter of the query's [maxsize:] (128 MiB by default) per
transaction, and evicts nothing. Like other auxiliary structures it
isn't counted toward [maxsize:]; it stays within the headroom of the
process memory limit, 2 x maxsize + 1 GiB. Whether a union qualifies
only decides what is kept; results never depend on it.
Geofabrik Nova Scotia extract (2026-11-08) with the area rules run,
warm cache, 4-core VM, 15 alternating pairs: CPU time 28% lower, peak
memory 19 -> 51 MB:
[out:json][timeout:45]; (node["tourism"](around:25000,44.6488,-63.5752);
way["tourism"](around:25000,44.6488,-63.5752);
node["amenity"~"restaurant|cafe|bar|pub|fast_food|ice_cream"](around:25000,44.6488,-63.5752);
way["amenity"~"restaurant|cafe|bar|pub"](around:25000,44.6488,-63.5752);
node["leisure"~"park|garden|stadium|sports_centre|marina|golf_course"](around:25000,44.6488,-63.5752);
way["leisure"~"park|garden|stadium|nature_reserve"](around:25000,44.6488,-63.5752);
node["historic"](around:25000,44.6488,-63.5752);
way["historic"](around:25000,44.6488,-63.5752);
node["natural"~"peak|beach|waterfall"](around:25000,44.6488,-63.5752);
); out body center 500;
Co-Authored-By: Colin Dellow <cldellow@gmail.com>
filter_id_list tests every global tag index entry against the key and value regexes. There is one entry per element, sorted by key and value, so a filter like ["highway"~"primary|secondary"] runs the same regex on the same strings once for every element in the database with the key. Remember the result for the last key and value, and run the regexes only when either changes. key=value lookups have no regex and keep the plain test. This path runs for key-regex filters when the tags are not checked late: around with a radius of 2 km or more, a bbox of 1 square degree or more, large polygons and areas, and no spatial filter. For example, on a US northeast extract this query takes 40% less CPU: [out:json]; (node["office"="hr"](around:25000,42.3601,-71.0589); way["office"="hr"](around:25000,42.3601,-71.0589); node["office"="consulting"]["name"~"hr|human resource|talent|workforce|people",i](around:25000,42.3601,-71.0589); way["office"="consulting"]["name"~"hr|human resource|talent|workforce|people",i](around:25000,42.3601,-71.0589); ); out body center qt;
When a statement checks tags late, filter_by_tags read every local tag entry of every coarse index that holds a candidate: all keys of all elements there, though it only looks at the keys the statement filters on. A union of statements over the same small area reads all of them again for each statement. Restrict the ranges to the entries of the filtered keys, and for negated filters to the negated keys. Statements with a key regex ([~"k"~"v"]) still read every key. Tag entries are sorted by coarse index, key and value, so the narrower ranges skip whole blocks. On a US northeast extract this query takes about half the CPU: [out:json]; nwr["building"]["building"!="yes"](42.34,-71.08,42.38,-71.04); out count;
Most tag regexes in today's queries are lists of plain words: unanchored
("cafe|bar|pub", a value containing one of them) or anchored as a whole
("^(cafe|bar|pub)$", a value equal to one of them), often
case-insensitive. Each regexec call in the C.UTF-8 locale is slow, more so
with REG_ICASE, which converts the value to wide characters.
Recognise these two forms when the words are ASCII letters, digits and a
few punctuation characters, and match ASCII values by substring search or
comparison, folding ASCII case for case-insensitive patterns. That gives
the same result as the library. Values with other bytes, and all other
patterns, still go to regexec.
On a US northeast extract this query takes about 40% less CPU:
[out:json]; (node["amenity"="clinic"]["name"~"cosmetic|aesthetic|beauty|skin|plastic",i](around:25000,42.3601,-71.0589);
way["amenity"="clinic"]["name"~"cosmetic|aesthetic|beauty|skin|plastic",i](around:25000,42.3601,-71.0589);
node["healthcare"~"aesthetics|cosmetics",i](around:25000,42.3601,-71.0589);
way["healthcare"~"aesthetics|cosmetics",i](around:25000,42.3601,-71.0589);
); out body center qt;
Remove two redundant sorts, and add a guard to avoid a redundant sort in
some cases:
- generate_ids_by_coarse (both overloads) sorted each coarse index's ids
a second time, after already sorting them and removing duplicates.
- filter_ids_by_tags sorts the ids before checking each required key.
The first key's ids are always already sorted, so it now sorts only if
std::is_sorted says they aren't.
Geofabrik Nova Scotia extract, warm cache, 25 alternating pairs:
[out:json]; (node["shop"](44.45,-63.80,44.85,-63.40); node["amenity"](44.45,-63.80,44.85,-63.40); node["tourism"](44.45,-63.80,44.85,-63.40); ); out count;
638 ms -> 561 ms (-13%)
Co-Authored-By: Colin Dellow <cldellow@gmail.com>
To test ways against a bbox, Bbox_Filter loads the nodes of every candidate way and checks its segments. A way's index covers all its nodes, so when the area of the index lies inside the bbox, every node of the way does, and the way matches. In a large bbox that is nearly every way, yet the filter loaded all their nodes, for each way statement. Move those ways aside before building the geometry store, and keep them. The bbox must not cross the antimeridian and must span less than 180 degrees of longitude, as segments are then tested without wrapping. The one difference: a way that references a node missing from the database has no geometry, and was dropped before. With its index inside the bbox it is now kept. Consistent databases have no such ways. On a US northeast extract this query takes 19% less CPU, and a count of the ways in a 2 x 3.5 degree box needs 2.3 GB instead of 5.1 GB: [out:json][timeout:120]; (way["maxheight"](41.24,-73.51,42.89,-69.93); way["maxweight"](41.24,-73.51,42.89,-69.93); way["maxlength"](41.24,-73.51,42.89,-69.93); way["maxwidth"](41.24,-73.51,42.89,-69.93); way["hazmat"](41.24,-73.51,42.89,-69.93); way["hgv"](41.24,-73.51,42.89,-69.93); node["maxheight"](41.24,-73.51,42.89,-69.93); node["maxweight"](41.24,-73.51,42.89,-69.93); ); out geom;
…adius To test ways against around, Around_Constraint loads the nodes of every candidate way and measures their distance. A way's index covers all its nodes, so when the whole area of the index lies within the radius of a point, every node of the way does, and the way matches. With a large radius that is most of the ways, yet the filter loaded all their nodes. For around with points (lat/lon, or input nodes, up to 64), move those ways aside before building the geometry store, and keep them. Over a lat/lon box narrower than 180 degrees the distance to a point is greatest at a corner, so the four corners are tested, with a margin of 1 m. The area must also lie in the bbox that add_coord registers the point for, since is_inside only looks there. The one difference: a way that references a node missing from the database has no geometry, and was dropped before. With its index within the radius it is now kept. Consistent databases have no such ways. On a US northeast extract this query takes about half the CPU and a third less memory: [out:json]; way[highway](around:25000,42.3601,-71.0589); out count;
Around_Statement::is_inside(lat, lon) computes the great-circle distance to every point registered for the candidate's tile until one is within the radius. When the input set is dense, a tile holds thousands of points, and the cosines and arccosine dominate the query. A great-circle distance is at least the difference in latitude, which great_circle_dist counts as 10,000 km per 90 degrees. Skip points whose latitude differs by more than the radius plus 1 m; the metre covers rounding in great_circle_dist, so no match is lost. On a US northeast extract this query takes a fifth of the CPU: [out:json]; node(42.35,-71.07,42.37,-71.05)->.s; node(around.s:20)["highway"]; out count;
A query statement such as wr(bn.s)["highway"] uses Recurse_Constraint with the type RECURSE_NODE_WR, which none of the constraint's methods handled, unlike the standalone wr(bn.s): - get_way_ranges and get_relation_ranges returned global ranges, and get_data didn't collect anything, so the statement fell back to the tag filters alone over the whole database: it failed with "Filters too weak" after scanning, or read every element with the tag. - filter dropped all ways, and of the relations only the current ones, keeping every relation version from attic data unfiltered. So wr(bn.s) with a tag filter returned nothing, or an error, at the current date, and unrelated relations at past dates. Treat RECURSE_NODE_WR as RECURSE_NODE_WAY for ways and as RECURSE_NODE_RELATION for relations, as the standalone statement does. The results now match (way(bn.s)[...]; rel(bn.s)[...];).
At a past date, collect_ids built a map of every element that ever had a filter's tag, in the whole database, for each tag filter of a statement. At the current date, filter_id_list gives up on the first filter after 1,048,576 ids when tags can also be checked late, and later filters keep only ids already collected. Do the same at a past date: - collect_attic_kv, collect_attic_k and collect_attic_kregv take a limit and stop once their map holds that many ids. collect_ids passes 1024*1024 under the same conditions as at the current date (the first filter, and prefer_ranges or ids_useful), and gives up as it does there when the limit is reached. - For later filters, collect_ids passes the ids collected so far as relevant_ids, so the map holds only those. collect_attic_k gains the relevant_ids parameter the other two already have. Peak RSS, Geofabrik Nova Scotia full-history extract, warm cache, 4-core VM, for [out:xml][date:"2025-12-06T00:00:00Z"]; way(1)->.x; way.x[foot=yes][building=yes]; out meta; 21 MB -> 10 MB (the input set is empty, so 10 MB is the baseline). On a planet database, a common tag such as highway=service takes several GB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01736kJUqyDw9zM3Bkh2W2QT
When changed: filters a statement's candidates, Changed_Constraint::filter scans the node, way and relation changelogs over the whole time range, each time testing every change against the set, even for types the set doesn't hold. A way statement still scans every node change in the range, which on a large database is most of the work. Skip a type's changelog when the set has no elements of that type, current or attic: the scan can only keep elements already there.
rel(br.s) and its role form find the relations that have a relation of .s as a member by scanning every relation, as relations have no index by member. At a past date that means reconstructing every old version of every relation, several seconds on a regional database, even when .s holds no relations and nothing can match. Return an empty result when the input has no relations, current or attic.
escape_xml and escape_cstr built an escaped copy of every key, value, user and role written, even though most need no escaping. Printing now writes the string straight to the stream in one pass: runs of bytes that need no escaping are written as they are, and each byte that does is replaced from a 256-entry table, as in Go's encoding/xml (escapeText) and libxml2's attribute serializer. escape_xml and escape_cstr use the same table and loop, so the escaping rules are defined once. Output is unchanged: for every byte value and 200,000 random strings, both functions and the stream writers give the same result as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01736kJTiuJPoCWZs7RtFYjm
Chunked tag output (prefetch_chunk -> collect_tags_framed) appended every matching tag entry to its element's vector in a std::map keyed by id: one map lookup per tag, and each element's vector grown, and its strings moved, as tags arrived. Per coarse index, record the matches as (id, key/value slot) pairs, keeping each distinct key/value once; sort them by id, keeping tag order; then fill each element's vector once, reserved to its final size. Also look up the coarse index's id list once per coarse index instead of once per tag entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01736kJUqyDw9zM3Bkh2W2QT
Chunked tag output copied every tag's key and value into its element's list, once per element: building=yes is copied once for every building. Output handlers now take tags as a Tag_List (core/tag_list.h), a vector of Tag_Ref, which refers to a key and value stored elsewhere and has the same first/second members, so the output formats read it unchanged. Tag_Store keeps one copy of each key and value per coarse index and gives the printing code reference lists (get_refs); get() still returns copies, for evaluators. Callers that hold tags as pairs (diff output, derived elements, timestamps) go through adaptors on Output_Handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01736kJUqyDw9zM3Bkh2W2QT
cldellow
force-pushed
the
all-changes
branch
from
November 26, 2026 21:20
35b7ec2 to
a71b7e3
Compare
Owner
Author
|
Fuzz failures are from integrating the #193 fix, which fixes a correctness bug on master. Will see about patching the fuzzer/property tests in the meantime. |
…e lookup
With a bbox of 1 square degree or more, a query statement with tag filters
looks up ids in the global tag index (collect_ids) and filters by the bbox
afterwards. It looked keys up in the order written, and each further key
read its whole index range, binary-searching every entry against the
candidates so far. For way["maxheight"]["highway"] over open ocean that
meant collecting every maxheight way in the database and then reading the
whole highway index, though none of them could be in the box.
Query_Statement::execute now computes the constraints' node, way and
relation ranges before the tag lookup (they don't depend on it) and passes
them to progress_1 and collect_ids. At the current date:
- keep_ids_inside drops candidates whose cell lies outside those ranges
after each lookup; when none are left, the lookup stops.
- The key and key-value lookups run smallest first, counted in blocks of
the global tag index (Block_Backend::count_blocks, from the block index
alone).
- When checking the remaining tags late would read fewer local tag blocks
than the remaining lookups would read global ones, the lookup stops and
the query checks all tags late (check_keys_late = prefer_ranges).
The global tag index stores coarse indices, so a candidate is kept if its
cell overlaps the ranges, as intersect_ranges does.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median CPU of 5 runs:
[out:json][timeout:90]; (way["maxheight"]["highway"](39.0,-70.0,40.0,-69.0); way["bridge"]["maxheight"](39.0,-70.0,40.0,-69.0); way["tunnel"]["maxheight"](39.0,-70.0,40.0,-69.0); node["maxheight"]["highway"](39.0,-70.0,40.0,-69.0); ); out center;
0.24 s -> 0.00 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit 77135ca)
The global tag index stores each element's coarse index (a multiple of
0x100), so Query_Statement::execute intersected the constraints' ranges
with whole coarse cells (intersect_ranges) and read every element of each
candidate's cell. In dense areas that is thousands of elements per
candidate: for maxheight ways in a 1 x 1 degree box around Worcester, 2,185
distinct way blocks for 1,025 results.
Each element type's id map (the skeleton file's Random_File) gives exact
indices. exact_indices_pay_off compares the map blocks the candidate ids
fall in (the map holds a fixed number of ids per block and decompresses one
block at a time) with the skeleton blocks the coarse ranges touch
(Block_Backend::count_blocks); when the map blocks are fewer than half,
the ranges are further intersected with the candidates' exact indices
(get_indexes_, exact_ranges). At a past date nothing changes.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median CPU of 3 alternating runs:
[out:json][timeout:90]; (way["maxheight"]["highway"](42.0,-72.0,43.0,-71.0); way["bridge"]["maxheight"](42.0,-72.0,43.0,-71.0); way["tunnel"]["maxheight"](42.0,-72.0,43.0,-71.0); node["maxheight"]["highway"](42.0,-72.0,43.0,-71.0); ); out center;
1.24 s -> 0.88 s, way blocks read 3,389 -> 391
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit e0bbfaa)
…y search
filter_id_list, which intersects the ids of a tag lookup with the
candidates of the earlier ones, binary-searched every index entry of the
later key in the candidate list. For a common key such as highway that is
millions of searches, nearly all of which fail.
It now builds an Id_Bit_Filter of the candidates and skips entries whose
id the filter rejects; the binary search confirms the rest.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median CPU of 3 alternating runs:
[out:json][timeout:90]; (way["maxheight"]["highway"](39.0,-70.0,40.0,-69.0); way["bridge"]["maxheight"](39.0,-70.0,40.0,-69.0); way["tunnel"]["maxheight"](39.0,-70.0,40.0,-69.0); node["maxheight"]["highway"](39.0,-70.0,40.0,-69.0); ); out center;
0.33 s -> 0.21 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit 284a109)
collect_tags_framed reads every local tag entry of a cell and keeps those
of the elements being printed, binary-searching each entry's id among
them. Most entries of a cell belong to other elements.
It now builds an Id_Bit_Filter of the cell's ids and skips entries whose
id the filter rejects before the bound checks and the binary search.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median CPU of 3 alternating runs:
(rel['seamark:type']; >; way['seamark:type']; >; node['seamark:type']; ); out meta;
4.66 s -> 3.66 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit edf6f1e)
While a union whose statements will re-read the same blocks runs, the
transaction's Block_Cache keeps the decompressed blocks of every data file
it reads. Such statements share every filter apart from their tag filters,
so they read the same skeleton and local tag blocks, but look up different
tags in the global tag index: its blocks are not read again. They only
filled the cache, up to its limit, and cost a copy each.
Nonsynced_Transaction::data_index no longer attaches the block cache to
the *_tags_global files.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
peak RSS, CPU as the median of 3 alternating runs:
[out:json][timeout:90]; (way["maxheight"]["highway"](39.0,-70.0,40.0,-69.0); way["bridge"]["maxheight"](39.0,-70.0,40.0,-69.0); way["tunnel"]["maxheight"](39.0,-70.0,40.0,-69.0); node["maxheight"]["highway"](39.0,-70.0,40.0,-69.0); ); out center;
74 MB -> 13 MB, CPU 0.36 s -> 0.33 s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit 6fde65a)
When a query statement checks tags late (a bbox under 1 square degree,
around under 2 km, and other range strategies), it collected every element
in its ranges, decoded each skeleton with its member list, checked the tags
of all of them, and kept the matches. In a dense 0.99999 x 0.99999 degree
box around Worcester, way["maxheight"]["highway"] decoded about two million
ways to keep about a thousand.
Before collecting, Query_Statement::execute now asks ids_from_local_tags for
the ids that carry every positive tag filter (keys, key-values,
key-regexes): it reads only those keys' entries in the local tag index for
the ranges' coarse cells, and intersects the per-filter id lists. Collection
then gets these ids, so it skips the other elements on their raw id without
decoding them. The late tag check still runs on what is collected, so
negated filters and regex keys behave as before.
It applies at the current date, without an id constraint already in place,
and when the ranges span at most 65,536 coarse cells. Uint31_Index orders by
the low 31 bits first, so for ways and relations the cells are taken from
those bits.
On a US northeast full-history extract (Geofabrik), warm cache, 4-core VM,
median CPU and peak RSS of 3 alternating runs:
[out:json][timeout:90]; (way["maxheight"]["highway"](42.0,-72.0,42.99999,-71.00001); way["bridge"]["maxheight"](42.0,-72.0,42.99999,-71.00001); way["tunnel"]["maxheight"](42.0,-72.0,42.99999,-71.00001); node["maxheight"]["highway"](42.0,-72.0,42.99999,-71.00001); ); out center;
6.49 s -> 1.59 s, 608 MB -> 14 MB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01736kJWpJaGbt8ML6jz9N35
(cherry picked from commit d053c62)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6, fixes #4, fixes #3, fixes #5, fixes #9, fixes #15, fixes #16, fixes #19, fixes #23, fixes #27, fixes #30, fixes #36, fixes #37, fixes #32, fixes #40, fixes #62, fixes #70, fixes #78, fixes #79, fixes #85, fixes #63, fixes #72, fixes #77, fixes #76, fixes #94, fixes #96, fixes #93, fixes #103, fixes #120, fixes #119, fixes #125, fixes #129, fixes #127, fixes #135, fixes #137, fixes #139, fixes #149, fixes #156, fixes #161, fixes #166, fixes #212, fixes #217, fixes #219, fixes #221, fixes #223, fixes #215, fixes #232, fixes #234, fixes #236, fixes #238, fixes #240, fixes #173, fixes #177, fixes #176, fixes #175, fixes #181, fixes #183, fixes #190, fixes #192, fixes #169, fixes #197, fixes #209, fixes #242, fixes #246, fixes #248, fixes #250, fixes #252, fixes #254.
all-changescombines every performance and memory change explored in this fork, cherry-picked ontomaster(fossgis, a9d8f15). Each change also has its own PR for review. This PR tracks their combined effect. None of the changes alters the database format or the query API.All measurements below are from one snapshot, 2026-11-27:
mastera9d8f15 againstall-changes02ea396 (80 commits), on every query this description defines. Output is identical on every query that both builds finish (masterdoesn't finish four prompting queries, see ¹). Commits 14, 20 and 39 were merged upstream and are part ofmastera9d8f15, so these numbers don't count them. Per-commit effects are in each commit's PR.Summary
master→ all-changesmastercan't finish within its own CPU limit take 0.5–9 sCommits
In branch order. The prompting queries are defined under Prompting queries; q, a, t, p and h are the benchmark sets.
Id_Predicate's binary searchstd::arrayinstead of heap-allocated vectors inaround's geometryaroundonly tests nearby geometryhealth_checkinsidearound's candidate loops>and>>read each node block once instead of twiceWrite tag strings without an escaped copy when nothing needs escapingout meta,newer, user filters) use a sorted vectoruser: filter relations by touched ids whenever the set has relationsuid_touchedanduser_touchedreturned relations the users never touched when the set had relations but no nodesnewerand the user filters run before bbox,aroundand area checksaround's rangesDon't copy the input set when passing it or an empty set by referenceout countandaroundno longer copy their input setpoly:node tests use decoded blocks with an early longitude exit[date:]and[diff:]changed:keeps only the ids the other constraints allownode(bbox)at a past date works chunk by chunknode(bbox)at a past date whose result exceeds[maxsize:]fails as soon as it does, not after building the whole result[maxsize:]out(exceptqt) reserves its id-sorted references instead of growing them to up to 2.2× their sizecollect_items: pass end iterators to reconstruct_items by referencefilter_by_bboxandfilter_attic_elementscompact each vector in place and shrink it, instead of rebuilding it bypush_backoutwith tags builds the id lists once, not per chunk, and drops earlier chunks' attic tagspoly:queries build each candidate way's geometry once instead of twiceoutwith tags builds each chunk's id lists from that chunk's elements, not the whole setout(exceptqt) sorts 8-byte references (vector entry, position) instead of 16-byte, or 24-byte with attic elementsaroundwith a polyline returned nothing, because commit 17 skips the empty map entry the polyline's range was built fromtemplate_db: keep decompressed blocks that a query reads repeatedlyunion: cache blocks from their first read when statements will re-read themtemplate_db: keep blocks only while a statement expects re-readsless(void*)/leq(void*)instead of building anIndex, which allocated two strings per tag entry examined. Itscollect_tags_framedlookup change is already here (cursor commit), so only the assessor part is cherry-pickedIdx_Handledecodes into storage inside the handle instead ofnew/deleteper entry; also adds the missingreturn *thisto itsoperator=collect_items_rangealready did this (commit 40's running size), so it covers the other 5ways_contained_inno longer builds every candidate way's geometry when the input set has no ways to take as areas, or once the last way-area tile has passedfind()instead ofoperator[]in the past-date value listener, which inserted a map entry per rejected candidate. CPU only(if:)filters whose expression needs geometry, so spatial filters narrow the candidates first. 12–90× on such queriesfilter()reuses the ids commit 31'sget_*_ids_withinfound instead of reading the changelog again[maxsize:](128 MiB by default); it is used only while a union whose query statements share all non-tag filters runs. Memory: up to[maxsize:]/4 more for such unions, nothing for other queries|(anchored or not) are matched by substring search or comparison; other patterns and non-ASCII values use the libraryaroundwr(bn.s)with a tag filter returned nothing at the current date and unrelated relations at past dates; it also no longer scans globally ("Filters too weak")changed:skips the changelog of a type the set has no elements ofrel(br)returns at once when the input has no relationsId_Bit_Filterin front of the binary search infilter_id_listcollect_tags_framed; here applied to the cursor version rather than #251's binary search*_tags_globalblocks, which a union's statements don't re-readaroundunder 2 km), the ids carrying every positive tag filter are read from the local tag index first, so collection skips the rest without decoding them. The maxheight query at 0.99999°: 3.61 → 0.76 s, 213 → 142 MBAdded on 2026-11-27: commits 82–87, from profiling the maxheight query (#242, one of the worst offenders on the public servers) in dense, sparse and empty boxes at 1° and 0.99999°. Against the previous tip (a71b7e3), on the 41 queries of #255 (the maxheight variants, the 20 production-shaped queries and 15 diff, meta and past-date queries), total CPU fell 19.0%, and output is identical to
upstream/masteron all 41. Largest changes: dense_099 3.61 → 0.76 s, p04 3.65 → 0.82 s, p20 0.26 → 0.02 s, p12 0.32 → 0.08 s, p05 0.35 → 0.11 s, p19 2.80 → 1.11 s, empty_1 0.26 → 0.00 s; peak memory p12 79 → 16 MB, p20 68 → 13 MB, empty_1 73 → 9 MB. Commits 84 and 85 were resolved against this branch's versions of the code they change (commit 45's cursor, #174's matcher); the others applied as in their PRs.Rebuilt on 2026-11-26 to add commits 67–81 (every open performance and memory PR that wasn't here yet) and to replace two superseded changes: commit 9 (#26, closed) by commit 79 (#206), and commits 52–54 (the first block-cache design) by commit 67 (#167 as reviewed). Replaced and upstreamed rows stay in the table, struck out, so the numbering doesn't change. Three commits needed conflicts resolved when cherry-picked: commit 72 replaces commit 8's ways-in-inner-tiles helper, which it subsumes; commit 73 keeps commit 33's health check in
around's filter calls; commits 80 and 81 use commit 45's forward cursor and commit 46's per-chunk ids incollect_tags_framed, and commit 47's compact references inprint.Method
CPU is user + system time of
osm3s_query, warm page cache, on a 4-core VM (bench/compare.py --no-cache --rss: runs alternate between the builds, and each table shows the median). Runs per build: 7 for q and a, 5 for t, p, w and h, 3 for the prompting queries, 1 for the large result sets. Peak memory is RSS from one extra run under GNU time. Run-to-run noise is about ±10% per query, so differences under that are within noise; single runs (large result sets) are noisier.² Small queries peak about 3 MB higher than in the previous measurement (e.g. q01 8.8 → 11.5 MB on all-changes, with
masterunchanged at 8.6 MB). Not yet traced to a commit.¹
masterdoesn't finish C, D, I or J: the process's hard CPU limit (2 ×[timeout:]+ 60 s, so 420 s at the default 180 s, or 80 s for D's[timeout:10]) kills it with no output. All-changes was run 3 times on these,masteronce.osmium time-filter) of the Nova Scotia full-history extract below, as of 2026-11-15 (12.7M nodes, 883k ways, 21.4k relations), imported with--metabymaster'supdate_database, with the standard area rules run. Queries that don't use areas ("plain" below) ran on this database too.better-importsbuild ofupdate_database.--compression-method=lz4 --map-compression-method=lz4(an uncompressed id map didn't fit on this VM's disk during the import).Benchmark queries
mastermaster(._;>>;)out metaout geom, small boxout geom, large boxQueries q01–q12
[out:csv(::count)]; nwr[amenity=restaurant]; out count;[out:csv(::count)]; node[natural=peak]; out count;[out:csv(::count)]; node(44.60,-63.66,44.70,-63.52); out count;[out:csv(::count)]; way[highway](44.60,-63.66,44.70,-63.52); out count;[out:csv(::count)]; way[highway=motorway]; (._;>;); out count;[out:csv(::count)]; node[amenity=cafe](44.60,-63.66,44.70,-63.52); node(around:300)[shop]; out count;[out:csv(::count)]; rel[boundary=administrative][admin_level=4][name="Nova Scotia"]; (._;>>;); out count;[out:xml]; nwr[amenity](44.60,-63.66,44.70,-63.52); out meta;[out:json]; way[building](44.640,-63.585,44.655,-63.565); out geom;[out:json]; way[highway](44.60,-63.66,44.70,-63.52); out geom;[out:csv(::count)]; node[highway=traffic_signals](44.60,-63.66,44.70,-63.52); way(bn); rel(bw); out count;[out:xml]; nwr(44.640,-63.590,44.655,-63.570); (._;>;); out meta;Area queries
mastermasteris_infor cafésQueries a1–a4
[out:csv(::count)]; area[name="Halifax"][admin_level=8]->.a; node[amenity=cafe](area.a); out count;[out:csv(::count)]; area[name="Halifax"][admin_level=8]->.a; way[highway](area.a); out count;[out:csv(::count)]; area[name="Halifax Regional Municipality"]->.a; way[building](area.a); out count;[out:csv(::count)]; node[amenity=cafe](44.60,-63.66,44.70,-63.52); is_in; out count;w1 is
[out:csv(::count)]; way[leisure=park](44.60,-63.66,44.70,-63.52)->.p; way[highway](area.p); out count;and w2 is[out:csv(::count)]; way[landuse=residential](44.60,-63.66,44.70,-63.52)->.r; way[building](area.r); out count;.Client-tool queries
Built from the templates of overpass turbo, JOSM, QGIS QuickOSM, osmnx, osmdata and MapComplete, filled in for Halifax, on the area database.
mastermasterQueries t01–t11
node[amenity=drinking_water](viewport); out;[out:json][timeout:25]; area(id:3609092218)->.searchArea; nwr["amenity"="restaurant"](area.searchArea); out geom;[out:json][timeout:25]; nwr["shop"](city bbox); out geom;[out:json]; (relation[route=bicycle](city bbox); way[highway=cycleway](city bbox); way[highway=path][bicycle=designated](city bbox);); out body; >; out skel qt;[out:xml]; (node(viewport); <;); (._;>;); out meta;[out:xml][timeout:90][bbox:city bbox]; (nwr["shop"];); (._;>;); out meta;[out:xml] [timeout:25]; area(3609092218) -> .area_0; (node["amenity"="restaurant"](area.area_0); way["amenity"="restaurant"](area.area_0); relation["amenity"="restaurant"](area.area_0);); (._;>;); out body;[out:json][timeout:180];(way["highway"]["area"!~"yes"]["access"!~"private"]["highway"!~"<highway list>"]["motor_vehicle"!~"no"]["motorcar"!~"no"]["service"!~"<service list>"](poly:'<Halifax boundary>');>;);out;[out:json][timeout:180];((node['amenity'='restaurant'](poly:'<Halifax boundary>');(._;>;););(way['amenity'='restaurant'](poly:'<Halifax boundary>');(._;>;););(relation['amenity'='restaurant'](poly:'<Halifax boundary>');(._;>;););out;[out:xml][timeout:25]; (node ["amenity"="restaurant"] (city bbox); way ["amenity"="restaurant"] (city bbox); relation ["amenity"="restaurant"] (city bbox);); (._;>;); out body;[out:json][timeout:30][bbox:44.6400,-63.5875,44.6560,-63.5575];(nwr["amenity"="bench"];nwr["leisure"="playground"];nwr["amenity"="waste_basket"];);out body;out meta;>;out skel qt;44.6440,-63.5800,44.6520,-63.5650; city bbox is44.5812,-63.7227,44.7112,-63.5427, the bounding box of Halifax (relation 9092218, area id 3609092218).<Halifax boundary>is the outer ring of relation 9092218 from the public extract: 1,041 points aslat lonpairs.<highway list>isabandoned|bridleway|bus_guideway|construction|corridor|cycleway|elevator|escalator|footway|no|path|pedestrian|planned|platform|proposed|raceway|razed|rest_area|service|services|steps|track;<service list>isalley|driveway|emergency_access|parking|parking_aisle|private.Point-of-interest queries
bench/queries-poi/: shaped like the heaviest query templates on the public servers (#159), on the area database.mastermaster,i, in a boxout center tagsout geom,iout geomout centerPeak memory rises on the unions of statements that read the same blocks (p01, p04–p06, p08, p09, and t04 and t11 above): commit 67 keeps their decompressed blocks while the union runs, up to a quarter of
[maxsize:](128 MiB by default). Other queries keep nothing.Queries p01–p10
[out:json][timeout:300]; (node["amenity"="fuel"]; way["amenity"="fuel"]; ); out center tags;[out:json][timeout:90]; (way["maxspeed"]["highway"="primary"](43.3,-66.5,47.1,-59.6); way["bridge"]["maxspeed"](43.3,-66.5,47.1,-59.6); way["tunnel"](43.3,-66.5,47.1,-59.6); node["maxheight"](43.3,-66.5,47.1,-59.6); ); out center;[out:json][timeout:30]; area["name"="Nova Scotia"]["admin_level"="4"]->.p; (way["boundary"="administrative"]["admin_level"="6"](area.p); relation["boundary"="administrative"]["admin_level"="6"](area.p); ); out geom;[out:json][timeout:420]; (node["amenity"="fuel"](43.3,-66.5,47.1,-59.6); way["amenity"="fuel"](43.3,-66.5,47.1,-59.6); ); out center;History queries
mastermaster[diff:]on a boxneweron a province-sized boxout metaQueries h1–h6
[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; nwr[amenity](44.60,-63.66,44.70,-63.52); out count;[diff:"2026-11-12T00:00:00Z","2026-11-19T00:00:00Z"]; nwr(44.60,-63.66,44.70,-63.52); out meta;[out:csv(::count)]; nwr(newer:"2026-11-08T00:00:00Z")(43.3,-66.5,47.1,-59.6); out count;[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; way[highway=primary](44.60,-63.66,44.70,-63.52); (._;>;); out count;nwr(uid:{{UID}})(44.60,-63.66,44.70,-63.52); out meta;[out:csv(::count)]; nwr(uid_touched:{{UID}})(44.60,-63.66,44.70,-63.52); out count;{{UID}}is the user id with the most current objects in the box. It comes from licensed data, so it isn't given.Prompting queries
The queries that prompted individual changes.
mastermasteraround282 waysaroundnodes and ways within 1 kmaroundevery way in a downtown boxarounda set reaching a national boundary,[timeout:10]aroundprovince-long routesaroundat a past date, after a date filter left empty index entriespoly:>at a past dateQueries A–S
[out:csv(::count)]; way(around:250,44.679085,-63.511161)->.s0; way(around.s0:100); out count;[out:csv(::count)]; nw(around:1000,44.790135,-65.396762)->.s0; way(around.s0:100)["width"!="1"]; out count;[out:csv(::count)]; way(44.648535,-63.573386,44.662526,-63.528647)->.s0; way(around.s0:100)["created_by"!~"^JO"]; out count;[timeout:10][out:csv(::count)]; rel(id:5429184,7081003,8322255,9270031,10270951,13448043)->.s0; .s0 <<->.s2; way(around.s2:0)[!"height"]; out count;(without a time limit: the same without[timeout:10])[out:csv(::count)]; rel(45.566265,-62.428420,45.586924,-62.388716)->.s0; node(around.s0:0)["footway"]; out count;[out:csv(::id,::lat,::lon)]; node(44.60,-63.66,44.70,-63.52); out;[out:csv(::count)]; way(44.60,-63.66,44.70,-63.52); out count;[out:json]; way[building](44.60,-63.66,44.70,-63.52); out tags;[out:csv(::count)]; wr(newer:"2016-12-19T18:03:25Z")(45.574002,-62.284014,45.619842,-62.234392)->.s0; way(around.s0:20)["material"!~"^conc"]; out count;[out:csv(::count)]; rel(45.566265,-62.428420,45.586924,-62.388716)->.s0; node(around.s0:0); out count;[out:csv(::count)]; way(43.3,-66.5,47.1,-59.6)(newer:"2026-11-08T00:00:00Z"); out count;[out:csv(::count)]; node[amenity=cafe](44.64,-63.60,44.66,-63.56)->.c; foreach.c->.it { nwr(around.it:100)(uid_touched:{{UID}}); out count; }[out:csv(::count)][date:"2013-08-30T00:17:55Z"]; wr(around:50,44.943655,-65.061855)->.s0; way(around.s0:0)["noexit"!~"^y"]; out count;[out:csv(::count)];node["amenity"](poly:'<Halifax boundary>');out count;[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; rel[route=hiking]; (._;>;); out count;[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; rel(45.566265,-62.428420,45.586924,-62.388716)->.s0; node(around.s0:0)["footway"]; out count;{{UID}}and<Halifax boundary>are as defined above.Large result sets
One run per build.
mastermasterQueries R1–R21, P1, P2
[out:csv(::count)]; way(42,-67.6,47.5,-58); out count;[out:json]; way[highway]; out geom;[out:xml]; rel(42,-67.6,47.5,-58); out body;[out:json]; nwr[name]; out center;[out:csv(::count)]; node(42,-67.6,47.5,-58); out count;[out:csv(::count)]; node(44.4,-64.0,45.0,-63.0); node(around:5)[amenity]; out count;[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; node(42,-67.6,47.5,-58); out count;[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; node(44.4,-64.0,45.0,-63.0); node(around:5)[amenity]; out count;[date:"2018-01-01T00:00:00Z"][out:json]; way[highway]; out geom;[date:"2018-01-01T00:00:00Z"][out:json]; nwr[name]; out center;[date:"2020-01-01T00:00:00Z"][out:csv(::count)]; nwr(newer:"2019-06-01T00:00:00Z")(43.3,-66.5,47.1,-59.6); out count;[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; way(42,-67.6,47.5,-58); out count;[date:"2018-01-01T00:00:00Z"][out:xml]; rel(42,-67.6,47.5,-58); out body;[out:csv(::count)]; node(id:834791230,904610765)(changed:"2010-10-25T12:15:57Z"); out count;[out:csv(::count)]; node["amenity"="cafe"](changed:"2010-10-25T12:15:57Z"); out count;[out:csv(::count)]; way(id:24000000,25000000,26000000)(changed:"2010-10-25T12:15:57Z"); out count;[date:"2012-01-01T00:00:00Z"][out:csv(::id;false)]; node(42,-67.6,47.5,-58); out ids;[date:"2021-03-01T00:00:00Z"][out:csv(::id;false)]; node(42,-67.6,47.5,-58); out ids;[date:"2018-01-01T00:00:00Z"][out:xml]; node(42,-67.6,47.5,-58); out;[out:csv(::id;false)]; node(42,-67.6,47.5,-58); out ids;[out:xml]; node(42,-67.6,47.5,-58); out;New structures are bounded. The id filter is at most 16 MiB per predicate, the
aroundgrid at most 64 cells per entry, and the block cache a quarter of[maxsize:]. The kept touched-id lists hold one id per touched object;masteralready holds two such lists at once. Like the existing auxiliary structures, they don't count toward[maxsize:]; counting them would change which queries fail.Not on this branch: mimalloc
Preloading mimalloc instead of glibc's
mallocis a deployment choice, not a code change, so it's kept off this branch. On an earlier state of all-changes, it saved about 6% more CPU on the plain and area sets and about 11% on the history set (#35). It wasn't re-measured for this update.Testing
masterand all-changes.wr(bn...)queries that commit 75 fixes (masterreturned 0 ways where all-changes returns 13,759, or failed with "Filters too weak").fuzz(6,000 queries) andhistory(2,000) find no differences apart from commit 75'swr(bn...)fix: with fuzz.py, props.py: accept wr(bn...) differences that match the baseline's way + relation answer #245's tools, 49 such queries all equalmaster's answer to the same statement written aswayplusrel. With fuzz.py, props.py: accept wr(bn...) differences that match the baseline's way + relation answer #245 merged intobench-tools,fuzz,historyandpropsall pass on this tip.Limitations
[maxsize:].around's ranges exceed 65,536 node tiles. Commit 34's tighter ranges can fall under that, which is a loss for a very selective tag at a past date (S). Over 118 generated past-datearoundqueries, commits 34 and 35 still cut total CPU by 46%. Details are in around: take candidate ranges for relation inputs from their members #38.https://claude.ai/code/session_01736kJUqyDw9zM3Bkh2W2QT
https://claude.ai/code/session_01736kJTiuJPoCWZs7RtFYjm
Generated by Claude Code