Download presentation
Presentation is loading. Please wait.
1
95f523 hcg-struct-migration.ppt - 1 RJL pre-981107 - rev.060912 Migration Strategy (hcg_* to TT->TS TS<-VW) l Proposed 96s523 chgen project l Hcg-structs used by chgen and pr-util.a l Difficult to understand and maintain l Reverse-engineer --> equiv. data model l Add to schema.h and pr_loaded view l Update, continuously track hcg_structs l Specify and check runtime invariants l Incrementally convert each client l Maintain duality during coexistence l At 100% cut-over, can eliminate hcg_*.
2
95f523 hcg-struct-migration.ppt - 2 RJL pre-981107 - rev.060912 Current hcg- Structures hcg_ts-list: Array [0.HXCG_NUM_TABLES] of ts_list_type: ts_list_type: Array[0..MAXVERSIONS- 1] of ts_list_elt_type]: ts_list_elt_type: maxrow // largest row number[or pkey?] value in version rcount // total number of table rows in version hcg_view_list_type: // holds version# of each table in each named view {int num_views// at most MAXVIEWS (= 10) Array[0..MAXVIEWS] of view_elt_type viewname[30] char// runtime value - must search by name mode char // r=read; w=write; a=append version_list: Array[0..HCG_NUM_TABLES-1] of version_list_elt: version_list_elt: char//unsigned int [0..MAXVERSION <=255] } hcg_view_list
3
95f523 hcg-struct-migration.ppt - 3 RJL pre-981107 - rev.060912 hcg_table hierarchy hcg_ts_list ts_list ts_type maxrow rcount hcg_view_list num_viewsI2 view_element_type viewname c30 modec1 version_list_elt versionNoc1 Views and table versions for each table 1:MAXVIEWS 1:HCG_NUM_TABLES 1:MAXVERSIONS root level (one row in each) (one row per view) (one row per table) (per table version in loaded views?) (one row per view name and table version) ______ Proposal: Merge top tables; merge bottom tables.
4
95f523 hcg-struct-migration.ppt - 4 RJL pre-981107 - rev.060912 Hcg-equivalent Data Model SV Schema Version schemaNamec30 schemaVersion i2 num_tablesi2... TT Table Type ttabbrevc4 maxveri2 rcounti2 TA Table Attribute...... (as in chgen v9)... TS TableStats versionNoi2 maxrowi2 vrcounti2 VV ViewVersion viewName c30 mode c1 num_tables i2 Tables VV, TS and VS contain the same attributes that chgen now declares and maintains as the hcg_* structures in schemaname.h. (Exception: version rcount becomes vrcount.) This model adds tables VV and TS to the genv9 schema SV-->TT-->TA
5
95f523 hcg-struct-migration.ppt - 5 RJL pre-981107 - rev.060912 Path Extensions to MetaSchema l Schema tables TT andTA do not capture the schema topology. l Network paths are defined by fkeys and connect tables. l Fkey (FK) is a sub-class of TA. l Path (PA) is a sequence of fkeys. l Many PAths share fkeys. l Table IK (Intermediate fKey) associates FK’s and PAths. l From table PA, access macros can be defined. l Each path has an orientation; IK identifies path’s first or last fkey. l Problem: redundant: wasted space. SV TT TA FK PA IK
6
95f523 hcg-struct-migration.ppt - 6 RJL pre-981107 - rev.060912 Alternate Path Data Model (2) l Paths are either direct (one fkey) or composite (multi-fkey) l Each PAth has exactly one fkey (FK) component. l PAths are linear sequences, with a ‘head’ FK and a ‘tail’ composite ‘rest-of-path’ (recursive List) CP. l This leads to a cyclic schema: l PA-->FK:CP-->PA...->FK. l Eventually the PA shrinks to an fkey and CP vanishes (mincard = 0). l Chgen cannot handle alternate paths, only unique ones. l FK has an implicit TTid ref to parent, (not via TA to its TT container). SV TT TA FK PA CP 1:10:1 1:1 mutex
7
95f523 hcg-struct-migration.ppt - 7 RJL pre-981107 - rev.060912 Alternate Path Data Model (3) l Paths are either direct (one fkey) or composite (fkey-sequence). l Each PAth has exactly one fkey (FK) ‘head’ component. l PAths are recursive lists: a ‘head’ fkey is followed by a ‘tail’ composite sub-path. l Upward paths branch out at each node which has In-degree >1. l Fkeys become part of more than one PAth; therefore, FK--->PA is 1:1::1:M. l The dashed TT-->PA relation is redundant. SV TT TA FK PA pathLength PT (PathTail) 1:M 0:1 1:1 rest-of -path upward -link alternate upward paths (Not Verified)
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.