[pLog-svn] db optimization

Christoph Feddersen feddersen at herr-der-ringe-film.de
Thu Apr 13 17:29:41 GMT 2006


Ah ok,
this query appeared > 32.000 times in the logs. Yes, using IN () is
faster than using OR on the same field.

So the host_block_rules is a standard lifetype table, but it's only used
in combination with this plugin?

I'll skip plugins as a start and concentrate on the main application.

Oscar Renalias wrote:
> It's from a plugin, the 'hostblock' plugin to be more precise.
> 
> But I recently changed this query, since mysql wasn't using the
> indexes properly. Now the query looks something like the one below and
> according to mysql's EXPLAIN output, it seems to be making a better
> usage of the indexes defined on these two columns.
> 
> SELECT * FROM plog_host_blocking_rules WHERE blog_id IN (1,0)
> AND block_type = 2;
> 
> If interested, get the pluging via svn from
> http://deve.lifetype.net/svn/plog/plugins/trunk/hostblock
> 
> Oscar
> 
> On 4/11/06, Christoph Feddersen <feddersen at herr-der-ringe-film.de> wrote:
>> Can somebody tell me where I can find this query in the sources:
>> SELECT * FROM plog_host_blocking_rules WHERE blog_id = 1 OR blog_id = 0
>> AND block_type = 2;
>>
>> I'm too stupid to find it in the 1.1 codebase.
>>
>> Thanks,
>> Christoph
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn


More information about the pLog-svn mailing list