MySQL Forums
Forum List  »  Performance

Re: 100% CPU Usage in Win2003
Posted by: Luis Sanches
Date: August 17, 2005 06:25AM

Hi all - I'm replying to my own query.

By using SHOW FULL PROCESSLIST during the slow pages, I was able to identify the culprit connection.

I had some legacy code which inserted a record by:

1) "SELECT * FROM sometable"
2) "RS.AddNew", etc...
3) "RS("someColumn") = "some data"
3) "RS.Update", close, etc..

While the above code is visually clear, and works fine, it is actually fetching all records from the chosen table. Once your table gets too large, the query starts to be very taxing on the system.

The solution was to use the normal INSERT query instead:

"INSERT INTO sometable (`somecolumn`) VALUES ('some data')"

I hope this can help someone.

Options: ReplyQuote


Subject
Views
Written By
Posted
2898
August 12, 2005 10:09AM
Re: 100% CPU Usage in Win2003
1544
August 17, 2005 06:25AM


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.