Performance fix on Sphinx search results: use id instead of created timestamp for reverse date sorting; should give same result but doesn't trigger a filesort.

This commit is contained in:
Brion Vibber 2010-03-02 12:06:40 -08:00
parent 6b134ae4c7
commit b1ffbf17d3

View File

@ -75,7 +75,7 @@ class SphinxSearch extends SearchEngine
{
if ('chron' === $mode) {
$this->sphinx->SetSortMode(SPH_SORT_ATTR_DESC, 'created_ts');
return $this->target->orderBy('created desc');
return $this->target->orderBy('id desc');
}
}