From f26d95a72938620e01129e2ce239c449c086a0d6 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 26 Jan 2004 22:42:49 +0000 Subject: [PATCH] Remove DISTINCTs and ORDER BY. If the tables are right distinct is unneccesary, and ORDER BY slows things down unnecessarily. Taking these two out enables skipping temporary tables and filesort for potentially very large numbers of links. --- includes/SpecialWhatlinkshere.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index d7bfa3d69f..35dab264cd 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -27,7 +27,7 @@ function wfSpecialWhatlinkshere($par = NULL) $isredir = " (" . wfMsg( "isredirect" ) . ")\n"; if ( 0 == $id ) { - $sql = "SELECT DISTINCT bl_from FROM brokenlinks WHERE bl_to='" . + $sql = "SELECT bl_from FROM brokenlinks WHERE bl_to='" . wfStrencode( $nt->getPrefixedDBkey() ) . "' LIMIT 500"; $res = wfQuery( $sql, DB_READ, $fname ); @@ -67,7 +67,7 @@ function wfShowIndirectLinks( $level, $lid ) global $wgOut, $wgUser; $fname = "wfShowIndirectLinks"; - $sql = "SELECT DISTINCT l_from FROM links WHERE l_to={$lid} ORDER BY l_from LIMIT 500"; + $sql = "SELECT l_from FROM links WHERE l_to={$lid} LIMIT 500"; $res = wfQuery( $sql, DB_READ, $fname ); if ( 0 == wfNumRows( $res ) ) { -- 2.20.1