mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
The converted CDClient had no indexes, so each lazy lookup scanned its table (ComponentsRegistry: about 51000 rows, 3.5 ms a query; 0.09 ms with the index). Loading a player with a large inventory spent up to a minute of the world's main loop in these scans, leaving the client at 35%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
801 B
SQL
10 lines
801 B
SQL
-- The converted CDClient has no indexes, so every lazy lookup by id scans its whole table (ComponentsRegistry: about
|
|
-- 51000 rows, 3.5 ms a query). Loading a player with a big inventory did thousands of them on the world's main loop.
|
|
CREATE INDEX IF NOT EXISTS idx_ComponentsRegistry_id ON ComponentsRegistry (id);
|
|
CREATE INDEX IF NOT EXISTS idx_ItemComponent_id ON ItemComponent (id);
|
|
CREATE INDEX IF NOT EXISTS idx_Objects_id ON Objects (id);
|
|
CREATE INDEX IF NOT EXISTS idx_LootMatrix_LootMatrixIndex ON LootMatrix (LootMatrixIndex);
|
|
CREATE INDEX IF NOT EXISTS idx_LootTable_LootTableIndex ON LootTable (LootTableIndex);
|
|
CREATE INDEX IF NOT EXISTS idx_PlayerFlags_id ON PlayerFlags (id);
|
|
CREATE INDEX IF NOT EXISTS idx_Animations_animationGroupID ON Animations (animationGroupID, animation_type);
|