On Thu, Sep 11, 2008 at 6:30 PM,
<soxred93(a)svn.wikimedia.org> wrote:
Revision: 40734
Author: soxred93
Date: 2008-09-11 22:30:27 +0000 (Thu, 11 Sep 2008)
Log Message:
-----------
Add new special page Wantedfiles.
[snip a whole lot]
+ function getSQL() {
+ $dbr = wfGetDB( DB_SLAVE );
+ list( $imagelinks, $page ) = $dbr->tableNamesN( 'imagelinks',
'page' );
+ $name = $dbr->addQuotes( $this->getName() );
+ return
+ "
+ SELECT
+ $name as type,
+ " . NS_IMAGE . " as namespace,
+ il_to as title,
+ COUNT(*) as value
+ FROM $imagelinks
+ LEFT JOIN $page ON il_to = page_title AND page_namespace =
". NS_IMAGE ."
+ WHERE page_title IS NULL
+ GROUP BY il_to
+ ";
+ }
This is pretty much the same query I committed in r35934. It was later
removed because the query is slow and makes this page useless--as
is the case with WantedPages which is disabled on WMF sites because
of it. Has something changed that makes this better now?
Also, please don't
hardcode SQL like that, but use $dbr->select().
Roan Kattouw (Catrope)
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org