MySQL Forums
Forum List  »  Replication

Re: how to get the execution plan of slave sql thread
Posted by: Rick James
Date: February 05, 2015 11:38PM

First I need to barf on the schema...

* No PRIMARY KEY -- bad. That may be the main problem.

* If you are using a new enough version, you can turn on the SlowLog, crank down long_query_time, and get the explain plan in the slowlog.

* DECIMAL(22,0) -- The values don't look like 22 digits; perhaps overkill? That takes 10 bytes.

* Using columns for "arrays" -- poor design. (Phone numbers and attributes)

* DATETIME(6) -- You really want microsecond precision?

* CHAR(1) CHARSET utf8 is a costly way to do a flag -- it takes 3 bytes.

* Can all the fields, except the first two, be NULL? (It seems unlikely.)

Back to your question...

On the Slave, you can try
EXPLAIN DELETE FROM `dataaudit`.`t_cn_cfg_vendor_contract`
WHERE VENDOR_ID=5632
AND CONTACT_ID=147116
AND RECORD_UPDATETIME='2015-01-25 06:30:00.000000'
AND is_deleted='0';

If your version is new enough, it should give you the explain plan.

How many rows match that pair of `VENDOR_ID` & `CONTACT_ID`?

The 'current' sql is visible fleetingly in SHOW FULL PROCESSLIST;
If it is a slow query, it won't be fleeting.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: how to get the execution plan of slave sql thread
928
February 05, 2015 11:38PM


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.