Page MenuHomePhabricator

ApiQueryPagePropNames is extremely slow on Wikidata
Closed, DuplicatePublic

Description

This is one of the top slow queries in tenderil:

155	324	50	7,873	db2059	wikiuser	wikidatawiki

SELECT /* ApiQueryPagePropNames::execute */ DISTINCT pp_propname FROM page_props ORDER BY pp_propname LIMIT 501 /* eca54e37324ba61f23cd87946fe72863 db2059 wikidatawiki 29s */

Query plan:

mysql:wikiadmin@db2052 [wikidatawiki]> EXPLAIN SELECT /* ApiQueryPagePropNames::execute */ DISTINCT pp_propname FROM `page_props` ORDER BY pp_propname LIMIT 501;
+------+-------------+------------+-------+---------------+------------------+---------+------+----------+-------------+
| id   | select_type | table      | type  | possible_keys | key              | key_len | ref  | rows     | Extra       |
+------+-------------+------------+-------+---------------+------------------+---------+------+----------+-------------+
|    1 | SIMPLE      | page_props | index | NULL          | pp_propname_page | 66      | NULL | 59183780 | Using index |
+------+-------------+------------+-------+---------------+------------------+---------+------+----------+-------------+
1 row in set (0.00 sec)

Event Timeline

Ladsgroup renamed this task from Add index on pp_propname to ApiQueryPagePropNames is extremely slow on Wikidata.Apr 24 2017, 7:43 AM
Ladsgroup updated the task description. (Show Details)
Ladsgroup updated the task description. (Show Details)
Ladsgroup removed a project: Schema-change.
Ladsgroup updated the task description. (Show Details)

Please, before creating new tickets about slow queries, make sure you mention it on the ongoing discussion at T163495. I am not saying you should not create the tickets, I am saying please link and coordinate there with the other people looking at those queries. Overquerying also creates regressions on other queries AND maintenance, so it has to be agreed between several people it is worth maintaining.

In particular, this is a duplicate of T115825