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

User directory rebuild spends too long calculating progress #15457

@reivilibre

Description

@reivilibre

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).

Metadata

Metadata

Assignees

Labels

T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions