mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-12-06 21:24:08 +00:00
* Seek region and message pages from their window, drop the slow pool * Bound typed and scoped region pages and message since pages, migration 059 * Count the late rows in the zero-hit type pair read bound * Cap typed window ranges, broader bounded cmi verification
10 lines
869 B
SQL
10 lines
869 B
SQL
-- Copyright 2026 Beacon Contributors
|
|
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
-- Region pages with since stop each site at since - 30 minutes; a packet heard at a site more than 30 minutes before
|
|
-- it was first heard is the only kind below that which can still be first heard at or after since. Ingest clamps
|
|
-- hearing times to 30 minutes of its own clock, and first_heard_at comes from the database clock, so the index stays
|
|
-- about empty while the two clocks agree. Region pages read its rows at a site in full (no LIMIT): they count on
|
|
-- that, and only cost more, never answer differently, if the clocks drift apart.
|
|
CREATE INDEX CONCURRENTLY idx_packet_sites_early ON packet_sites USING btree (iata, first_heard_at) INCLUDE (site_heard_at, packet_hash, payload_type, route_type, scope_id) WHERE ((first_heard_at - site_heard_at) > '00:30:00'::interval);
|