Repository navigation
Conversation
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
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.
Stacked on #167 (
block-cache): it narrows the files that PR's cache keeps. The tables compare against #167's branch.Fixes #252.
Change
Nonsynced_Transaction::data_index(template_db/transaction.h) no longer attaches the block cache to data files whose name ends in_tags_global.One file, 9 lines added, 1 removed. No change to the database format, the query API or the results.
Impact
Mostly memory. US northeast full-history extract (Geofabrik), warm cache, 4-core VM. Builds alternate; peak RSS and median user+sys CPU of 3 runs. Base is #167's branch (47de27f). The queries: the 1° × 1° maxheight query from #242 in three boxes and their 0.99999° versions, and the 20 heaviest query templates on the public servers in June 2026, moved to Boston and New England coordinates (p01–p20).
Peak memory falls where a union looks tags up in the global index: the empty and sparse boxes, p02, p17, p20. CPU moves within noise overall. On
all-changeswith #243 and #247, where the copies are a larger share, instruction counts fall 3.0% for dense_1 and 3.6% for p02, and no query's count rises.Queries
dense_1:
sparse_1:
empty_1:
The 0.99999° versions shrink each box's north and east edges by 0.00001°. p01 is dense_1.
p01 (maxheight bbox1deg)
p02 (amenities around union)
p03 (admin in area)
p04 (brands bbox ci)
p05 (global data center)
p06 (food around regex)
p07 (global seamark recurse)
p08 (global cameras)
p09 (3d buildings bbox)
p10 (tourism around25k)
p11 (brownfield bigbbox)
p12 (clinic name ci around25k)
p13 (map call meta)
p14 (area by name worship)
p15 (tiny bbox many keys geom)
p16 (hgv restrictions bbox)
p17 (anchored regex around)
p18 (fuel bigbbox)
p19 (venues bbox name ci)
p20 (office around25k)
Testing
workflow_dispatch), since the fuzz, history and props workflows run on pull requests only againstmaster.Limitations and open questions
File_Propertieswould be cleaner, at the cost of touching every file definition.Generated by Claude Code