matthiasmullie added a comment.

  > If you want to count //pages//, then you are only looking at the current 
revision, right? And the current revision of a page is by definition never 
deleted/suppressed. So no need to check rev_deleted.
  
  So page_latest can never point to a revdel'ed revision? Ok cool, had no idea 
- might as well skip that condition (and the entire join with revision table) 
then if it's already implicitly so:
  
    SELECT COUNT(DISTINCT page_id)
    # page excludes deleted pages (which are in archive)
    FROM page
    # joining on page_latest - we only care about most recent
    INNER JOIN slots ON slot_revision_id = page_latest
    # mediainfo slot must contain actual content
    INNER JOIN content ON slot_content_id = content_id AND content_size > 122
    INNER JOIN slot_roles ON role_id = slot_role_id AND role_name = 'mediainfo';
  
  
  
    +-------------------------+
    | COUNT(DISTINCT page_id) |
    +-------------------------+
    |                 3045691 |
    +-------------------------+
    1 row in set (7 min 23.17 sec)

TASK DETAIL
  https://phabricator.wikimedia.org/T238878

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: matthiasmullie
Cc: Milimetric, Cparle, nettrom_WMF, Ladsgroup, daniel, Mayakp.wiki, gsingers, 
matthiasmullie, Addshore, kzimmerman, mpopov, Ramsey-WMF, Abit, Nuria, 
4748kitoko, darthmon_wmde, DannyS712, Nandana, JKSTNK, Akovalyov, Lahi, 
PDrouin-WMF, Gq86, E1presidente, Anooprao, SandraF_WMF, GoranSMilovanovic, 
QZanden, Tramullas, Acer, LawExplorer, Salgo60, Silverfish, _jensen, 
rosalieper, Scott_WUaS, Susannaanas, JAllemandou, Jane023, terrrydactyl, 
Wikidata-bugs, Base, aude, Ricordisamoa, Wesalius, Lydia_Pintscher, 
Fabrice_Florin, Raymond, Steinsplitter, Mbch331, jeremyb
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to