Subject | Re: [Firebird-Architect] for discussion Transient Data Set |
---|---|
Author | Dmitry Yemanov |
Post date | 2005-01-11T07:50:13Z |
"Ann W. Harrison" <aharrison@...> wrote:
If this is a query, then it looks like SQL-99 common table expressions (aka WITH clause). But CTE don't allow modifications, AFAIK. So, if you insist on INSERT/UPDATE/DELETE, then we have something like a temporary view.
If this is an actual data set, then how does it differ from LTTs?
Dmitry
>First question, whether it defines a query or a data set? I.e. whether all references are passed to the actual relations (like a view behaves) or it defines some materialized data?
> Proposal: add a new, non-standard SQL construct that functions like a
> table and is specific to a SQL session. This object is called, for lack
> of a better term, a transient data set.
If this is a query, then it looks like SQL-99 common table expressions (aka WITH clause). But CTE don't allow modifications, AFAIK. So, if you insist on INSERT/UPDATE/DELETE, then we have something like a temporary view.
If this is an actual data set, then how does it differ from LTTs?
> A transient data set is created with a SQL select statement thatSo we have a result assigned to some "table variable" which can be referenced later? Sounds like a real data set.
> includes a new keyword YIELDING. For a singleton select or an
> interactive select, YIELDING is an alternative to INTO.
> The columns of transient data set correspond in name and data type withFine.
> the elements in the select list of the statement that created the set.
> No other attributes of the elements of the source data are assigned to
> the transient data set columns.
> A transient data set is destroyed when the session ends or with the dropEqual to DROP TABLE for a LTT.
> transient data set statement: DROP TRANSIENT DATA SET <name>
> Projection:Fine. RECREATE LTT doesn't allow projections.
> SELECT a, c FROM my_data YIELDING my_data;
>
> Redefinition:
> SELECT x.a, y.b, x.c
> FROM table1 x LEFT OUTER JOIN my_data y ON y.a = x.a
> YIELDING my_data;
>
> Combination
> SELECT x.a, x.b, x.c, x.d FROM table2 x
> UNION
> SELECT y.a, y.b, y.c, NULL FROM my_data y
> YIELDING my_data;
>
> The non-standard DDL statements CREATE INDEX and DROP INDEX can also beThe major question then. Where are the data (both rows and index b-tree) stored? Are blobs supported? And again, what is the actual difference between your proposal and already discussed LTTs (considering the suggested CREATE AS SELECT extention)?
> used on transient data sets. The indexes created are destroyed
> automatically when the transient data set is destroyed.
Dmitry