This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Re-apply making thread_id required in push rules tables #15359
Labels
A-Threads
Threaded messages
O-Uncommon
Most users are unlikely to come across this or unexpected workflow
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Task
Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
The migration
synapse/storage/schema/main/delta/74/03thread_notifications_not_null.sql.postgres
from #15350 took too long and caused a small outage on Matrix.org.I've reverted it for now
We believe the statement doing this is one or both of the
ALTER TABLE
statements.I hoped #15357 might fix it, but the Postgres docs don't mention it as a valid technique to improve performance and my testing shows the addition of the constraint takes the same amount of time without regard for the presence of the index, definitely not negligible.
The way forward is probably to add a
NOT VALID
constraint, which is enforced immediately for new rows, and then do aVALIDATE CONSTRAINT
in the background. It's a shame we didn't know about this earlier since this could have been started ages ago, but ah well — as they say, the next best time is now.— postgresql.org/docs/15/sql-altertable.html
The text was updated successfully, but these errors were encountered: