Re: Phantom Inserts
Date: Wed, 1 Mar 1995 10:00:19
Message-ID: <finkel.212.0036CAE6_at_links.com>
Hi Thomas.
In article <tIxK
l0iA$zTC065yn_at_login.dknet.dk> zeppelin_at_login.dknet.dk (Thomas B. Pedersen)
writes:>From: zeppelin_at_login.dknet.dk (Thomas B. Pedersen)
>Subject: Re: Phantom Inserts
>Date: Tue, 28 Feb 1995 18:41:43 -0500
>In article <pwongD4C773.F15_at_netcom.com>, Philip S. Wong wrote:
>> I was wondering how different databases/vendors implement protection
>> against phantom inserts. In particular, how can they achieve phantom
>> protection while maintaining a good degree of concurrency?
>The ORACLE7 Concepts Manual (10-6) mentions something called a SCN
>(system change number) which is used to ensure that transaction A
>never sees data committed by transaction B after transaction A started.
>ORACLE calls this "statement-level read consistency".
>When providing read-consistency, the manual says, "blocks with changed
>data (more recent SCNs) are reconstructured using data in the rollback
>segments...". I don't doubt that it is necessary to provide some kind
>of read-consistency, but doesn't this approach cause an enormous
>performance degradation? Especially for long-running transactions the
>same data could have been changed a number of times.
Oracle's multi-versioning read consistency (MVRC) is an interesting animal with its own strengths and weaknesses. Over in they Sybase newsgroup there has been extensive discussion regarding the effect that MVRC reads (SELECTSs) has on data consistency when used in _update_ transactions. This is a real no-no but something that is a necessary evil in the world of Oracle where MVRC are almost always used in update transactions.
The only way to prevent phanthom inserts in an Oracle update transaction is to set SERIALIZABLE=TRUE in the init.ora file. This locks the entire table when it is updated by any transaction. This does block phantom inserts but does have substantial impact on concurrency.
Regards,
Rich
Richard Finkelstein, Performance Computing, Inc.
3930 N. Pinegrove, Ste. 1214, Chicago, IL 606013
(312) 549-8325 (Voice) 312-549-4824 (Fax)
Received on Wed Mar 01 1995 - 10:00:19 CET