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.
I thought domas or someone added that. I just carried it over.
Simetrical-3 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.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
-----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)
On Wed, Apr 9, 2008 at 1:16 PM, Brion Vibber brion@wikimedia.org wrote:
Simetrical wrote:
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.
Yes, of course, you're right. I didn't look closely enough.
wikitech-l@lists.wikimedia.org