MySQL Forums
Forum List  »  Performance

Re: Sort_merge_passes increasing at 38 per minute...
Posted by: Rick James
Date: December 22, 2011 11:53PM

SHOW VARIABLES LIKE 'innodb%';
SHOW STATUS LIKE 'Innodb%';
What version?

InnoDB does have periodic pauses while it flushes things to disk. But I generally see the frequency to be hours, not "1-2 times per minute". (Percona's Xtradb has virtually eliminated this issue.)

SHOW CREATE TABLE
SHOW TABLE STATUS
Sort merge passes should happen on large sorts, no 4000-row sorts -- unless
* Certain settings are unreasonably low;
* The table rows are really fat (big TEXT/BLOG field(s)).

SELECT end_time INTO currentEndTime FROM auctions WHERE id=var_auction_id;

IF (ADDTIME(currentEndTime , var_time_increment) < NOW()) THEN
UPDATE auctions SET end_time = ADDTIME(NOW(), var_time_increment), price = price+var_price_increment, leader_id = var_leader_id, modified = NOW() WHERE id = var_auction_id AND closed = 0;
ELSE
UPDATE auctions SET end_time = ADDTIME(end_time, var_time_increment), price = price+var_price_increment, leader_id = var_leader_id, modified = NOW() WHERE id = var_auction_id AND closed = 0;
END IF;

Wouldn't this do the same as most of your code?:
UPDATE auctions SET 
        end_time = ADDTIME(GREATEST(end_time, NOW()), var_time_increment),
        price = price+var_price_increment, leader_id = var_leader_id, 
        modified = NOW()
    WHERE id = var_auction_id
      AND closed = 0;
(or maybe it should be LEAST())

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Sort_merge_passes increasing at 38 per minute...
1413
December 22, 2011 11:53PM


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.