I don't have it handy but category membership counts are stored in the db use that instead of a count()<span></span><br><br>On Tuesday, March 8, 2016, Huji Lee <<a href="mailto:huji.huji@gmail.com">huji.huji@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">I am trying to find a list of those categories on EN WP that are highly used (more than 100 subpages or subcats) but don't have a counterpart in FA WP. The query I used is shown below and also on <a href="https://quarry.wmflabs.org/query/7943" target="_blank">https://quarry.wmflabs.org/query/7943</a> and is extremely slow.<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Any thoughts on how to make it more efficient?<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br><span style="font-family:monospace,monospace">select page_title, ll_title, count(cl_to) as CNT<br>from page<br>left join langlinks<br>on ll_from = page_id<br>and ll_lang = 'fa'<br>join categorylinks<br>on page_title = cl_to<br>where page_namespace = 14<br>and ll_from is null<br>group by cl_to, ll_title<br>having CNT > 100<br>order by CNT desc;<br><br></span><br></div></div>
</blockquote>