Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Limit the number of devices we delete at once#14649

Merged
erikjohnston merged 3 commits into
developfrom
erikj/prune_devices
Dec 9, 2022
Merged

Limit the number of devices we delete at once#14649
erikjohnston merged 3 commits into
developfrom
erikj/prune_devices

Conversation

@erikjohnston
Copy link
Copy Markdown
Member

Follow on from #14595

@erikjohnston erikjohnston marked this pull request as ready for review December 9, 2022 11:23
@erikjohnston erikjohnston requested a review from a team as a code owner December 9, 2022 11:23
Comment on lines -1617 to +1621
SELECT DISTINCT device_id FROM devices
SELECT device_id FROM devices
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no longer DISTINCT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, presumably (user_id, device_id) is already unique

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was pointless mostly, as there are unique indexes on user_id / device_id

@erikjohnston erikjohnston enabled auto-merge (squash) December 9, 2022 11:30
Comment thread synapse/storage/databases/main/devices.py
@erikjohnston erikjohnston disabled auto-merge December 9, 2022 13:31
@erikjohnston erikjohnston merged commit 94bc21e into develop Dec 9, 2022
@erikjohnston erikjohnston deleted the erikj/prune_devices branch December 9, 2022 13:31
reivilibre added a commit that referenced this pull request Dec 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants