List:Replication« Previous MessageNext Message »
From:Mats Kindahl Date:April 30 2010 7:00am
Subject:Re: Slow query on replication master and slave
View as plain text  
Hi Kandy,

Select queries are not directly affected by replication, only
indirectly since replication requires resources and can increase lock
times for updates.

The things you mention seems to be more related to whether the query
cache has cached the result, different indexes, locking, and other issues.

Just my few cents,
Mats Kindahl

Kandy Wong wrote:
> Hi,
> 
> Is it true that the performance of running a query on a live replication
> master and slave has to be much slower than running a query on a static
> server?
> 
> I've tried to run the following query on a replication master and it
> takes 1 min 13.76 sec to finish.
> SELECT *, ABS(timeA-1266143632) as distance FROM tableA WHERE timeA -
> 1266143632 <= 0  ORDER BY distance LIMIT 1;
> 
> And if I run it on the replication slave, it takes 24.15 sec.
> But if I dump the whole database to another machine as static, it only
> takes 3.70 sec or even less to finish.
> 
> The table has 386 columns and timeA is an index.
> 
> Is there a way to improve the query or any other factors that would
> affect the performance?
> 
> Thanks.
> 
> Kandy
> 
> 

-- 
Mats Kindahl
Senior Software Engineer
Database Technology Group
Sun Microsystems
Thread
Slow query on replication master and slaveKandy Wong28 Apr
  • Re: Slow query on replication master and slaveJohan De Meersman29 Apr
    • Re: Slow query on replication master and slaveRick James29 Apr
  • Re: Slow query on replication master and slaveMats Kindahl30 Apr