mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-22 03:25:56 +00:00
Registry: GET /registry/v2/realms (keyset cursors, bounded filters and sorts, indexes per sort,
ETag and a short server-side cache, per-address limit) and /realms/{id}; migrations 3 and 4.
Manager: Servers page (table, filters, sortable columns, detail drawer, module tooltips from the
local catalog, players and bots apart, ping unknown), compatibility of the chosen character with
an advertised realm through the Phase 7/8 rules.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
8 lines
1004 B
SQL
8 lines
1004 B
SQL
-- Registry schema, migration 3 (the public list). Forward-only. One partial index per sort, over exactly the rows a public list can show
|
|
-- (published, protocol 2) and exactly the expressions the list sorts by, so that a page is an index range scan with a LIMIT even with many thousands of realms.
|
|
CREATE INDEX realms_browse_name ON realms ((lower(display_name)), realm_id) WHERE published AND advert_version = 2;
|
|
CREATE INDEX realms_browse_players ON realms ((COALESCE(players, 0)::bigint), realm_id) WHERE published AND advert_version = 2;
|
|
CREATE INDEX realms_browse_cap ON realms ((COALESCE(level_cap, 0)::bigint), realm_id) WHERE published AND advert_version = 2;
|
|
CREATE INDEX realms_browse_created ON realms (created_at, realm_id) WHERE published AND advert_version = 2;
|
|
CREATE INDEX realms_browse_modules ON realms USING gin (modules jsonb_path_ops) WHERE published AND advert_version = 2;
|