Page MenuHomePhabricator

Wikibase\EntityPerPageTable::getItemsWithoutSitelinks slow query with large LIMIT offset
Closed, ResolvedPublic

Description

This query form appears in the slow log for wikidatawiki on WMF S5:

SELECT /* Wikibase\EntityPerPageTable::getItemsWithoutSitelinks ? */ epp_entity_id AS entity_id FROM `wb_entity_per_page` LEFT JOIN `wb_items_per_site` ON ((ips_item_id = epp_entity_id)) WHERE (ips_site_page IS NULL) AND epp_entity_type = 'item' ORDER BY epp_page_id DESC LIMIT 1940000, 51;

Offset 1940000... wow! :-)

Can we cap the possible limit offset, or handle pagination differently?

Details

Reference
bz65333

Related Objects

StatusSubtypeAssignedTask
ResolvedLadsgroup
ResolvedLadsgroup
Resolved adrianheine
Resolveddaniel
ResolvedLadsgroup
ResolvedLadsgroup
ResolvedLadsgroup
Resolvedhoo
Resolvedhoo
Resolvedhoo
Resolvedhoo
DeclinedNone
ResolvedLydia_Pintscher
ResolvedNone
ResolvedWMDE-leszek
DeclinedNone
DeclinedNone
DeclinedNone
ResolvedLadsgroup
Resolvedaude
ResolvedMarostegui
ResolvedLadsgroup
ResolvedAndrew
ResolvedLadsgroup
Resolvedaude
ResolvedLadsgroup
ResolvedLadsgroup
ResolvedLadsgroup
ResolvedMarostegui
ResolvedAndrew

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:11 AM
bzimport set Reference to bz65333.
bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
SELECT page_id, page_title FROM page_props INNER JOIN page ON page_id = pp_page WHERE pp_propname = 'wb-sitelinks' AND pp_sortkey = 0;
Addshore assigned this task to Ladsgroup.
Addshore subscribed.

The entity per page table is gone (see T95685) so this task / issue can be resolved.