MySQL Forums
Forum List  »  Performance

Re: Utilize maximum system resources for better performance
Posted by: Rick James
Date: August 09, 2015 11:17PM

> SELECT count(*) as total_results FROM content WHERE content.enabled = 1 ;

takes a long time unless it is in the Query cache. Keep in mind that _any_ change to `total_results` will lose that COUNT from the QC.

How bad is the QC? It depends on far more things that we can discuss here. It _might_ but useful for you. In my experience, 99% of production systems do not benefit from the QC. Yours may be in the 1%.

> mysqli_autocommit($con,FALSE);
> update rows,
> mysqli_commit($con);

That works. Doing the update one row at a time is a lot slower than some form of batching.

I prefer BEGIN; do stuff; COMMIT; instead of using autocommit.

(autocommit is local to your session.)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Utilize maximum system resources for better performance
886
August 09, 2015 11:17PM


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.