Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Zar2gar1
.
This query will return the articles on Wikipedia (EN) with the most out-links. The goal is to ultimately provide a breakout of total links, in-links, and out-links. However, that will require some intense joining with the "linktarget" table so Quarry isn't the place for further prototyping. Because of how the database indices are set up, we don't attempt to join with the other tables at all.
Toggle Highlighting
SQL
# Set a query timeout for politeness SET STATEMENT max_statement_time = 300 FOR # Indices don't allow for an efficient join ... # ... so we'll just grab page IDs for now SELECT pl_from AS "Article ID", # NOTE: DISTINCT unnecessary, primary key includes DISTINCT COUNT(pl_target_id) AS "Number of Out-links" FROM pagelinks # The namespace key allows us to filter # TODO: List articles likely need further filtering WHERE pl_from_namespace = 0 # Ordering on a COUNT should be OK GROUP BY 1 ORDER BY 2 DESC # TESTING: Start with a small limit to gauge time LIMIT 100;
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...