Subject RE: [Firebird-Architect] RFC: Proposal for the implementation of Temporary Tables.
Author Samofatov, Nickolay
Hi, All!

> > Using the active database leverages the existing structures. Free
> > space
> can be located with existing mechanisms completely
> > unchanged. Page number references in indexes and blobs can be used
> directly. Cleaning up the pages used by a temporary table in
> > the case of a system crash is problematic.

I would simply add ATTACHMENT_ID system column (probably with
appropriate index) to tables declared as temporary and taught optimizer
to filter out rows which should not be visible by current attachment. At
startup engine may perform simple clean up process (it doesn't require
exclusive access to database and thus may be performed in background)
which can delete rows belonging to old attachments.

It looks like such implementation may be done in a few days and doesn't
require big modifications of the engine.

> Dmitry