Re: Possible problems with Date & McGoveran View Updating
Date: Mon, 15 Sep 2003 10:08:17 -0700
Message-ID: <Cum9b.19$lB2.92_at_news.oracle.com>
"Jan Hidders" <jan.hidders_at_pandora.be> wrote in message
news:Ym%8b.20114$7y3.1376399_at_phobos.telenet-ops.be...
> Mikito Harakiri wrote:
> > "Jan Hidders" <jan.hidders_at_pandora.be> wrote in message
> > news:PX38b.14807$2Z.580673_at_phobos.telenet-ops.be...
> >> A small example. Suppose we have a table Emps(name,dept) and a view
> >> TrEmps defined by
> >>
> >> SELECT name
> >> FROM Emps
> >> WHERE dept = "sales";
> >>
> >> then if you add a tuple to this view it is perfectly clear which tuple
> >> should be added to Emps and so this is a well-defined update.
> >
> > This view is not updateable. If you delete a tuple from this view, do
you
> > delete from the base table or update dept = 'sales' into some other
value
> > (which we can't deduce from TrEmps alone)?
>
> According to the definition I gave this deletion is well-defined. The
unique
> "minimal" solution is that the corresponding tuple is deleted from Emps,
> and indeed that is all that the database knows for certain: this tuple has
> to to be removed. I find this quite intuitive, can you explain why you
> don't?
Because if you update base table
update Emps
set dept = 'marketing'
where dept = 'sales'
the observed effect on TrEmps is deletion of a tuple. I'd like modification of the base table and the view being symmetric.
The situation is analogous to Linear Algebra. Suppose you have 3 points on the plane and want to draw a staight line through all three of them. Then, in most of the cases there is no solution, as the points are almost certainly non colinear. However, Linear algebra may suggest "the best solution that fits the problem". It is a line that is closest to all three points.
Although, approximate solutution theory of linear algebra is perfectly legitimate, it's a side topic. The center of linear algebra theory are linear operators, inverse, scalar products, normal forms, determinants, etc.
> By the way, what is exactly your definition of "updatable"? Should there
be
> at least one instance and one update such that the result is well-defined,
> or should for all instances all updates be definied, or something in
> between?
I would rather start with "invertible"
#1 Transformation Q is locally invertible for database instance X and set of
views Y if there exists Q^(-1) such that:
Q * X = Y <=> X = Y * Q^(-1)
where * is an application of transformation to a relation (base or derived).
#2 Transformation Q is globally invertible if #1 holds for any X and Y.
Unlike Linear Algebra, where "globally invertible" and "locally invertible" are equivalent definitions, our theory is certainly nonlinear, especially if we allow arihmetic operators and user-defined functions.
Next step is introducting deltas and demonstrating that locally invertible means updateable... Received on Mon Sep 15 2003 - 19:08:17 CEST