List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 23 1999 11:06am
Subject:Re: long running select
View as plain text  
>>>>> "Joshua" == Joshua Chamas <joshua@stripped> writes:

Joshua> "B. Engineer" wrote:
>> 
>> I have a long running selecton a 250K (pretty small, I know) table. It
>> takes about 35 seconds, no ORDER BY.
>> I also have inserts that run constantly while this select runs.
>> 
>> The problem is once the select starts, the inserts wait until the select
>> finishes. A DIRTY READ is okay for me, how can I force it??
>> 

Joshua> If you can't tune your query up, stay tuned ;)  I have
Joshua> submitted a patch to Monty that allows for concurrent
Joshua> selects & inserts for just this kind of problem.  The 
Joshua> final implementation is unclear, pending Monty's review,
Joshua> but we will have something soon.

Hi!

I am just now working on Joshua's patch;  The problem was that I
didn't like the possibility for 'dirty reads' so I changed the patch
to allow inserts on the end of the file without other threads noticing 
the new rows.  To allow this, I had to add a lot of new stuff into the locking
handler and the MyISAM code;   Everything is now written and as soon as I
have tested this properly, I will release 3.23.7 with this feature. (In other
words, it should be released by the end of this week)

Note that this patch will allow you to have concurrent inserts as
selects are running, but only if there is no holes after deleted rows 
in the table.  In this case the insert changes to a normal 'locked'
insert until all holes are filled.

I have alread updated the online manual about this!

Regards,
Monty
Thread
long running selectB. Engineer22 Nov
  • Re: long running selectsinisa22 Nov
  • Re: long running selectJoshua Chamas23 Nov
    • Re: long running selectMichael Widenius23 Nov