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

User directory rebuild spends too long calculating progress #15457

Closed
reivilibre opened this issue Apr 18, 2023 · 1 comment
Closed

User directory rebuild spends too long calculating progress #15457

reivilibre opened this issue Apr 18, 2023 · 1 comment
Assignees
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@reivilibre
Copy link
Contributor

On matrix.org we have this applied:

-            txn.execute("SELECT COUNT(*) FROM " + TEMP_TABLE + "_rooms")
-            result = txn.fetchone()
-            assert result is not None
-            progress["remaining"] = result[0]
+            #txn.execute("SELECT COUNT(*) FROM " + TEMP_TABLE + "_rooms")
+            #result = txn.fetchone()
+            #assert result is not None
+            #progress["remaining"] = result[0]

because the SELECT COUNT(*) involves a table scan. We should either skip this or do something smarter (incrementally update number OR use the postgres stats tables for a cheap size estimate).

@reivilibre reivilibre added the T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. label Apr 18, 2023
@reivilibre reivilibre self-assigned this Apr 18, 2023
@reivilibre
Copy link
Contributor Author

woops, this was fine and made it into #15435

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

1 participant