[UPHPU] MySQL Locking Question

Ben Reece breece at doba.com
Tue Aug 7 14:21:23 MDT 2007


Chad Sollis wrote:
> pretty big change performance-wise for the better or worse?  what is a
> potential negative outcome of dirty reads?
>
> Thanks for all this info.
>
> ~Chad
>
>
> On 8/7/07, Ben Reece <breece at doba.com> wrote:
>   
>> The other engines have options to allow dirty reads, but MyISAM
>> doesn't, unless use the MySQL handlers instead of queries, but it's a
>> lot more work.
>>     
>> The InnoDB engine allows dirty reads, but it can be a pretty big change
>> performance-wise, depending on how you're using it.
>>
>> Though in the specified example, if a delete like that is taking a long
>> time, either a) the row data is very large, b) there are an insane
>> number of rows, or c) the server's pretty slow.  Even deleting 1/2 of a
>> million rows, it should only take a few seconds, and can be run once a
>> day during non-peak times.
>>
>> Ben
>>
>>     
Generally MyISAM is more efficient than InnoDB, since it doesn't support 
any of the fancy features that InnoDB does.  So in this case switching 
to InnoDB would probably hurt performance. 

Dirty reads are when you pull data from a table while it's being 
changed.  For example, if I do a 'SELECT * FROM foo' while a 'DELETE 
FROM foo WHERE bar < foobar' is running, I might get some of the records 
that match the 'DELETE' statement, but not all of them.  In the case of 
a session DB, dirty reads shouldn't matter at all, since I imagine 
you're only pulling 1 row at a time.


More information about the UPHPU mailing list