Subject | Re: [Firebird-Architect] RFC: Proposal for the implementation of Temporary Tables. |
---|---|
Author | Ann W. Harrison |
Post date | 2004-11-23T22:52:39Z |
At 04:35 PM 11/23/2004, Dmitry Yemanov wrote:
that the standard specifies that the data in temporary tables are
SQL-session objects and that a SQL-session is equivalent to a connection?
OK, now does everyone agree that the standard uses LOCAL and GLOBAL
to define the scope of temporary table data between SQL-client modules
and that we don't support SQL-client modules?
then we'd be consistent with the standard (my opinion at least) and
with Oracle.
not schemas.
the standard and the four implementations that are more or less compliant
with it and follow the lead of MSSQL?
data? Or both?
definition was governed by the use of schemas and that the data was
in all cases (except MSSQL) private to the connection.
LOCAL. I really don't see why we should choose some other meaning.
don't change the semantics of a compiled request.
let me think about it. Defining tables based on other tables has
been around for a donkey's years. The full subquery makes it very
much like a persistent view ... that persists for the duration of
a single connection.
that the lower parts of the I/O system - searching for free space etc.
would be subclassed to handle data outside the database.
it had a good long ride, but it's so full of ... history.
name space.
mechanisms, cleaning them up, then generalizing and specializing
them.
Regards,
Ann
>As almost everybody mentioned, GLOBAL and LOCAL are missing ;-)Let me see if I can follow all of this through. Does everyone agree
that the standard specifies that the data in temporary tables are
SQL-session objects and that a SQL-session is equivalent to a connection?
OK, now does everyone agree that the standard uses LOCAL and GLOBAL
to define the scope of temporary table data between SQL-client modules
and that we don't support SQL-client modules?
>Oracle supports GLOBAL TEMPORARY TABLE with global schema andOK, so if we added { GLOBAL | LOCAL } with LOCAL ::= notYetImplemented,
>session-specific data. AFAIU, this is what you propose. Oracle does not
>support LOCAL TEMPORARY TABLE (at least in v9).
then we'd be consistent with the standard (my opinion at least) and
with Oracle.
>AFAIU, InterBase 7.5 offers exactly the same semantics. Sybase ASA - theAnd with Sybase and InterBase. (Wow, the company we keep!)
>same.
>DB2 offers DECLARE GLOBALWhich is OK, because GLOBAL refers to the scope with regard to modules,
>TEMPORARY TABLE which is not included into the system schema and hence is
>visible only on a per-session basis.
not schemas.
> MSSQL has both global and local tempOK, how many people think we should show our independence by ignoring
>tables defined via the non-standard syntax with specific scopes (all
>sessions or current session) and global temp tables have data shared between
>sessions.
the standard and the four implementations that are more or less compliant
with it and follow the lead of MSSQL?
> MySQL has just TEMPORARY TABLE which is visible only for theWhen you say visible, do you refer to the definition or the
>current session. PostgreSQL offers only LOCAL TEMPORARY TABLE which is also
>visible for the current session only.
data? Or both?
>So everybody distinguishes between GLOBAL and LOCAL in terms of the userHunh? Sorry. I thought you said that the visibility of the table
>session.
definition was governed by the use of schemas and that the data was
in all cases (except MSSQL) private to the connection.
> Everybody considers GLOBAL visible to other sessions except DB2Sorry, the standard is very clear about the meaning of GLOBAL and
>(and perhaps MySQL). Everybody offers session-specific data for GLOBAL
>except MSSQL. Can we stick to the majority and name our implementation
>accordingly?
LOCAL. I really don't see why we should choose some other meaning.
> > No connection can see data stored in a temporary table by anotherAnd what the standard specifies.
>connection.
>
>Questionable decision, but it seems it's what almost everybody supports.
> > No changes are proposed to ALTER TABLE or DROP TABLE. Changing a tableOK, but it requires that you get a relation existence lock so you
>from permanent to temporary or vice-versa is accomplished
> > by dropping the table and recreating it.
>
>Agreed, but a change between DELETE ROWS and PRESERVE ROWS should be
>allowed.
don't change the semantics of a compiled request.
> > The syntax AS <query expression> has been suggested as an alternative toSQL-99? However, since it's obviously part of the 2003 standard,
>the <table contents source> listed in the syntax above. If
> > that syntax is part of the SQL-99 standard, I can't find it.
>
><table contents source> ::=
> <table element list>
> | OF <path-resolved user-defined type name>
> [ <subtable clause> ]
> [ <table element list> ]
> | <as subquery clause>
let me think about it. Defining tables based on other tables has
been around for a donkey's years. The full subquery makes it very
much like a persistent view ... that persists for the duration of
a single connection.
> > Changes to VIO, DPM, NAV, BTR, and IDX w...Right.
>
>Temporary relation is an incorrect term, as views are also relations. I'd
>prefer to see an abstract class Relation with descendant classes
>PersistentTable, TemporaryTable, ExternalTable, View.
> > Choice of location for data of temporary tables .. in the database or out?Dmitry - it's late. Not a flag. But essentially, that's the idea -
>Requires more thinking. What about PAG_temporary flag which means that a
>page I/O should be redirected to the TempSpace object instead of PIO?
that the lower parts of the I/O system - searching for free space etc.
would be subclassed to handle data outside the database.
> InI would think we could also keep the CacheManager. CCH... well...
>this case we keep all advantages of VIO and DPM (CCH usage is questionable)
>with an ability of a quick data destroy.
it had a good long ride, but it's so full of ... history.
>Considering the GLOBAL question solved, I don't see how:What you mean by local can't be implemented without a multi-layer
>
>1) LOCAL can be implemented
name space.
>2) AS <subquery> can be implementedThat, I think, is a question of pulling together some existing
mechanisms, cleaning them up, then generalizing and specializing
them.
Regards,
Ann