Description
The filters implemented as part of T382140: Provide an API to filter functions by input/output types which can return functions usable by the prototype require complex queries joining the tables:
- wikilambda_zobject_labels
- wikilambda_zobject_join
- page
On a production environment with more than 2000 functions, it becomes necessary to carefully provide the necessary indexes to filter, join and group and order by.
Performance improvements needed:
- On wikilambda_zobject_labels:
- Add index on wlzl_zobject_zid: used for JOIN and WHERE
- Add composite index on wlzl_language and wlzl_label_primary: used for ORDER BY priority
- Add index on wlzl_type: used for WHERE (already covered by existing indexes)
- Add index on wlzl_label_normalised: used for LIKE (already covered by existing indexes)
- On wikilambda_zobject_join:
- Add index on wlzo_main_zid: used for GRUP BY and FILTER (already covered by existing indexes)
- Add composite index on wlzo_key and wlzo_related_zobject: used for JOIN and WHERE (already covered by existing indexes)
- Add index on wlzo_main_type: used for WHERE
- On page:
- use page_namespace instead of page_content_model, as it is already indexed and it contains the necessary data for our usecase
Follow schema change process as detailed in https://wikitech.wikimedia.org/wiki/Schema_changes
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist