Sample the prefix-length pages with bounded lookups, each prefix once (closes #66)
check / check (push) Waiting to run
check / check (push) Waiting to run
/prefixlength/{length} and /prefixlength6/{length} grouped every live route
of that length by prefix, shuffled all the prefixes and joined the routes
back, so a request grew with the number of routes and listed a prefix once
for each peer that shared its newest time.
Now the first 5001 prefixes of that length are read, one index search each.
With at most 5000, the page lists 500 of them, shuffled; otherwise random
row-id lookups on the mask length index pick them, at most four per prefix
asked for, filled up from the shuffled ones. Each prefix is shown once, with
its newest route, found in one search of a new prefix and last_updated index
that replaces the prefix-only one.
Model: opus-5-5
This commit is contained in:
@@ -124,7 +124,8 @@ CREATE TABLE IF NOT EXISTS live_routes_v6 (
|
||||
);
|
||||
|
||||
-- Indexes for live_routes_v4 table
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v4_prefix ON live_routes_v4(prefix);
|
||||
-- Finds a prefix's newest route in one search, whatever the number of peers.
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v4_prefix_last_updated ON live_routes_v4(prefix, last_updated);
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v4_mask_length ON live_routes_v4(mask_length);
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v4_origin_asn ON live_routes_v4(origin_asn);
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v4_last_updated ON live_routes_v4(last_updated);
|
||||
@@ -132,7 +133,8 @@ CREATE INDEX IF NOT EXISTS idx_live_routes_v4_last_updated ON live_routes_v4(las
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v4_mask_prefix ON live_routes_v4(mask_length, prefix);
|
||||
|
||||
-- Indexes for live_routes_v6 table
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v6_prefix ON live_routes_v6(prefix);
|
||||
-- Finds a prefix's newest route in one search, whatever the number of peers.
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v6_prefix_last_updated ON live_routes_v6(prefix, last_updated);
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v6_mask_length ON live_routes_v6(mask_length);
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v6_origin_asn ON live_routes_v6(origin_asn);
|
||||
CREATE INDEX IF NOT EXISTS idx_live_routes_v6_last_updated ON live_routes_v6(last_updated);
|
||||
|
||||
Reference in New Issue
Block a user