Re: Concurrency in an RDB

From: David <davidbl_at_iinet.net.au>
Date: 18 Dec 2006 16:46:53 -0800
Message-ID: <1166489213.076542.73990_at_79g2000cws.googlegroups.com>


NENASHI, Tegiri wrote:
> "David" <davidbl_at_iinet.net.au> wrote in
> news:1166446464.885673.257380_at_f1g2000cwa.googlegroups.com:
>
 [snip]

> > Consider that 50% of the individual transactions break the constraint.
> > Then batching won't help. Eg try a batch of size 2. Expectation
> > value of number of compiles per batch = 0.25*1 + 0.25*2 + 0.5*3 =
> > 2.25, which is actually worse than not batching at all.
> >
>
> How it is possible that the expectation is 2.25 ? It is 0.25*1 + 0.25*1
> + 0.25*2 = 1 -- one is incorrect two times and two are incorect one
> time. It is the same like with individual arrival and it is not
> surprising because the model of probability is the same.

My reasoning was as follows... The batch consists of two transactions T1,T2.

If both transactions are valid then only one compile is needed (to check the entire batch) but this only occurs 25% of the time.

Otherwise it is necessary to compile after applying only T1. If this succeeds then we deduce that T2 is bad. This occurs 25% of the time, and required two compiles.

Otherwise we have to compensate (or discard) T1. Since we have already performed two compiles and we haven't done anything to determine the correctness of T2, this case (which occurs 50% of the time) requires 3 compiles.

Cheers,
David Received on Tue Dec 19 2006 - 01:46:53 CET

Original text of this message