refactor(db): normalize asn prefix cache and ttl cleanup
Строки asn_prefix_cache_row; периодический prune через evobgp-ingest. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE asn_prefix_cache ADD COLUMN prefixes_json JSONB NOT NULL DEFAULT '[]';
|
||||
|
||||
UPDATE asn_prefix_cache apc
|
||||
SET prefixes_json = COALESCE((
|
||||
SELECT jsonb_agg(apcr.prefix::text ORDER BY apcr.prefix::text)
|
||||
FROM asn_prefix_cache_row apcr
|
||||
WHERE apcr.asn = apc.asn
|
||||
), '[]'::jsonb);
|
||||
|
||||
DROP TABLE IF EXISTS asn_prefix_cache_row;
|
||||
Reference in New Issue
Block a user