Page MenuHomePhabricator

Uncacheable queries
Closed, InvalidPublic


MediaWiki 1.28.2 (664b1b4), HHVM 3.21.0 (srv), MariaDB 10.2.8-MariaDB-10.2.8+maria~zesty-log, ICU 57.1, LuaSandbox 2.0.13-alpha, Lua 5.1.5.

My slow queries log is full of queries issued mainly by diverse special pages that are not cached in MySQL query cache because they begin from SET rather than SEL.

Are those SET timestamps at all necessary and can they be switched off by some MediaWiki setting?

SET timestamp=1504075093;
SELECT /* SpecialWhatLinksHere::showIndirectLinks  */  page_id,page_namespace,page_title,rd_from,page_is_redirect  FROM (SELECT  /*! STRAIGHT_JOIN */ pl_from,rd_from  FROM `pagelinks` LEFT JOIN `redirect` ON ((rd_from = pl_from) AND rd_title = 'Рабы_немы' AND (rd_interwiki = '' OR rd_interwiki IS NULL) AND rd_namespace = '0') INNER JOIN `page` ON ((pl_from = page_id))   WHERE pl_namespace = '0' AND pl_title = 'Рабы_немы'  ORDER BY pl_from LIMIT 102  ) `temp_backlink_range` INNER JOIN `page` ON ((pl_from = page_id))    ORDER BY page_id LIMIT 51;

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 30 2017, 7:01 AM
alex-mashin updated the task description. (Show Details)Aug 30 2017, 12:58 PM

@alex-mashin These SET statements do not come from MediaWiki. They are internally prepended to the log. I'm not sure exactly during which part of the logging process, but I am fairly certain MySQL's slowquery log does not reject entries starting with SEL or anything like that.

If these queries are logged as slow, it is because they select query is slow. The SET is presumably just for logging purposes.

Further reading:

Krinkle closed this task as Invalid.Sep 28 2017, 11:45 PM

Thank you, now I know that those queries could be cached in spite of the initial SET; that was my concern.

As to their slowness, there was another reason to that: unused (evidently, broken) index on page table.