MySQL Forums
Forum List  »  Stored Procedures

Re: Table Not Updating
Posted by: Peter Brawley
Date: April 27, 2016 01:35PM

201 secs? Your tables need indexes and/or your server needs tuning.

Are the tables MyISAM or InnoDB? They should be the latter.

How much RAM. What is innodb_buffer_pool_size?

If you are working with 5.6 or later, run this:

explain
update customers c
join salesledger s on c.customerid=s.customerid
set c.hasoverdueBalance = "T"
where s.duedate < curdate() and s.balance <> 0 ;

Otherwise run this ...

explain
select c.hasoverduebalance
from customers c
join salesledger s on c.customerid=s.customerid
where s.duedate < curdate() and s.balance <> 0 ;

... and post the result along with the results of ...

show create table customers;
show create table salesledger;

Options: ReplyQuote


Subject
Views
Written By
Posted
2761
April 27, 2016 07:22AM
735
April 27, 2016 08:15AM
920
April 27, 2016 11:56AM
809
April 27, 2016 12:27PM
887
April 27, 2016 12:44PM
Re: Table Not Updating
877
April 27, 2016 01:35PM
899
April 27, 2016 01:51PM
777
April 27, 2016 01:56PM
959
April 27, 2016 02:29PM


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.