Index: trunk/phase3/maintenance/createNullLinksRows.php |
— | — | @@ -1,94 +0,0 @@ |
2 | | -<? |
3 | | - |
4 | | -require( 'commandLine.inc' ); |
5 | | - |
6 | | -$db_master = wfGetDB( DB_MASTER ); |
7 | | -$db_slave = wfGetDB( DB_SLAVE ); |
8 | | - |
9 | | -## Do pagelinks update |
10 | | - |
11 | | -echo "Updating pagelinks with null rows.\n"; |
12 | | - |
13 | | -$count = 0; |
14 | | - |
15 | | -list( $page, $pagelinks ) = $db_slave->tableNamesN( 'page', 'pagelinks' ); |
16 | | - |
17 | | -$pl_query = "SELECT page_id |
18 | | - FROM $page |
19 | | - LEFT JOIN $pagelinks ON page_id=pl_from |
20 | | - WHERE pl_from IS NULL"; |
21 | | - |
22 | | -$res = $db_slave->query( $pl_query, 'createNullLinksRows' ); |
23 | | - |
24 | | -$buffer = array(); |
25 | | - |
26 | | -while ($row = $db_slave->fetchObject( $res )) |
27 | | -{ |
28 | | - $buffer[] = array( 'pl_from' => $row->page_id, 'pl_namespace' => 0, 'pl_title' => '' ); |
29 | | - |
30 | | - $count++; |
31 | | - |
32 | | - if (count($buffer) > 100) |
33 | | - { |
34 | | - #Batch-insert |
35 | | - |
36 | | - echo "$count pages..\n"; |
37 | | - |
38 | | - $db_master->insert( 'pagelinks', $buffer, 'createNullLinksRows', array('IGNORE') ); |
39 | | - |
40 | | - wfWaitForSlaves(10); |
41 | | - |
42 | | - $buffer = array(); |
43 | | - } |
44 | | -} |
45 | | - |
46 | | -# Insert the rest |
47 | | - |
48 | | -echo "$count pages..\n"; |
49 | | - |
50 | | -$db_master->insert( 'pagelinks', $buffer, 'createNullLinksRows', array('IGNORE') ); |
51 | | - |
52 | | -wfWaitForSlaves(10); |
53 | | - |
54 | | -## Do categorylinks update |
55 | | - |
56 | | -$buffer = array(); |
57 | | - |
58 | | -echo "Updating categorylinks with null rows.\n"; |
59 | | - |
60 | | -list( $page, $categorylinks ) = $db_slave->tableNamesN( 'page', 'categorylinks' ); |
61 | | - |
62 | | -$pl_query = "SELECT page_id |
63 | | - FROM $page |
64 | | - LEFT JOIN $categorylinks ON page_id=cl_from |
65 | | - WHERE cl_from IS NULL"; |
66 | | - |
67 | | -$res = $db_slave->query( $pl_query, 'createNullLinksRows' ); |
68 | | - |
69 | | -$buffer = array(); |
70 | | - |
71 | | -while ($row = $db_slave->fetchObject( $res )) |
72 | | -{ |
73 | | - $buffer[] = array( 'cl_from' => $row->page_id, 'cl_to' => 0, 'cl_sortkey' => '' ); |
74 | | - |
75 | | - if (count($buffer) > 100) |
76 | | - { |
77 | | - #Batch-insert |
78 | | - |
79 | | - echo "$count pages..\n"; |
80 | | - |
81 | | - $db_master->insert( 'categorylinks', $buffer, 'createNullLinksRows', array('IGNORE') ); |
82 | | - |
83 | | - wfWaitForSlaves(10); |
84 | | - |
85 | | - $buffer = array(); |
86 | | - } |
87 | | -} |
88 | | - |
89 | | -echo "$count pages..\n"; |
90 | | - |
91 | | -$db_master->insert( 'categorylinks', $buffer, 'createNullLinksRows', array('IGNORE') ); |
92 | | - |
93 | | -$buffer = array(); |
94 | | - |
95 | | -echo "Done!\n"; |
Index: trunk/phase3/maintenance/archives/create_null_links_entries.sql |
— | — | @@ -1,15 +0,0 @@ |
2 | | - |
3 | | -INSERT INTO /*$wgDBprefix*/pagelinks (pl_from,pl_namespace,pl_title) |
4 | | -SELECT page_id,0,'' |
5 | | - FROM /*$wgDBprefix*/page |
6 | | - LEFT JOIN /*$wgDBprefix*/pagelinks ON page_id=pl_from |
7 | | - WHERE pl_from IS NULL; |
8 | | - |
9 | | -INSERT INTO /*$wgDBprefix*/categorylinks (cl_from,cl_sortkey,cl_to) |
10 | | -SELECT page_id,'',0 |
11 | | - FROM /*$wgDBprefix*/page |
12 | | - LEFT JOIN /*$wgDBprefix*/categorylinks ON page_id=cl_from |
13 | | - WHERE cl_from IS NULL; |
Index: trunk/phase3/includes/SpecialUncategorizedpages.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | } |
22 | 22 | |
23 | 23 | function isExpensive() { |
24 | | - return false; |
| 24 | + return true; |
25 | 25 | } |
26 | 26 | function isSyndicated() { return false; } |
27 | 27 | |
— | — | @@ -33,11 +33,12 @@ |
34 | 34 | " |
35 | 35 | SELECT |
36 | 36 | $name as type, |
37 | | - page.page_namespace AS namespace, |
38 | | - page.page_title AS title, |
39 | | - page.page_title AS value |
40 | | - FROM $page,$categorylinks |
41 | | - WHERE page_id=cl_from AND page_namespace={$this->requestedNamespace} AND page_is_redirect=0 AND cl_to='' |
| 37 | + page_namespace AS namespace, |
| 38 | + page_title AS title, |
| 39 | + page_title AS value |
| 40 | + FROM $page |
| 41 | + LEFT JOIN $categorylinks ON page_id=cl_from |
| 42 | + WHERE cl_from IS NULL AND page_namespace={$this->requestedNamespace} AND page_is_redirect=0 |
42 | 43 | "; |
43 | 44 | } |
44 | 45 | } |
Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -52,10 +52,6 @@ |
53 | 53 | $this->mExternals = $parserOutput->getExternalLinks(); |
54 | 54 | $this->mCategories = $parserOutput->getCategories(); |
55 | 55 | |
56 | | - # Insert (0,'') entries if there are none of a given type of link (page and category links only) |
57 | | - $this->mLinks = $this->addNullEntries( $this->mLinks, array( 0 => array( '' => 0 ) ) ); |
58 | | - $this->mCategories = $this->addNullEntries( $this->mCategories ); |
59 | | - |
60 | 56 | # Convert the format of the interlanguage links |
61 | 57 | # I didn't want to change it in the ParserOutput, because that array is passed all |
62 | 58 | # the way back to the skin, so either a skin API break would be required, or an |
— | — | @@ -73,21 +69,6 @@ |
74 | 70 | } |
75 | 71 | |
76 | 72 | /** |
77 | | - * Add "no links" entries to the parser-output. |
78 | | - * @param $links array The links array to add null entries to. |
79 | | - * @param $replace array What to replace it with if $links is empty. |
80 | | - * @return array The links array, after being modified. |
81 | | - */ |
82 | | - function addNullEntries( $links, $replace = array( '' => '' ) ) |
83 | | - { |
84 | | - if ( count( $links ) == 0 ) { |
85 | | - $links = $replace; |
86 | | - } |
87 | | - |
88 | | - return $links; |
89 | | - } |
90 | | - |
91 | | - /** |
92 | 73 | * Update link tables with outgoing links from an updated article |
93 | 74 | */ |
94 | 75 | function doUpdate() { |
— | — | @@ -341,7 +322,6 @@ |
342 | 323 | # array_diff_key() was introduced in PHP 5.1, there is a compatibility function |
343 | 324 | # in GlobalFunctions.php |
344 | 325 | $diffs = isset( $existing[$ns] ) ? array_diff_key( $dbkeys, $existing[$ns] ) : $dbkeys; |
345 | | - |
346 | 326 | foreach ( $diffs as $dbk => $id ) { |
347 | 327 | $arr[] = array( |
348 | 328 | 'pl_from' => $this->mId, |
Index: trunk/phase3/includes/SpecialDeadendpages.php |
— | — | @@ -18,8 +18,13 @@ |
19 | 19 | return wfMsgExt( 'deadendpagestext', array( 'parse' ) ); |
20 | 20 | } |
21 | 21 | |
| 22 | + /** |
| 23 | + * LEFT JOIN is expensive |
| 24 | + * |
| 25 | + * @return true |
| 26 | + */ |
22 | 27 | function isExpensive( ) { |
23 | | - return false; |
| 28 | + return 1; |
24 | 29 | } |
25 | 30 | |
26 | 31 | function isSyndicated() { return false; } |
— | — | @@ -38,12 +43,10 @@ |
39 | 44 | $dbr = wfGetDB( DB_SLAVE ); |
40 | 45 | list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); |
41 | 46 | return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " . |
42 | | - "FROM $page,$pagelinks " . |
43 | | - "WHERE page_id = pl_from " . |
| 47 | + "FROM $page LEFT JOIN $pagelinks ON page_id = pl_from " . |
| 48 | + "WHERE pl_from IS NULL " . |
44 | 49 | "AND page_namespace = 0 " . |
45 | | - "AND page_is_redirect = 0 " . |
46 | | - "AND pl_title = '' " . |
47 | | - "AND pl_namespace = 0"; |
| 50 | + "AND page_is_redirect = 0"; |
48 | 51 | } |
49 | 52 | } |
50 | 53 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -19,9 +19,6 @@ |
20 | 20 | it from source control: http://www.mediawiki.org/wiki/Download_from_SVN |
21 | 21 | |
22 | 22 | === Configuration changes in 1.12 === |
23 | | -* The permission key required to edit another user's css/js subpage is now |
24 | | - editusercssjs, rather than editinterface, as it was previously. This permission |
25 | | - is assigned by default to the sysop group. |
26 | 23 | |
27 | 24 | === New features in 1.12 === |
28 | 25 | * Add a warning for non-descriptive filenames at Special:Upload |
— | — | @@ -51,9 +48,6 @@ |
52 | 49 | * (bug 11266) Set fallback language for Fulfulde (ff) to French |
53 | 50 | * (bug 11179) Include image version deletion comment in public log |
54 | 51 | * (bug 11158) Fix escaping in API HTML-formatted JSON |
55 | | -* Speed up Special:UncategorizedPages and Special:Deadendpages (no longer marked |
56 | | - as slow queries). They now add blank ('','') entries for pages without ANY links |
57 | | - or categories. |
58 | 52 | * Fixed notice when accessing special page without read permission and whitelist |
59 | 53 | is not defined |
60 | 54 | |