r89594 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89593‎ | r89594 | r89595 >
Date:19:24, 6 June 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Followup r89588, adding the DISTINCT keyword is somewhat helpful
Modified paths:
  • /trunk/extensions/CodeReview/api/ApiQueryCodePaths.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/api/ApiQueryCodePaths.php
@@ -38,7 +38,7 @@
3939 }
4040
4141 $this->addTables( 'code_paths' );
42 - $this->addFields( 'cp_path' );
 42+ $this->addFields( 'DISTINCT cp_path' );
4343 $this->addWhere( array( 'cp_repo_id' => $repo->getId() ) );
4444 $db = $this->getDB();
4545

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89588* (bug 29287) Path searching input need a suggest list...reedy19:01, 6 June 2011

Comments

#Comment by Hashar (talk | contribs)   13:33, 7 June 2011

IIRC, DISTINCT does not use index on MySQL 4 and does a full scan.

Since live use some MySQL 5 version ... We should be fine :-)

#Comment by Reedy (talk | contribs)   13:33, 7 June 2011

Don't computers suck?

#Comment by Hashar (talk | contribs)   13:38, 7 June 2011

Resetting to new, you might want to force the index use. In bug 29287, the query does not seem to use repo_path index. See comment 7 : https://bugzilla.wikimedia.org/show_bug.cgi?id=29287#c7

Follow up on bug report :)

#Comment by 😂 (talk | contribs)   17:24, 22 July 2011

Resolved by r89645.

Status & tagging log