You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Down recursion at past dates reads node blocks twice when the input has relations #94
Down recursion (>) over relations collects the relations' node members and the ways' nodes in two separate passes over the node blocks. #18 merged them into one pass for current data only. At a past date ([date:], or the old side of [diff:]), each pass still reads the current and attic node files, plus the current and attic node metadata that attic queries use to check versions.
Block reads (one LZ4 block each, counted by tracing mmap), Nova Scotia history database, built with #18 applied:
[date:"2018-01-01T00:00:00Z"][out:csv(::count)]; rel[route=hiking]; (._;>;); out count;
File
Reads
Distinct blocks
nodes.bin
914
460
nodes_attic.bin
638
320
Relation node members are usually few, but they're spread out. The relations' pass alone reads 773 node blocks and 1,640 node metadata blocks for this query, and costs about 0.6 s of 1.7 s.
>> at a past date already reads each node block once. A query with only ways as input (way[highway=primary](44.60,-63.66,44.70,-63.52); (._;>;);) still reads node blocks twice at a date, but that's the bounding-box filter reading way geometry and then > reading the same nodes. That's a separate cost between statements, not this one.
Fix
Use the merged pass (relation_and_way_node_members, which already handles attic objects) for dates too.
Activity