12.07.2015 Views

Electronics Research Lab Design Postgres 1985 - the Information ...

Electronics Research Lab Design Postgres 1985 - the Information ...

Electronics Research Lab Design Postgres 1985 - the Information ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

all on <strong>the</strong> component objects.5.3.6. Access MethodsWe expect to implement both B-tree and OB-tree [STON83b] secondaryindexes. Moreover, our ADT facility supports an arbitrary collection of userdefined indexes. Each such index is, in reality, a pair of indexes one for magneticdisk records and one for archival records. The first index is of <strong>the</strong> formindex-relation (user-key-or-keys, pointer-to-tuple)and uses <strong>the</strong> same structure as current ZNGRES eecondary indexes. The secondindex will have pointers to archival tuples and will add "tmin" and "tmax" towhatever user keys are declared. With this structure, records satisfying <strong>the</strong>qualification:where relation.key = valuewill be interpreted to mean:where (relation["now"].key = value)and will require searching only <strong>the</strong> magnetic disk index. General queries of <strong>the</strong>form:where relation[T].key = valuewill require searching both <strong>the</strong> magnetic disk and <strong>the</strong> archival index. Both indexesneed only search for records with qualifying keys; moreover <strong>the</strong> archival index canfur<strong>the</strong>r restrict <strong>the</strong> search using tmax and tmin.Any POSTQUEL replace command will insert a new data record with anappropriate BXID and tmin, and <strong>the</strong>n insert a record into all key indexes whichare defined, and lastly change tmax on <strong>the</strong> record to be updated. A POSTQUELappend will only perform <strong>the</strong> first and third steps while a delete only perfurms <strong>the</strong>second step. Providing a pointer from <strong>the</strong> old tuple to <strong>the</strong> new tuple would allowPOSTGRES to insert records only into indexes for keys that are modified. Thisoptimization saves many disk writes at some expense in run-time complexity. Weplan to implement this optimization.The implementor of a new access method structure need only keep in mindthat <strong>the</strong> new data record must be forced from main memory before any indexrecords (or <strong>the</strong> index record will point to garbage) and that multiple index updates(e.g. page splits) must be forced in <strong>the</strong> correct order (i.e. from leaf to root). This iseasily accomplished with a single low level command to <strong>the</strong> buffer manager:order pa gel, page2Inopportune crashes may leave an access method which consists of a multi-leveltree with dangling index pages (i.e. pages that are not pointed two from anywhereelse in <strong>the</strong> tree). Such crashes may also leave <strong>the</strong> heap with uncommitted datarecords that cannot be reached from some indexes. Such dangling tuples will begarbage collected by <strong>the</strong> vacuum process because <strong>the</strong>y will have EXID equal to notcommitted. Unfortunately if dangling data records are not recorded in any index,<strong>the</strong>n a sweep of memory will be periodicaly required to find <strong>the</strong>m. Dangling indexepages must be garbage collected by conventional techniques.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!