-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Simetrical wrote:
On Tue, Apr 8, 2008 at 6:40 PM, aaron@svn.wikimedia.org wrote:
Log Message:
Don't set $this->pattern unless it is allowed
$this->pattern = $pattern; $ns = $title->getNamespace(); if( $pattern && !$wgMiserMode ) { # use escapeLike to avoid expensive search patterns like 't%st%' $safetitle = $this->mDb->escapeLike( $title->getDBkey() ); $this->mConds['log_namespace'] = $ns; $this->mConds[] = "log_title LIKE '$safetitle%'";
$this->pattern = $pattern; } else {
Does this need to look at $wgMiserMode at all? A prefix search should be fine efficiency-wise.
Not when limiting and ordering the results by timestamp -- using a prefix for the title means you can't use the timestamp portion of the page_timestamp index.
Your result set based on the title prefix is ordered first by the complete title, and has to be filesorted into timestamp order so you can box off the requested date range and display it in order.
- -- brion vibber (brion @ wikimedia.org)