Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run ANALYZE after fiddling with stats #16849

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/16849.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix database performance regression due to changing Postgres table statistics. Introduced in v1.100.0rc1.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
-- 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--
-- 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>.

-- We need to do an ANALYZE after `01_auth_links_stats.sql.postgres`, where we
-- fiddled with the stats.
ANALYZE event_auth_chain_links;
Loading