MySQL Forums
Forum List  »  Optimizer & Parser

Identical servers different plan for the same query
Posted by: Eric Coll
Date: April 07, 2012 01:20AM

I have two identical servers running the same query but the query plans are completely different. How is this possible?

The servers are a master and a slave. The schema is identical compared by MySQL Workbench. The data is identical as it is replicated, and the server variables are identical as well.

The query is very simple:
select * from capacity.pool_usage pu
join capacity.last_timestamp lt
on pu.region = lt.region and
pu.timestamp = lt.timestamp and
lt.datatype = 'USAGE'
where
account in ('866211823536')

The master correctly grabs the timestamp record for each region in the lt table, and filters the usage table using a timestamp, regio index which is very efficient.

The slave queries all the usage for the selected account, and then joins with the lt table.

How is this possible? Shouldn't both servers use the same query plan?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.