home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!triplerock.CS.Berkeley.EDU!mao
- From: mao@triplerock.CS.Berkeley.EDU (Mike Olson)
- Newsgroups: comp.databases.theory
- Subject: Re: What is the _Halloween Problem_ ?
- Date: 28 Aug 1992 17:43:57 GMT
- Organization: University of California at Berkeley
- Lines: 40
- Message-ID: <17loktINN7mi@agate.berkeley.edu>
- References: <1992Aug24.000720.7563@news2.cis.umn.edu> <22838@sybase.sybase.com> <1992Aug28.161050.668@news2.cis.umn.edu>
- NNTP-Posting-Host: triplerock.cs.berkeley.edu
-
- In <1992Aug28.161050.668@news2.cis.umn.edu>, kencham@ulysses.cs.umn.edu
- (Deepak) writes:
-
- > Consider the query,
- >
- > Update OneK
- > Set unique2 = 10002
- > where unique2 == 10001;
- >
- > According to some systems, this is an instance of the
- > _Halloween Problem_. How ? Besides violation of entity constraint
- > what is the other problem that makes it _HP_ for some systems.
-
- strictly speaking, this isn't an instance of the halloween problem; it's
- a query that could lead to the halloween problem (seeing your own updates)
- if you choose a particular access path.
-
- suppose the dbms chooses to do a sequential scan of onek, and suppose
- the table is clustered on unique2. then whenever we see a 10001, we
- change it to 10002, and move the tuple containing it to a new location in
- the table. later in our sequential scan, we'll see the new record.
- transaction semantics force us never to see our own updates, so this is
- a violation of transaction semantics.
-
- in general, any time you set a value in the target list that you read
- elsewhere in the query (either in computing target list expressions or
- in a qualification), it's possible to construct a scenario in which the
- halloween problem occurs. existing dbms' generally use some technique
- to mark records that should be invisible to the current transaction to
- get around this. oracle, for example, writes monotonic timestamps on
- updated pages, and uses the undo log to restore database state to the
- transaction's start time. if a page has not been modified since the
- current xact started, then all values on it are visible to the current
- transaction. postgres uses transaction identifiers and commit times on
- every record, and computes visibility for every record it reads.
-
- mike olson
- project sequoia 2000
- uc berkeley
- mao@cs.berkeley.edu
-