Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
Fork of
Most common categories for Commons file pages linked from a page
by
Jheald
This query is marked as a draft
This query has been published
by
Jheald
.
Query becomes catastrophically slow when the 'fp' page table join is added -- because there is apparently no index on the "page_title" field of the page table. Solution: see https://quarry.wmflabs.org/query/34008 -- page-namespace also needs to be specified in join
Toggle Highlighting
SQL
use commonswiki_p; SELECT DISTINCT pl.pl_title #, GROUP_CONCAT(cl.cl_to SEPARATOR ' / ') AS cats FROM page AS p0 JOIN pagelinks AS pl ON pl.pl_from=p0.page_id AND pl.pl_from_namespace=p0.page_namespace AND pl.pl_namespace=6 # JOIN page AS fp ON fp.page_title = pl.pl_title # JOIN categorylinks AS cl ON cl.cl_from = fp.page_id WHERE p0.page_title='British_Library/MC_maps_batch_01_(GB_counties)' AND p0.page_namespace=4
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...