MySQL Forums
Forum List  »  Performance

Re: scaling performance vs number of CPUs
Posted by: Jay Pipes
Date: September 25, 2005 07:57AM

Well, here's my thoughts on your situation... If the threads will be examining the same set of record data, I don't think there's a whole lot of benefit to using multiple threads to do the SELECTs. IMHO, you're just going to run into the race conditions that you saw earlier. The only way that you can circumvent the next-key locking (really, just circumventing the row-level locking) would be to lock the table as a whole using LOCK TABLE my_table READ; before each SELECT statement. This would perhaps be slightly faster than going with the row-level locking in your situation because the threads are all examining the same range of records. Locking the table as a whole would certainly prevent the race conditions for the row-level locks (because other threads would simply wait for the table-level lock to be released). However, you may run into a situation where threads will timeout waiting in line for the table-lock to be released. Perhaps it's worth testing. Try it and post back your results...

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com



Edited 1 time(s). Last edit at 09/25/2005 07:58AM by Jay Pipes.

Options: ReplyQuote


Subject
Views
Written By
Posted
1997
September 23, 2005 12:02PM
1423
September 23, 2005 04:26PM
Re: scaling performance vs number of CPUs
1363
September 25, 2005 07:57AM


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.