MySQL Forums
Forum List  »  Performance

Re: PHP/MySQL to use all CPU/memory to increase performance
Posted by: Rick James
Date: September 22, 2014 03:39PM

First of all, your SELECT and loop can probably be turned into a single query. It would be a "multi-table" update (see the online manual) and be something like

UPDATE tableExample_2x AS b
JOIN tableExample AS a ON b.associativeID = a.id
SET b.val1 = a.stuff
WHERE a.criteria5 = 'example'

That (if it does what you want) will inherently run a lot faster that the code you have.

MySQL will not use more than one CPU in a single connection.

As for memory, it is up to your tuning; see
http://mysql.rjweb.org/doc.php/memory

innodb-buffer-pool-size=6G
innodb_buffer_pool_size=134217728
If you were using innodb exclusively, I would suggest 1200M for 4G of RAM.
6G is definitely bad.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: PHP/MySQL to use all CPU/memory to increase performance
1127
September 22, 2014 03:39PM


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.