MySQL Forums
Forum List  »  Performance

Re: Slow speed in MySQL. Can't make faster :(
Posted by: Franz Hänel
Date: November 05, 2005 07:56AM

Are you making a SELECT COUNT(*)... before every insert/update? That might explain why it's getting slower and slower. A faster way might be to use INSERT INTO table(a,b,c) VALUES('...','...','...') ON DUPLICATE KEY UPDATE b='...', c='...'
More here:
http://dev.mysql.com/doc/refman/5.0/en/insert.html

As you are using php. If you're using php 5 / mysql 4.1 (or higher) you can also make use of the prepared statements in mysqli. This is very usefull when you run the samy query many times in the same script as the query doesn't have to be parsed every time and the transfered data is smaller.
http://dev.mysql.com/doc/refman/5.1/en/sqlps.html

Also, you might find this interesting:
http://dev.mysql.com/doc/refman/5.0/en/insert-speed.html

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Slow speed in MySQL. Can't make faster :(
1351
November 05, 2005 07:56AM


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.