0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-06-01 10:18:54 +02:00
synapse/synapse/storage/schema/main/delta/84/01_auth_links_stats.sql.postgres
2024-01-24 13:57:12 +00:00

21 lines
932 B
Plaintext

--
-- This file is licensed under the Affero General Public License (AGPL) version 3.
--
-- Copyright (C) 2023 New Vector, Ltd
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as
-- published by the Free Software Foundation, either version 3 of the
-- License, or (at your option) any later version.
--
-- See the GNU Affero General Public License for more details:
-- <https://www.gnu.org/licenses/agpl-3.0.html>.
-- Force the statistics for these tables to show that the number of distinct
-- chain IDs are proportional to the total rows, as postgres has trouble
-- figuring that out by itself.
ALTER TABLE event_auth_chain_links ALTER origin_chain_id SET (n_distinct = -0.5);
ALTER TABLE event_auth_chain_links ALTER target_chain_id SET (n_distinct = -0.5);
-- We should have done an `ANALYZE event_auth_chain_links` here, but we forgot.