Re: Implementation of boolean types.
Date: 18 Jul 2005 10:17:38 -0700
Message-ID: <1121707058.460822.86930_at_g49g2000cwa.googlegroups.com>
Drago Ganic wrote:
> >
> > The expression can be collapsed. Say there are only 3 known values of
> > Bonus in the Emp table (out of 10). Then
> >
> > totalBonus = 1000 + x1 + x2 + 2000 + x3 + 3000 + x5 + x6 + x7 =
> > = 6000 + (x1 + x2 + x3 + x5 + x6 + x7) = 6000 + y
> >
> > An implicit rule is that expressions involving variables can be renamed
> > to other variable.
> >
>
> Yes .... that's it :-) The variable names/symbol names in a relation are
> attribute names subscripted by primary keys. For example:
>
> emp.bonus is {1000 EUR, bonus[petar], bonus[paul], 2000 EUR, ... }
This is convenient notation, although initially I had some difficulty applying it to an expression which is aggreagation result. After aggregation we have something like this
3000 * EUR + 2000 * $ + unknown
where we collapsed bonus[petar], bonus[paul], ... into "unknown"
Or, perhaps we should pursue this idea and make it
3000 * EUR + 2000 * $ + unknAggrBonus[0]
where index doesn't really matter for a single aggregate. For aggregation with group by we still have a key so that the result is
3000 * EUR + 2000 * $ + unknAggrBonus[department=10,mgr=smith] 5000 * EUR + 6000 * $ + unknAggrBonus[department=10,mgr=adams]
Question. How do we handle mess with created by union of unknowns
Relation A:
id name
-- ----
1 smith
2 unknName[id=2]
3 unknName[id=3]
Relation B:
id name
-- ----
1 adams
2 unknName[id=2]
What is the result of
project(name, A) union project(name, B) Received on Mon Jul 18 2005 - 19:17:38 CEST