Subject | Re: [Firebird-Architect] RFC: Proposal for the implementation of Temporary Tables. |
---|---|
Author | Martijn Tonies |
Post date | 2004-11-23T15:38:34Z |
Paul,
for tables that are accessible over connection boundaries.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> Syntax:CREATE GLOBAL TEMPORARY TABLE
>
> CREATE TEMPORARY TABLE <table name> <table contents source>
> [ON COMMIT {PRESERVE | DELETE} ROWS]
for tables that are accessible over connection boundaries.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
> Syntax:table are discarded at the end of the transaction that
> If the optional ON COMMIT clause is omitted, the contents of the temporary
> created them.table. Entries are made in RDB$RELATION_FIELDS and
>
> Semantics:
> An entry for relation <table name> is made in the RDB$RELATIONS system
> RDB$FIELDS relations describing the fields listed in the <table contentssource>, as they would be for a permanent table. The
> entries in RDB$RELATIONS, RDB$FIELDS, and RDB$RELATION_FIELDS areprovisional and unusable until the transaction which issued the
> CREATE statement commits.tables are part of the global name space. No connection can
>
> All connections can see the definition of temporary tables; temporary
> see data stored in a temporary table by another connection.table in a foreign key constraint, but the partner table must
>
> A temporary table can be either the referenced or referencing
> be a temporary table. If either table is ON DELETE COMMIT, both must beON DELETE COMMIT.
>that field value has the value RDB$PERMANENT, the table is
>
> System table support:
> A new field will be added to RDB$RELATIONS, called RDB$RELATION_TYPE. If
> permanent. If the field value is RDB$TEMPORARY_PRESERVE the table istemporary and contents are retained until the connection which
> created them terminates. If the value is a RDB$TEMPORARY_DELETE, thetable is temporary and contents are discarded at the end of
> the transaction which created them.from permanent to temporary or vice-versa is accomplished
>
> Notes:
> No changes are proposed to ALTER TABLE or DROP TABLE. Changing a table
> by dropping the table and recreating it.the <table contents source> listed in the syntax above. If
>
> The syntax AS <query expression> has been suggested as an alternative to
> that syntax is part of the SQL-99 standard, I can't find it.class, which is a subclass of the Relation class. A
>
> Implementation:
> A temporary table is represented internally by a TemporaryRelation
> TemporaryRelation instance is created either by dfw, CStatement, or duringthe processing of blr. TemporaryRelation classes hang
> off the attachment object as well as the Database object. TheTemporaryRelation object provides the location of the index root
> page for that table instance and it's pointer page list.applying object discipline to the driving structures. Record
>
> Changes to VIO, DPM, NAV, BTR, and IDX would be primarily cleanup and
> source blocks become a class hierarchy. References to the sourcerelation would be through either the TemporaryRelation object or
> the Relation.active database or in a temporary file created for the
>
> Data and indexes for a temporary table could be stored on pages in the
> instance. Each alternative has advantages.can be located with existing mechanisms completely
>
> Using the active database leverages the existing structures. Free space
> unchanged. Page number references in indexes and blobs can be useddirectly. Cleaning up the pages used by a temporary table in
> the case of a system crash is problematic.references be redirected to the temporary file, increasing the
>
> Using a temporary file requires that space management and all page
> number of layers that must be aware of this change. A temporary file isautomatically destroyed in case of system failure.
>
> Paul Beach
> Main Tel (UK):+44 (0) 1844 354357
> Mobile: (UK): +44 (0) 7837 898072
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>