MySQL Read Exclusive access?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
horrighs
Forum Newbie
Posts: 1
Joined: Sat Dec 20, 2003 10:04 pm

MySQL Read Exclusive access?

Post by horrighs »

Can i select a batch of records for Read Exclusive in PHP to MySQL? I have a large DB, 2 million records, that i end up having 10 or so php process performing caluculations on the data.

this data needs to be processed only once but i need a way so that i can read say 100 records at a time, perform the calcs and write the records back without worrying about another process grabing the same records.

Right now i am, since i have so many records, randomly picking start points. This of course is not perfect, what i really need is a "read exclusive" command or something.

Steve
PeopleHost.com
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://www.mysql.com/doc/en/LOCK_TABLES.html might be what youÄre looking for
User avatar
aquila125
Forum Commoner
Posts: 96
Joined: Tue Dec 09, 2003 10:39 am
Location: Belgium

Post by aquila125 »

use transactions. .that's why they are invented
Post Reply