Reporting a slow-running query that is I suspect due to faulty/missing database table statistics.
tools.tb-dev@tools-bastion-01:~/public_html/RLRL$ mysql -h cawiki.labsdb MariaDB [(none)]> use p50380g50491__rlrl_cawiki_p; MariaDB [p50380g50491__rlrl_cawiki_p]> SELECT sug_orig_ns, sug_orig, sug_new_ns, sug_new FROM p50380g50491__rlrl_cawiki_p.suggestions s WHERE NOT EXISTS ( SELECT 1 FROM cawiki_p.pagelinks INNER JOIN cawiki_p.page ON pl_from = page_id WHERE pl_namespace = s.sug_orig_ns AND pl_title = s.sug_orig AND page_namespace in (0, 10, 14) AND page_title NOT LIKE '%/sandbox' AND page_title NOT LIKE '%/testcases' ) AND s.sug_status > 0;
The plan generated for this query is rather odd:
1 | PRIMARY | s | ALL | NULL | NULL | NULL | NULL | 3599 | Using where |
2 | MATERIALIZED | pagelinks | index | pl_from,pl_namespace,pl_backlinks_namespace | pl_namespace | 265 | NULL | 48688676 | Using index |
2 | MATERIALIZED | page | eq_ref | PRIMARY,name_title,page_random,page_len,page_redirect_namespace_en | PRIMARY | 4 | cawiki.pagelinks.pl_from | 1 | Using where |