HomePhabricator

Use estimateRowCount() instead of actually counting everything
7d0a72b155e3Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Use estimateRowCount() instead of actually counting everything

On large wikis with lots of lint errors, counting the entire table can
be problematic from a performance perspective, sometimes taking minutes.

Instead, use Database::estimateRowCount(), which uses EXPLAIN SELECT
COUNT(*) to get an approximate value for the number of rows. We do make
sure that if the category actually has no rows, that it will return 0.

This should be considered a temporary solution, and we should look into
doing something like the SiteStats incremental updates table in the long
run.

Bug: T184280
Change-Id: I2d4dcc615477fd60e41dfed4a3d1a3ad52a9f4af

Details

Provenance
LegoktmAuthored on Feb 1 2018, 8:59 PM
Parents
rELINT7ba5f25eeb3c: Localisation updates from https://translatewiki.net.
Branches
Unknown
Tags
Unknown
References
refs/changes/11/407511/1
ChangeId
I2d4dcc615477fd60e41dfed4a3d1a3ad52a9f4af