On enwiki (at least), there are many rows on querycache with qc_type = '' (10,000)
This feels like a bug
I'm not sure if it's worth creating a maintenance script (and run it in the updater)... I'm guessing if it's an issue on WMF wikis, it's an issue on other non WMF wikis too
mysql:wikiadmin@db1083 [enwiki]> select * from querycache where qc_type = '' LIMIT 10; +---------+----------+--------------+---------------------+ | qc_type | qc_value | qc_namespace | qc_title | +---------+----------+--------------+---------------------+ | | 0 | 0 | ! | | | 0 | 0 | !! | | | 0 | 0 | !'O-!khung_language | | | 0 | 0 | != | | | 0 | 0 | !? | | | 0 | 0 | !?_(chess) | | | 0 | 0 | !Gã!ne_language | | | 0 | 0 | !Gã!nge_language | | | 0 | 0 | !Hu_language | | | 0 | 0 | !Hukwe_language | +---------+----------+--------------+---------------------+ 10 rows in set (0.00 sec)
Other stuff...
'qc_type NOT IN ' . implode( ', ', array_map( function($a) { return $a[1]; }, QueryPage::getPages() ) )
^ to get rid of any old querycache rows. Which, will also do qc_type = '' too. Yay. We can do the same delete on querycachetwo and querycache_info for completeness