US 20070192283A1 ( 19) United Sta tes ( 12) Pa tent Applica tion Publica tion ( 10) Pub. N O. : US 2007 / 0192283 A1 La rs on et a l. ( 4 3) Pub. D a te: Aug. 16, 2007 ( 5 4) MAIN TEN AN CE OF MATERIALIZED ( 5 2) US. Cl.
US 20070192283A1 ( 19) United Sta tes ( 12) Pa tent Applica tion Publica tion ( 10) Pub. N O. : US 2007 / 0192283 A1 La rs on et a l. ( 4 3) Pub. D a te: Aug. 16, 2007 ( 5 4) MAIN TEN AN CE OF MATERIALIZED ( 5 2) US. Cl.
US 20070192283A1 ( 19) United Sta tes ( 12) Pa tent Applica tion Publica tion ( 10) Pub. N O. : US 2007 / 0192283 A1 La rs on et a l. ( 4 3) Pub. D a te: Aug. 16, 2007 ( 5 4) MAIN TEN AN CE OF MATERIALIZED ( 5 2) US. Cl.
( 12) Pa tent Applica tion Publica tion ( 10) Pub. N o. : US 2007/0192283 A1 La rs on et a l. ( 4 3) Pub. D a te: Aug. 16 , 2007 ( 5 4 ) MAIN TEN AN CE OF MATERIALIZED ( 5 2) US. Cl. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707/2 OUTER-JOIN VIEWS ( 75 ) Inv entors : Pa r-Ak e La rs on, Redm ond, WA ( US) ; ( 5 7) ABSTRACT Jingren Zh ou, Redm ond, WA ( US) Ma intena nce of m a teria liz ed v ieW f or q uery optim iz a tion in Corres pondence Addres s : - - - a da ta ba s e. Th e a rch itecture prov ides th e ? rs t pra ctica l AMIN ' TUROCY & CALVIN LLP a lgorith m s f or increm enta lly m a inta ining v ieWs With m ul CEN TER tiple outer j oins a nd a ggrega ted outer-j oin v ieWs . Ma teria l CLEVELAN D OH 4 4 114 U s iz ed v ieWs With a ny com bina tion of inner j oins , one-s ided ( ) outer j oins a nd f ull outer j oins , plus a n optiona l a ggrega tion ( 73) As s ignee' Micros of t Corpora tion Redm ond WA on top ca n be proces s ed by a lgom h m ( s ) th a t Cons truct ' increm enta l m a intena nce expres s ions ba s ed on conv erting ( 21) AP p1 N O _ 11/35 4 375 th e v ieW de? nition a j oin-dis j unctiv e norm a l f orm a nd ' " exploiting da ta ba s e cons tra ints to reduce m a intena nce ov er - . ea . s s tem com ris es a v 1eW crea tion com onent or ( 22) Filed. Feb. 15 , 2006 h d A Y P ' ' ' P f crea ting a m a teria liz ed v ieW de? nition th a t includes outer Publica tion Cla s s i? ca tion j oins a conv ers ion com ponent f or conv erting a n outer-j oin v ieW expres s ion into a norm a l f orm , a nd a m a intena nce ( 5 1) Int, Cl, com ponent f or upda ting th e s tored m a teria liz ed v ieW res ult G06 F 17/30 2006 01 a s s ocia ted With th e m a teria liz ed v ieW de? nition. ( ) [- 1200 f - 1204 [- 1202 [- 1208 VIEW COMPON EN T V MAIN TEN AN CE ; FOR EXPRESSION FOR GRAPH CON STRUCTIN G COMPUTIN G MAIN TEN AN CE CHAN GES TO N ET 1206 EXPRESSION S V CON TRIBUTION S OF { - FOR D IRECTLY- D IRECTLY-AFFECTED TARGET TABLE AFFECTED TERMS . TERMS Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 1 0f 13 US 2007/0192283 A1 VIEW CREATION , - 102 COMPON EN T CON VERSION /- 104 COMPON EN T MAIN TEN AN CE / 106 COMPON EN T FIG. 1 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 2 0f 13 START 7 US 2007/0192283 A1 RECEIVE UPD ATE TO TABLE T f - 200 V GET FIRST MATERIALIZED VIEW V /- 202 V VIEW FOUN D ? V REFEREN CE TABLE T? 208 r GET N EXT VIEW V A CON VERT SPOJ PART OF VIEW EXPRESSION IN TO N ORMAL FORM /- 210 GEN ERATE VIEW MAIN TEN AN CE EXPRESSION V EVALUATE VIEW MAIN TEN AN CE EXPRESSION FIG. 2 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 3 0f 13 US 2007/0192283 A1 { 0, 0, L} { 0, 0, L} i / \ { 0, 0} { 0, 0} { 0, L} i / \ x \ { C} { C} { O} { L} ( a ) V, ( b) v 2 FIG. 3 { 0, 0, 1} { 0, 0, L} { 0: 0} D { 010} D { 0, ( i, L} D { 6 } { 0} { 0, 0} ( a ) MQ dif y C ( 1) ) Modif y O Modif y L FIG. 5 ' { 0, 0, L} { 0, 0, L} D / \ / \ { 0, 0} 0 { 0, L} * . { 0, 0} { 0, L} / \ / \ / \ { 6 } { 0} { 0} { 0} D { L} ' Upda ting C ( b) Upda ting 0 FIG. 8 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 4 0f 13 US 2007/0192283 A1 RETRIEVE VIEW D EFIN ITION /' 4 00 l CON VERT SPOJ PART OF VIEW 4 02 EXPRESSION IN TO JOIN - /' D ISIUN CTIVE N ORMAL FORM 1 GEN ERATE SUBSUMPTION /- 4 04 GRAPH FROM N ORMAL FORM 1 FOR EACH N OD E IN THE GRAPH, 4 06 CREATE EXPRESSION D EFIN IN G /' ITS N ET CON TRIBUTION l CON N ECT ALL N ET- 4 08 CON TRIBUTION EXPRESSION S /" BY OUTER UN ION S FIG. 4 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 5 0f 13 US 2007/0192283 A1 RETRIEVE VIEW EXPRESSION /' 6 00 l CON VERT SPOJ PART OF VIEW 6 02 EXPRESSION TO JOIN - /' D ISJUN CTIVE N ORMAL FORM 1 CREATE SUBSUMPTION GRAPH 6 04 FROM THE N ORMALIZED /' EXPRESSION l ELIMIN ATE FROM THE 6 06 SUBSUMPTION GRAPH ALL /' UN AFFECTED N OD ES l CLASSIFY AN D MARK REMAIN IN G N OD ES AS / 6 08 D IRECTLY OR IN D IRECTLY AFFECTED 1 D ROP ALL OUTGOIN G ED GES 6 10 FROM TERMS MARKED AS /_ BEIN G IN D IRECTLY AFFECTED FIG. 6 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 6 0f 13 US 2007/0192283 A1 I START ) iv IN ITIATE VIEW MAIN TEN AN CE /_ 700 V UPD ATE AFFECTED BASE TABLE FIRST / 702 l CHECK MAIN TEN AN CE GRAPH FOR / 704 D IRECTLY-AFFECTED TERMS 706 N Y COMPUTE OUTER UN ION OF CHAN GES TO N ET CON TRIBUTION S OF ALL / 708 D IRECTLY-AFFECTED TERMS AN D APPLY TO VIEW V CHECK MAIN TEN AN CE GRAPH FOR 710 IN D IRECTLY-AF F ECTED TERMS 712 N Y COMPUTE OUTER UN ION OF CHAN GES TO N ET CON TRIBUTION S OF /- 714 IN D IRECTLY-AFFECTED TERMS AN D APPLY TO VIEW FIG. 7 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 7 0f 13 US 2007/0192283 A1 { @ 01" / \ { 6 } { 0} { 0} ( a ) Upda ting C ( 1) ) Upda ting 0 FIG. '9 ( a ) Upda tillig T ( 13) Upda ting R FIG. 11 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 8 0f 13 US 2007/0192283 A1 START , r CREATE MAIN TEN AN CE GRAPH / 1000 FOR UPD ATES TO TABLE T 7 GET FIRST D IRECTLY-AFFECTED /- 1002 N OD E N 1008 - r I GET N EXT D IRECTLY-AFFECTED N OD E N A 1006 f . " 1004 Y D ELETE N OD E N IF ITS SOURCE SET CON TAIN S A TABLE R f ) N OD E FOUN D JOIN ED TO TABLE T THROUGH A FOREIGN KEY FROM R TO T D ELETE ALL IN D IRECTLY- 1010 AFFECTED N OD ES THAT HAVE /' N O PAREN T N OD ES FIG. 10 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 9 0f 13 [- 1204 [- 1202 VIEW COMPON EN T MAIN TEN AN CE --> FOR GRAPH CON STRUCTIN G MAIN TEN AN CE 1206 EXPRESSION S [- FOR D IRECTLY AFFECTED TARGET TABLE TERMS US 2007/0192283 A1 { - 1200 1208 1, . FIG. 12 V EXPRESSION FOR COMPUTIN G CHAN GES TO N ET CON TRIBUTION S OF D IRECTLY-AFFECTED TERMS Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 10 0f 13 US 2007/0192283 A1 1 START ) CREATE VIEW MAIN TEN AN CE /- 1300 GRAPH FOR UPD ATES TO TABLE T l TRAVERSE GRAPH AN D CREATE A MAIN TEN AN CE EXPRESSION A FOR D IRECTLY-AFFECTED TERMS CON SISTIN G OF LEFT OUTER JOIN S AN D IN N ER JOIN S l CREATE A MAIN TEN AN CE EXPRESSION FOR EACH - / 1304 IN D IRECTLY-AFFECTED TERM THAT UTILIZES A1 AN D THE VIEW /- 1302 V CREATE AN ALTERN ATIVE MAIN TEN AN CE EXPRESSION FOR EACH IN D IRECTLY AFFECTED TERM THAT UTILIZES A AN D BASE TABLES l OPTIMIZER SELECTS THE LOWER COST EXPRESSION OF THE TWO /- 1308 ALTERN ATIVES FOR EACH IN D IRECTLY AFFECTED TERM , - 1306 FIG. 13 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 11 0f 13 US 2007/0192283 A1 I START I IN ITIATE MAIN TEN AN CE OF / 14 00 AGGREGATED OUTER-JOIN VIEW 7 COMPUTE CHAN GES TO N ET 14 02 CON TRIBUTION OF /' D IRECTLY-AFFECTED TERMS V COMPUTE CHAN GES TO THE N ET 4 04 CON TRIBUTION OF /' IN D IRECTLY-AFFECTED TERMS V AGGREGATE RESULTS AS SPECIFIED IN VIEW D EFIN ITION AN D APPLY TO VIEW /- 14 06 IN SAME WAY AS FOR AGGREGATED IN N ER JOIN VIEWS v CREATE N EW ROWS AS N EED ED /- 14 08 V D ELETE AN Y ROW WHOSE ROW COUN T /- 14 10 IS ZERO V IF N OT-N ULL COUN T FOR A TABLE T IS ZERO, SET ALL AGGREGATES /- 14 12 REFEREN CIN G A COLUMN IN TABLE T TO N ULL FIG. 14 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 12 0f 13 US 2007/0192283 A1 15 00 r 15 02 / : _ _ _ ' _ _ _ _ "5 . 1. 5 29-- PROCESSIN G /-15 04 : : OPERATIN G SYSTEM ; UN IT : --------- " T5 35 ' ' - ' . I _ _ _ _ _ _ _ _ L'_ _ _ _ _ 15 08 [-15 06 g { APPLICATION S : SYSTEM : _ _ _ _ _ _ _ _ I; _ 1 3i4 _ MEMORY /. 15 12 7: MOD ULES l I f 15 36 < > RAMk / : . ------------ - I L I ROM 15 26 FD D , - 15 18 /4 D Is K g , -15 20 r15 4 4 I m 15 28 OPTICAL MON ITOR ' ll? li I D RIVE /-15 22 /-15 38 f - 15 4 6 D ISK / KEYBOARD VID EO 1 AD APTOR , - 15 4 0 F15 4 2( w IRED /w IRELEs s ) MOUSE 4 D ug/Egg , -15 5 s r15 5 4 [-15 4 8 IN TERFACE MOD EM < WAN 5 * REMOTE COMPUTER s r15 5 6 , - 15 5 2 ( ) l N ETWORK 4 LAN 15 5 0 AD APTOR ( WIRED /WIRELESS) - _ MEMORY/ STORAGE FIG. 15 Pa tent Applica tion Publica tion Aug. 16 , 2007 Sh eet 13 0f 13 US 2007/0192283 A1 { - 16 00 f - 16 02 16 04 \ CLIEN T( S) SERVER( S) COMMUN ICATION ~ FRAMEWORK 16 08 16 10 \ V 16 06 V CLIEN T D ATA STORE( S) SERVER D ATA STORE( S) FIG. 16 US 2007/0192283 A1 MAIN TEN AN CE OF MATERIALIZED OUTER-JOIN VIEWS BACKGROUN D [0001] With th e a dv ent of th e Internet, m a s s iv e a m ounts of da ta a re becom ing m ore a cces s ible to la rge num ber of us ers , Wh eth er in interna l corpora te env ironm ents or in th e public a rena s uch a s Web-ba s ed da ta ba s es . Accordingly , m ore ef f i cient a nd perf orm a nce-driv en req uirem ents a re being pla ced on s uch s y s tem s a s th e num ber of us er, a nd cons eq uently , th e num ber a nd com plexity of q ueries continues to increa s e. [0002] In a rela tiona l da ta ba s e m a na gem ent s y s tem , a s a n exa m ple, rela tions h ips betWeen da ta ( or ? les ) a re crea ted by com pa ring da ta , s uch a s a ccount num bers a nd na m es . Th e da ta being com pa red a nd th e res ults ca n be s tructured in th e f orm of ta bles . A j oin proces s includes m a tch ing records in one ta ble ( or ? le) With records in a noth er, ba s ed on s om e condition, a nd crea ting a th ird ta ble th a t includes da ta f rom th e ta bles being j oined. In one exa m ple, a n Order ta ble ca n be j oined With a Cus tom er ta ble to crea te a th ird ta ble f or a ll cus tom ers Wh o purch a s ed a pa rticula r product. [0003] Th e def a ult ty pe of j oin is th e inner j oin, Wh ich produces a res ulting record Wh enev er tWo records , one f rom ea ch input ta ble, s a tis f y th e m a tch ing condition. Cons ider a noth er exa m ple th a t m a tch es s h ipm ents With receipts . Th e j oin Would produce a ta ble of s h ipm ents th a t h a v e been receiv ed but om it s h ipm ents th a t h a v e not been receiv ed. Contra riWis e, a n outer j oin Would crea te a ta ble of ev ery s h ipm ent, Wh eth er or not it Wa s receiv ed. D a ta f or receiv ed item s is a tta ch ed to th e s h ipm ents . Em pty ( or null) ? elds Would be a tta ch ed to s h ipm ents With out receipts . [0004 ] Ma teria liZed v ieWs , a ls o ca lled indexed v ieWs , a re a m ech a nis m f or s peeding up proces s ing of da ta ba s e q ue ries . A m a teria liz ed v ieW is a precom puted res ult th a t m a y be us ed to com pute pa rt or a ll of q uery ins tea d of com puting it directly f rom ba s e ta bles . Ma teria liZed v ieWs ca n prov ide dra m a tic im prov em ents in q uery proces s ing tim e. To be us ef ul, a m a teria liZed v ieW m us t be upda ted Wh en a ny of its underly ing ba s e ta bles is upda ted. Th is is norm a lly ref erred to a s v ieW m a intena nce. E? icient, increm enta l v ieW m a in tena nce a lgorith m s a re currently k noWn only f or SPJG v ieWs , th a t is , v ieWs com pos ed of s elect, proj ect a nd inner j oin opera tors , With a n optiona l a ggrega tion opera tor on top, th e a ggrega tion opera tor s um m a riz ing th e res ults of th e q uery . [0005 ] Prior Work on increm enta l m a intena nce of m a teri a liZed v ieWs h a s f ocus ed prim a rily on SPJG v ieWs but one conv entiona l s y s tem prov ides a m ech a nis m f or m a inta ining outer-j oin v ieWs . HoWev er, it does not cov er a ggrega ted v ieWs , a nd th e m ech a nis m m a y becom e gros s ly inef ? cient f or v ieWs With m ore th a n a s ingle outer j oin. SUMMARY [0006 ] Th e f olloWing pres ents a s im pli? ed s um m a ry in order to prov ide a ba s ic unders ta nding of s om e a s pects of th e dis clos ed innov a tion. Th is s um m a ry is not a n extens iv e ov erv ieW, a nd it is not intended to identif y k ey /critica l elem ents or to delinea te th e s cope th ereof . Its s ole purpos e is to pres ent s om e concepts in a s im pli? ed f orm a s a prelude to th e m ore deta iled des cription th a t is pres ented la ter. [0007] Th e s ubj ect innov a tion is rela ted to q uery proces s ing in da ta ba s e s y s tem s , a nd prov ides th e ? rs t genera l a nd Aug. 16 , 2007 pra ctica l a lgorith m s f or m a inta ining outer-j oin v ieWs , including a ggrega ted outer-j oin v ieWs . Ma teria liZed v ieWs With a ny com bina tion of s election, proj ection, inner j oins , one-s ided outer j oins a nd f ull outer j oins , plus a n optiona l a ggrega tion on top, ca lled SPOJ G v ieWs , ca n be h a ndled by th e dis clos ed a lgorith m ( s ) . [0008] D es cribed h erein is a n a rch itecture f or extending increm enta l v ieW m a intena nce to SPOJG v ieWs . Extens ion is by crea ting one or m ore a lgorith m s th a t cons truct incre m enta l m a intena nce expres s ions f or SP0] G v ieWs . Conv en tiona lly , SPOJ expres s ions ca n be conv erted to a norm a l f orm , f or exa m ple, a j oin-dis j unctiv e norm a l f orm . Th e dis clos ed a lgorith m ( s ) utiliZe th is norm a l f orm f or outer-j oin expres s ions , a nd a ls o exploit da ta ba s e cons tra ints , f or exa m ple, f oreign-k ey cons tra ints , to reduce m a intena nce ov erh ea d. Experim ents s h oW th a t m a inta ining a n outer-j oin v ieW need not be m ore expens iv e th a n m a inta ining a n inner-j oin v ieW; a nd f or a ggrega tion v ieWs it ca n ev en be ch ea per. [0009] Accordingly , th e inv ention dis clos ed a nd cla im ed h erein, in one a s pect th ereof , com pris es a com puter-im ple m ented s y s tem th a t f a cilita tes m a intena nce of m a teria liZed outer-j oin v ieWs . Th e s y s tem ca n com pris e a v ieW crea tion com ponent f or crea ting a m a teria liZed v ieW de? nition th a t includes outer-j oins , a conv ers ion com ponent f or conv erting v ieW expres s ion de? nition into a norm a l f orm , a nd a m a in tena nce com ponent f or upda ting th e s tored m a teria liZed v ieW res ult a s s ocia ted With th e m a teria liZed v ieW de? nition Wh en a n underly ing ba s e ta ble is m odi? ed. [0010] In a noth er a s pect, com puta tions a nd m eth odologies a re dis clos ed f or identif y ing directly - a nd indirectly -a f f ected term s of a n expres s ion in norm a l f orm a s a m ea ns f or reducing th e ov erh ea d of v ieW m a intena nce th ereby m a k ing expres s ions m ore ef ? cient to execute. [0011] In y et a noth er innov a tiv e a s pect, m eth odologies a re prov ided f or m a inta ining a ggrega ted v ieWs th a t conta in outer j oins . [0012] To th e a ccom plis h m ent of th e f oregoing a nd rela ted ends , certa in illus tra tiv e a s pects of th e dis clos ed innov a tion a re des cribed h erein in connection With th e f olloWing des cription a nd th e a nnexed dra Wings . Th es e a s pects a re indica tiv e, h oWev er, of but a f eW of th e v a rious Wa y s in Wh ich th e principles dis clos ed h erein ca n be em ploy ed a nd is intended to include a ll s uch a s pects a nd th eir eq uiv a lents . Oth er a dv a nta ges a nd nov el f ea tures Will becom e a ppa rent f rom th e f olloWing deta iled des cription Wh en cons idered in conj unction With th e dra Wings . BRIEF D ESCRIPTION OF THE D RAWIN GS [0013] FIG. 1 illus tra tes a com puter-im plem ented s y s tem th a t f a cilita tes m a intena nce of a m a teria liZed v ieW. [0014 ] FIG. 2 illus tra tes a m eth odology of m a inta ining a m a teria liZed v ieW in a ccorda nce With a nov el a s pect. [0015 ] FIG. 3 illus tra tes s ubs um ption gra ph s f or th e exa m ple SPOJ v ieWs V1 a nd v 2. [0016 ] FIG. 4 5 illus tra tes a m eth odology of genera ting a s ubs um ption gra ph a nd net contributions to th e v ieW. [0017] FIG. 5 6 illus tra tes s h oWs th ree m a intena nce gra ph s f or v ieW Vl th a t a re deriv ed f rom th e s ubs um ption gra ph f or V1 of FIG. 3. US 2007/0192283 A1 [0018] FIG. 6 illus tra tes a m eth odology of cons tructing a m a intena nce gra ph f or identif y ing term s a f f ected by a n upda te, in a ccorda nce With th e dis clos ed innov a tion. [0019] FIG. 7 illus tra tes a m eth odology of perf orm ing v ieW m a intena nce in a ccorda nce With a n innov a tiv e a s pect. [0020] FIG. 8 illus tra tes V2 m a intena nce gra ph s f or upda tes to ta ble C a nd f or upda tes to ta ble O. [0021] FIG. 9 illus tra tes th e reduced V2 m a intena nce gra ph s of FIG. 8 by exploiting th e f oreign k ey cons tra ints betWeen L a nd O, a nd betWeen O a nd C. [0022] FIG. 10 illus tra tes a How dia gra m of a m eth odol ogy of crea ting a reduced m a intena nce gra ph by elim ina ting a dditiona l nodes , th ereby s im plif y ing m a intena nce a nd increa s ing perf orm a nce. [0023] FIG. 11 illus tra tes m a intena nce gra ph s f or upda tes to ta bles T a nd R. [0024 ] FIG. 12 illus tra tes a s y s tem th a t cons tructs a n expres s ion f or com puting th e outer union of ch a nges to directly -a f f ected term s . [0025 ] FIG. 13 illus tra tes a m eth odology of cons tructing ef ? cient m a intena nce expres s ions f or a n outer-j oin v ieW. [0026 ] FIG. 14 illus tra tes a How dia gra m of a m eth odol ogy of m a inta ining a n a ggrega ted outer-j oin v ieW. [0027] FIG. 15 illus tra tes a block dia gra m of a com puter opera ble to execute th e dis clos ed m a teria liz ed v ieW m a in tena nce a rch itecture. [0028] FIG. 16 illus tra tes a s ch em a tic block dia gra m of a n exem pla ry com puting env ironm ent opera ble to m a inta in m a teria liz ed v ieWs in a ccorda nce With a noth er a s pect. D ETAILED D ESCRIPTION [0029] Th e innov a tion is noW des cribed With ref erence to th e dra Wings , Wh erein lik e ref erence num era ls a re us ed to ref er to lik e elem ents th rough out. In th e f olloWing des crip tion, f or purpos es of expla na tion, num erous s peci? c deta ils a re s et f orth in order to prov ide a th orough unders ta nding th ereof . It m a y be ev ident, h oWev er, th a t th e innov a tion ca n be pra cticed With out th es e s peci? c deta ils . In oth er ins ta nces , Well-k noWn s tructures a nd dev ices a re s h oWn in block dia gra m f orm in order to f a cilita te a des cription th ereof . [0030] As us ed in th is a pplica tion, th e term s com ponent a nd s y s tem a re intended to ref er to a com puter-rela ted entity , eith er h a rdWa re, a com bina tion of h a rdWa re a nd s of tWa re, s of tWa re, or s of tWa re in execution. For exa m ple, a com ponent ca n be, but is not lim ited to being, a proces s running on a proces s or, a proces s or, a h a rd dis k driv e, m ultiple s tora ge driv es ( of optica l a nd/or m a gnetic s tora ge m edium ) , a n obj ect, a n executa ble, a th rea d of execution, a progra m , a nd/or a com puter. By Wa y of illus tra tion, both a n a pplica tion running on a s erv er a nd th e s erv er ca n be a com ponent. One or m ore com ponents ca n res ide With in a proces s a nd/or th rea d of execution, a nd a com ponent ca n be loca liz ed on one com puter a nd/ or dis tributed betWeen tWo or m ore com puters . [0031] Ref erring initia lly to th e dra Wings , FIG. 1 illus tra tes a com puter-im plem ented s y s tem 100 th a t f a cilita tes m a intena nce of a m a teria liz ed v ieW. Th e s y s tem 100 ca n Aug. 16 , 2007 com pris e a v ieW crea tion com ponent 102 f or crea ting m a te ria liz ed v ieWs , including outer-j oin v ieWs , a conv ers ion com ponent 104 f or conv erting v ieW expres s ions into a norm a l f orm , a nd a m a intena nce com ponent 106 f or upda t ing th e m a teria liz ed v ieWs crea ted by th e v ieW com ponent 102. [0032] Th e s y s tem f a cilita tes increm enta l m a intena nce of m a teria liz ed SPOJG ( or s elect, proj ection, outer-j oin a nd optiona l group-by ) v ieWs , th a t is , v ieWs Wh ere s om e or a ll of th e j oins a re outer j oins . Th is is a ccom plis h ed by nov el a lgorith m s th a t cons truct increm enta l m a intena nce expres s ions f or SPOJG v ieWs . Conv entiona lly , SPOJ expres s ions ca n be conv erted to a norm a l f orm , f or exa m ple, a j oin dis j unctiv e norm a l f orm . Th e conv ers ion com ponent 104 includes one or m ore a lgorith m ( s ) f or conv erting outer-j oin expres s ions to th is norm a l f orm a nd exploits cons tra ints , f or exa m ple, f oreign-k ey cons tra ints , to reduce m a intena nce ov erh ea d. [0033] Th e s y s tem 100 prov ides th e ? rs t genera l a nd pra ctica l a lgorith m s f or h a ndling v ieWs With m ultiple outer j oins a nd a ls o a ggrega ted outer-j oin v ieWs . Ma teria liz ed v ieWs With a ny com bina tion of s elections , inner j oins , one-s ided outer j oins a nd f ull outer j oins , plus a n optiona l a ggrega tion on top, ca n be h a ndled by th e s y s tem 100. [0034 ] FIG. 2 illus tra tes a m eth odology of m a inta ining a m a teria liz ed v ieW in a ccorda nce With a nov el a s pect. Wh ile, f or purpos es of s im plicity of expla na tion, th e one or m ore m eth odologies s h oWn h erein, e. g. , in th e f orm of a How ch a rt or How dia gra m , a re s h oWn a nd des cribed a s a s eries of a cts , it is to be unders tood a nd a pprecia ted th a t th e s ubj ect innov a tion is not lim ited by th e order of a cts , a s s om e a cts m a y , in a ccorda nce th ereWith , occur in a dif f erent order a nd/or concurrently With oth er a cts f rom th a t s h oWn a nd des cribed h erein. For exa m ple, th os e s k illed in th e a rt Will unders ta nd a nd a pprecia te th a t a m eth odology could a lter na tiv ely be repres ented a s a s eries of interrela ted s ta tes or ev ents , s uch a s in a s ta te dia gra m . Moreov er, not a ll illus tra ted a cts m a y be req uired to im plem ent a m eth odology in a ccorda nce With th e innov a tion. [0035 ] At 200, upda tes of a ta ble T a re receiv ed f or proces s ing. Th e upda tes cons is t of a s et of neW tuples ins erted into ta ble T or a s et of tuples deleted f rom ta ble T. At 202, th e ? rs t v ieW de? nition V is retriev ed to be cons id ered f or m a intena nce. At 204 , a ch eck is perf orm ed to determ ine Wh eth er a ll v ieWs h a v e been proces s ed. If th a t is th e ca s e, proces s ing term ina tes . Oth erWis e, proces s ing con tinues a t 206 , Wh ere it is determ ined Wh eth er th e v ieW ref erences th e upda ted ta ble T. If it does not, th e next v ieW is retriev ed, in 208, a nd proces s ing continues a t 206 . If th e v ieW ref erences ta ble T, th e SPOJ pa rt of th e v ieW de? nition, i. e. , th e non-a ggrega ted pa rt of th e v ieW de? nition, is conv erted into norm a l f rom , a t 210. At 212, th e increm enta l m a intena nce expres s ion f or th e v ieW is genera ted. At 214 , th e v ieW m a intena nce expres s ion is ev a lua ted a nd th e res ult a pplied to th e v ieW, th ereby bringing th e v ieW up to da te With th e ba s e ta bles . Proces s ing th erea f ter continues With th e next v ieW, a t s tep 208, w ith How ba ck to 204 . [0036 ] In opera tion, cons ider th e f olloWing exa m ple. A v ieW, oj _ v ieW, pres ented beloW, cons is ts of outer j oins of th e ta bles Pa rt, Lineitem a nd Orders f rom a TPC-H ( tra ns a ction proces s ing perf orm a nce council, ty pe H bench m a rk ) da ta ba s e. ( TPC is a n orga niz a tion th a t bench m a rk s tra ns a ction US 2007/0192283 A1 proces s ing s y s tem s . Th e TPC-H bench m a rk m ea s ures deci s ion s upport perf orm a nce th a t re? ects m ultiple a s pects of s y s tem ca pa bility to proces s q ueries . ) It is giv en th a t p_ pa rt k ey is th e prim a ry k ey of Pa rt a nd o_ orderk ey is th e prim a ry k ey of Orders , a nd th ere is a f oreign k ey cons tra int betWeen Lineitem a nd Pa rt, a nd a ls o one betWeen Lineitem a nd Orders . crea te v ieW Oj iVl? W a s s elect pipa rtk ey , pina lne, pireta ilprice, oiorderk ey , oicus tk ey , lilinenum ber, liq ua ntity , liextendedprice f rom pa rt le? outer j oin ( orders le? outer j oin lineitem on liorderk ey = oiorderk ey ) on pipa rtk ey = lipa rtk ey [0037] Firs t, a na ly Ze Wh a t ty pes of tuples th e v ieW m a y conta in. Th e j oin betWeen Orders a nd Lineitem Will reta in a ll Lineitem tuples beca us e th e j oin m a tch es th e f oreign k ey cons tra int betWeen l_ orderk ey a nd o_ orderk ey . If th e Orders ta ble conta ins s om e orph a ned Orders tuples With out m a tch ing Lineitem tuples , th e orph a ned tuples Would occur in th e res ult null-extended on a ll Lineitem colum ns . Th e outer j oin With Pa rt Will not elim ina te a ny rea l { Lineitem , Orders } tuples beca us e th is j oin is a ls o a f oreign-k ey j oin but it Will elim ina te a ll tuples th a t a re null-extended on Lineitem colum ns . Pa rt tuples th a t do not j oin With a ny th ing Will be reta ined in th e res ult beca us e th e j oin is a n outer j oin. Hence, th e ? na l res ult Will conta in one com plete { Lineitem , Orders , Pa rt} tuple f or ea ch Lineitem tuple a nd s om e orph a ned Pa rt tuples null-extended on colum ns f rom Lineitem a nd Orders , but no { Lineitem , Orders } a nd no Orders tuples . [0038] N ext, cons ider h oW to m a inta in th e v ieW in res pons e to ins ertions into one of th e ba s e ta bles . Suppos e a s et of neW pa rt tuples is ins erted into th e Pa rt ta ble. Th e v ieW ca n th en be brough t up-to-da te by s im ply ins erting th e neW pa rt tuples , a ppropria tely extended With nulls , into th e v ieW. N oth ing m ore is req uired beca us e th e f oreign k ey cons tra int betWeen Lineitem a nd Pa rt gua ra ntees th a t a neW pa rt tuple does not j oin With a ny Lineitem tuples . If th e neW pa rt tuple did, th en th e j oining Lineitem tuples Would h a v e v iola ted th e f oreign k ey cons tra int. [0039] Ins ertions into th e Orders ta ble Will h a v e no ef f ect on th e v ieW s o noth ing needs to be done. AneW Orders tuple ca nnot j oin With a ny exis ting Lineitem tuples beca us e of th e f oreign k ey cons tra int betWeen Lineitem a nd Orders . Th e neW Orders tuple, a ppropria tely extended With nulls , Will not be conta ined in th e v ieW eith er beca us e, a s dis cus s ed a bov e, orph a ned Orders tuples a re elim ina ted f rom th e v ieW. [004 0] Fina lly , cons ider ins ertions into th e Lineitem ta ble. Suppos e th e neW lineitem s a re conta ined in a ta ble neW_ li neitem s . Th e v ieW ca n th en be upda ted us ing th e f olloWing s eq uence of SQ L s ta tem ents . s elect pipa rtk ey , pina lne, pireta ilprice, oiorderk ey , oicus tk ey , lilinenum ber, liq ua ntity , liextendedprice into # delta l f rom new ilineiterns , orders , pa rt Wh ere liorderk ey = oiorderk ey a nd lipa rtk ey = pipa rtk ey ins ert into Oj iVl? W s elect f rom # delta l Aug. 16 , 2007 -continued delete f rom Oj iVl? W Wh ere oiorderk ey is null a nd pipa rtk ey in ( s elect pipa rtk ey f rom # delta l) [004 1] Th e ? rs t s ta tem ent com putes th e s et of tuples to be ins erted into th e v ieW a nd s a v es th em in a tem pora ry ta ble # delta l ( to a v oid com puting th e s a m e expres s ion tWice) . Th e s econd s ta tem ent a dds th e neW tuples into th e v ieW. Th e neW Lineitem tuples m a y ca us e s om e orph a ned Pa rt tuples to be elim ina ted f rom th e v ieW. Th e th ird s ta tem ent deletes a ll orph a ned Pa rt tuples , if a ny , Wh os e p_ pa rtk ey v a lue occurs a m ong th e neWly ins erted tuples . In oth er Words , it deletes a ll orph a ns Wh o cea s e to be orph a ns beca us e of th e ins ert. [004 2] Th e f olloWing des cription conta ins prelim ina ry m a teria l a nd introduces concepts us ed la ter. [004 3] A s election opera tor Will be denoted in th e norm a l Wa y a s op, Wh ere p is a predica te. A predica te p ref erencing s om e s et S of colum ns is s a id to be s trong or null-rej ecting if it ev a lua tes to f a ls e or unk noWn on a tuple a s s oon a s one of th e colum ns in S is null. Proj ection ( With out duplica te elim ina tion) is denoted by no, Wh ere c is a lis t of colum ns . Borrow ing f rom SQ L ( s tructured q uery la ngua ge) , th e s h ort h a nd T. is us ed to denote a ll colum ns of ta ble T. An opera tor is a ls o needed th a t rem ov es duplica tes ( s im ila r to SQ Ls s elect dis tinct) , Wh ich is denoted by 6 . [004 4 ] A s pecia l predica te N ull( T) a nd its nega tion ~ N ull( T) Will be us ed. N ull( T) ev a lua tes to true if a tuple is null-extended on ta ble T. N ull( T) ca n be im plem ented in SQ L a s T. C is null , Wh ere C is a ny colum n of T th a t ca nnot conta in a null v a lue. Wh en a pply ing th es e predica tes to a s et of ta bles T, th e predica tes N N ( T) a nd N ( T) ca n be us ed Wh ich a re de? ned a s N N ( T) =/\t T~ N ull( t) a nd N ( T) = AKT N ull( t) . [004 5 ] A s ch em a S is a s et of a ttributes ( colum n na m es ) . Let T 1 a nd T2 be ta bles With s ch em a s S 1 a nd S2, res pectiv ely . Th e outer union, denoted by T lUT2, ? rs t null-extends ( pa ds With nulls ) th e tuples of ea ch opera nd to s ch em a Sl ( ES2 a nd th en ta k es th e union of th e res ults ( With out duplica te elim i na tion) . Outer ( s et) di? f erence, denoted by 1: 1, is de? ned in a s im ila r m a nner. [004 6 ] A tuple tl is s a id to s ubs um e a tuple t2 if th ey a re de? ned on th e s a m e s ch em a , tl a grees With t2 on a ll colum ns Wh ere th ey both a re non-null, a nd t1 conta ins f eWer null v a lues th a n t2. Th e opera tor rem ov a l of s ubs um ed tuples of T, denoted by Tj , returns th e tuples of T th a t a re not s ubs um ed by a ny oth er tuple in T. [004 7] Th e m inim um union of ta bles T1 a nd T2 is de? ned a s TloT2=( TlUTl) j . Minim um union h a s loWer precedence th a n j oin. It ca n be s h oWn th a t m inim um union is both com m uta tiv e a nd a s s ocia tiv e. [004 8] Let T1 a nd T2 be ta bles With dis j oint s ch em a s S1 a nd S2, res pectiv ely , a nd p a predica te ref erencing s om e s ubs et of th e colum ns in ( S16 E82) . Th e ( inner) j oin of th e ta bles is de? ned a s T1l><pT2={ ( tl, t2) ] t1eTl, t2eT2, p( tl, t2) } . Th e lef t s em ij oin is de? ned a s Tl><pls T2={ llleTl, ( 3t2eT2] p( tl, t2) ) } , th a t is , a tuple in T1 q ua li? es if it j oins With s om e tuple in T2. Th e lef t a nti( s em i) j oin is de? ned a s US 2007/0192283 A1 Tll><lpla T2={ tlltleTl, ( $ t2eT2] p( tl, t2) ) } , th a t is , a tuple in T1 q ua li? es if it does not j oin With a ny tuple in T2. Th e lef t outerj oin ca n be expres s ed a s Tll><p1 T2=Tll><pT2oT1. Th e righ t outer j oin ca n be expres s ed a s T1><1r T2=T2l><1p1 Tl. Th e f ull outerj oin ca n be expres s ed a s T1l><1pf "T2=Tl ><pT2oTloT2. [004 9] As des cribed h erein, it is a s s um ed th a t ev ery ba s e ta ble h a s a uniq ue k ey , Wh ich is us ua lly th e ca s e in pra ctice. All m a teria liz ed v ieWs a re a s s um ed to h a v e a uniq ue k ey a nd predica tes a re a s s um ed to be null-rej ecting on a ll colum ns ref erenced. [005 0] VieW increm enta l m a intena nce expres s ions a re deriv ed ba s ed on th e j oin-dis j unctiv e norm a l f orm f or SP0] expres s ions . Th rough out th is des cription, th e f ollow ing exa m ple da ta ba s e conta ining th ree ta bles Will be us ed a s m odeled on th e ta bles Cus tom er, Orders , Lineitem of th e TPC-H da ta ba s e. C( ck , cn, cnk ) , O( ok , ock , od, otp) , L lok , ln, lpk , lq , lp) [005 1] N ulls a re not a lloWed in a ny of th e colum ns . Underlined colum ns f orm th e k ey of ea ch ta ble. TWo f oreign k ey cons tra ints a re de? ned: O. ock ref erences C. ck a nd L. lok ref erences O. ok . [005 2] Cons ider a n exa m ple v ieW h a v ing th e f olloWing de? nition, Q =C><ck : ock lo( O><ok : lok lo( 0lp>5 OOL) ) [005 3] Th e v ieW conta ins a ll cus tom ers togeth er With th eir orders , if a ny , a nd line item s With a price ov er 5 00, if a ny . Th e res ult Will conta in tuples of th ree dif f erent ty pes . [005 4 ] l. COL-tuples , th a t is , tuples f orm ed by conca t ena ting a tuple f rom C, a tuple f rom O a nd a tuple f rom L. Th ere Will be one COL-tuple f or ev ery L tuple th a t s a tis ? es th e predica te lp>5 00. [005 5 ] 2. CO-tuples , th a t is , tuples com pos ed by con ca tena tion of a tuple f rom C, a tuple f rom O a nd nulls f or a ll colum ns of L. Th ere Will be one s uch tuple f or ev ery O-tuple th a t does not j oin With a ny L-tuple s a tis f y ing lp>5 00. [005 6 ] 3. C-tuples , th a t is , tuples com pos ed of a tuple f rom C With nulls f or a ll colum ns of O a nd L. Th ere Will be one s uch tuple f or ev ery C tuple th a t does not j oin With a ny tuple in O. [005 7] Th e res ult conta ins a ll tuples in th e j oin Cl><Ck =OCk O l>q ok =lok ( olp>s 00L) , a ll tuples in th e j oin Cl><1Ck =OCk O, a nd a ls o Aug. 16 , 2007 a ll tuples in C. Ea ch of th es e th ree s ub-res ults is repres ented in th e res ult in a m inim a l Wa y . For exa m ple, if a tuple ( c l, null, null) a ppea rs in th e res ult, th en th ere exis ts a tuple cl in C, but th ere is no tuple 01 in 0 s uch th a t ( cl, ol) a ppea rs [005 8] Th e expres s ion ca n be rew ritten a s th e m inim um union of th ree term s com pris ed s olely of inner j oins , Wh ich is th e j oin-dis j unctiv e f orm of th e origina l SPOJ expres s ion. [005 9] As illus tra ted by th e exa m ple, a n SPOJ expres s ion E ov er a s et of ta bles U ca n be conv erted to a norm a l f orm cons is ting of th e m inim um union of term s com pos ed f rom s elections a nd inner j oins ( but no outer j oins ) . More f or m a lly , th e j oin-dis j unctiv e norm a l f orm of E ca n be repre s ented a s th e f olloWing, Wh ere rcc proj ects th e res ult onto th e des ired colum ns C a nd ea ch term Ei is of th e f orm Til, Ti2 . . . Tim is a s ubs et of th e ta bles in U. Predica te pi is th e conj unction of a s ubs et of th e s election a nd j oin predica tes f ound in th e origina l f orm of th e q uery . [006 0] Th e f olloWing tra ns f orm a tion rules a re us ed f or conv erting SPOJ expres s ion to j oin-dis j unctiv e f orm . if p( l) ref erences only T1 [006 1] Rule ( 4 ) f olloWs f rom th e obs erv a tion th a t a ll tuples origina ting f rom th e term T2 in ( Tl><1pT2oT2) Will be null-extended on a ll colum ns of T1. All th os e tuples Will be dis ca rded if p( l) is s trong on T1. Rule ( 5 ) f olloWs f rom th e rule op( 'l) ( Tl>4 pT 2) =( O'p( l) Tl) ) q pT2 by expa nding th e tWo outer j oins . [006 2] Th e f olloWing exa m ple illus tra tes conv ers ion of a n SPOJ expres s ion us ing th e a bov e rules . p( i, j ) denotes a predica te th a t ref erences colum ns in ta bles Ti a nd Ti. by Rule ( 1) ( ( U'MUTI) p( l, 2) T2) ) '\] ; f : i2, 3) T3 by Rule ( 4 ) ( T1) 5 pm ! m om ( I iiw n by including s election predica te in j oin ( T1 lpuupum Tz q pm lm ' by Rule ( 2) ( Tl/ii p( 1>rp( 1. 2>T2) 6 T3 US 2007/0192283 A1 [006 3] Ea ch term in th e j oin-dis j unctiv e f orm of a SPOJ expres s ion produces tuples With a uniq ue null-extens ion pa ttern. Suppos e th e com plete s et of opera nd ta bles f or th e expres s ion is U. A term in th e j oin-dis j unctiv e f orm is de? ned ov er a s ubs et S of U a nd h ence, produces tuples th a t a re null extended on U-S. Th e ta bles in s ubs et S a re ca lled th e term s s ource ta bles . [006 4 ] A tuple produced by a term With s ource ta ble s et S ca n only be s ubs um ed by tuples produced by term s Wh os e s ource ta ble s et is a s upers et of S. Th e s ubs um ption rela tions h ips a m ong term s ca n be m odeled by a D AG ( directed a cy clic gra ph ) , Wh ich is ref erred to a s a s ubs um ption gra ph of th e SP0] expres s ion. [006 5 ] D e? nition. Let E=J1 C ( E16 . . . oEn) be th e j oin dis j unctiv e f orm of a SPOJ expres s ion. Th e s ubs um ption gra ph of E conta ins a node ni f or ea ch term Ei in th e norm a l f orm , a nd th e node is la beled With th e s ource ta ble s et Si of E. Th ere is a n edge f rom node ni to node nj , if Si is a m inim a l s upers et of Si. Si is a m inim a l s upers et of SJ- if v th ere does not exis t a node nk in th e gra ph s uch th a t SJ-RSk RS1. [006 6 ] Cons ider th e f olloWing exa m ple th a t s h oWs tWo SPOJ v ieWs , V1 a nd V2, th eir norm a l f orm s . FIG. 3 illus tra tes s ubs um ption gra ph s f or th e exa m ple SPOJ v ieWs V1 a nd V2. W L) pm ) [006 7] Th e m inim um -union opera tors in th e j oin-dis j unc tiv e norm a l f orm h a v e tWo f unctions : to elim ina te s ubs um ed tuples a nd to ta k e th e union of th e rem a ining tuples . By ? rs t elim ina ting s ubs um ed tuples f rom ev ery term , th e m inim um unions ca n be repla ced by outer unions . Th e res ulting f orm is us ef ul beca us e it clea rly s h oWs Wh a t term s a re a f f ected by a n upda te a nd h oW. [006 8] Subs um ption a m ong term s is not a rbitra ry ; Wh en ch eck ing Wh eth er a tuple of a term is s ubs um ed, it is s u? icient to ch eck a ga ins t tuples in pa rent term s . Th e f olloWing lem m a s h oWs h oW to elim ina te s ubs um ed tuples f rom a term . [006 9] Lem m a . Let Ei be a term in th e j oin-dis j unctiv e norm a l f orm E of a n SPOJ expres s ion. Th en th e s et of tuples genera ted by Ei th a t a re not s ubs um ed by a ny oth er tuples in E ca n be com puted a s , Wh ere El, E2, . . . Eim a re th e pa rent term s of Ei a nd th e j oin predica te q is a n eq uij oin ov er colum ns f orm ing a k ey of E. [0070] D i is ca lled th e net contribution of term Ei beca us e th e tuples of D i a re not s ubs um ed by a ny oth er tuples , a nd th us , a ppea r explicitly in th e v ieW res ult. Exa m ples of th e net contribution f orm a re prov ided inf ra . Aug. 16 , 2007 [0071] Th eorem . Let E be a n SPOJ expres s ion With nor m a l f orm rcc ( EloE2o . . . oEn) . Th en E16 E26 . . . 6 En=D 1UD 2U . . . UD n Wh ere ea ch D i is com puted f rom Ei a s de? ned in th is Lem m a . [0072] Th e f orm D l U . . . UD n is ca lled th e net-contri bution ( norm a l) f orm of th e expres s ion. Th is f orm is im por ta nt beca us e th ere is no intera ction a m ong net contributions f rom dif f erent term s , Wh ich m ea ns th a t ea ch term ca n be m a inta ined independently f rom oth er term s . [0073] Ref erring noW to FIG. 4 , th ere is illus tra ted a m eth odology of genera ting a s ubs um ption gra ph a nd net contributions of term s to th e v ieW. At 4 00, th e v ieW de? ni tion is retriev ed. At 4 02, th e SP0] pa rt of th e v ieW expres s ion is conv erted into j oin-dis j unctiv e norm a l f orm cons is t ing of th e m inim um union of term s com pos ed of inner j oins . At 4 04 , a s ubs um ption gra ph is crea ted f rom th e norm a l f orm , Wh ich rev ea ls th e s ubs um ption ( pa rent-ch ild) rela tion s h ips a m ong th e term s . At 4 06 , th e term expres s ions in th e norm a l f orm a nd th e s ubs um ption gra ph a re us ed to crea te expres s ions de? ning th e net contribution of ea ch term to th e v ieW. Th e net contribution expres s ion f or a term is con s tructed a ccording to th e Lem m a a bov e. At 4 08, th e expres s ion de? ning th e tota l net contribution is cons tructed by connecting a ll net-contribution expres s ions by outer union opera tors . [0074 ] FolloWing is a des cription of h oW to increm enta lly m a inta in a n SPOJ v ieW Wh en a s ingle ba s e ta ble is m odi? ed. Only ins ertions or deletions a re a ddres s es h ere; a n upda te ca n be trea ted a s a deletion f olloWed by a n ins ertion. Th e f ocus h ere is on deriv ing correct m a intena nce expres s ions a nd not neces s a rily th e m os t ef ? cient ones . More ef ? cient expres s ions a re deriv ed inf ra . [0075 ] A ? rs t ta s k is to identif y Wh ich term s m a y be a f f ected by a n ins ertion or a deletion. Cons ider a v ieW V a nd s uppos e one of its ba s e ta bles T is m odi? ed. Th is m a y ch a nge th e net contribution of a term but only if T occurs in th e expres s ion de? ning D . By ins pection of th e f orm of th e expres s ion f or D , it is a ppa rent th a t th e ch a nge m a y a f f ect th e res ult in one of th ree Wa y s : [0076 ] in Ti; 1. D irectly , Wh ich occurs if T is a m ong th e ta bles [0077] 2. Indirectly , Wh ich occurs if T is not a m ong th e ta bles in Ti but it is a m ong th e s ource ta bles of one or m ore of its pa rent nodes ( term s ) ; a nd [0078] 3. N o ef f ect, oth erWis e. [0079] Ba s ed on th is cla s s i? ca tion of h oW term s a re a f f ected, a v ieW m a intena nce gra ph ca n be crea ted, a s f olloWs . [0080] 1. Elim ina te f rom th e s ubs um ption gra ph a ll nodes ( term s ) th a t a re una f f ected by th e upda te of T. [0081] 2. Ma rk th e nodes of th e reduced gra ph by D or I depending on Wh eth er th e node ( term ) is a f f ected directly or indirectly . [0082] 3. D rop a ll outgoing edges f rom nodes m a rk ed With 1. [0083] FIG. 5 s h oWs th ree m a intena nce gra ph s f or v ieW Vl th a t a re deriv ed f rom th e s ubs um ption gra ph f or VI of US 2007/0192283 A1 FIG. 3. C is a m em ber of th e s ource s et of a ll th ree nodes s o th e m a intena nce gra ph ( a ) f or upda tes to C reta ins a ll th ree nodes a nd th ey a re m a rk ed With s upers cript D . Th e m a in tena nce gra ph ( b) f or upda tes to 0 a ls o reta ins a ll th ree nodes . 0 is a m em ber of th e s ource s ets of nodes { C, O, L} a nd { C, 0} ; th ey a re a f f ected directly a nd m a rk ed With s upers cripted D . O is not a m em ber of th e s ource s et of node { C} but it is a m em ber of th e s ource s et of its pa rent; th is node is a f f ected indirectly a nd m a rk ed With 1. Th e m a inte na nce gra ph ( c) f or upda tes to L reta ins only nodes { C, O, L} a nd { C, O} . N ode { C} is dropped beca us e neith er it nor its pa rent ref erence ta ble L. [0084 ] Ref erring noW to FIG. 6 , th ere is illus tra ted a m eth odology of cons tructing a m a intena nce gra ph identif y ing term s a f f ected by a n upda te, in a ccorda nce With th e dis clos ed innov a tion. At 6 00, th e expres s ion de? ning th e v ieW is retriev ed. At 6 02, th e SP0] pa rt of th e v ieW expres s ion is conv erted into j oin-dis j unctiv e norm a l f orm . At 6 04 , th e s ubs um ption gra ph is cons tructed in th e m a nner des cribed ea rlier. At 6 06 , term s una f f ected by th e upda te a re elim ina ted f rom th e s ubs um ption gra ph . At 6 08, ea ch rem a ining node is cla s s i? ed a nd m a rk ed a ccording to Wh eth er it repres ents a directly -a f f ected term or a n indi rectly -a lf ected term . At 6 10, a ll outgoing edges a re dropped f rom term s m a rk ed indirectly a f f ected. [0085 ] Follow ing is a des cription of v ieW m a intena nce. AlV is us ed to denote th e ( outer) union of a ll ch a nges to directly a f f ected term s , a nd A2V to denote th e s a m e f or indirectly a f f ected term s . Sim ila rly , AID i a nd A2D i denote th e ch a nge in th e net contribution D i of a directly or a n indirectly a f f ected term , res pectiv ely . VieW m a intena nce ca n be perf orm ed in th e f olloWing th ree s teps . [0086 ] l. Th e a f f ected ba s e ta ble is upda ted ? rs t. [0087] 2. If th ere a re no directly a f f ected term s , We a re done; oth erWis e, com pute a nd a pply A1 to th e v ieW. [0088] 3. If th ere a re no indirectly a f f ected term s , We a re done; oth erWis e, com pute a nd a pply A2 to th e v ieW. [0089] Accordingly , FIG. 7 illus tra tes a m eth odology of perf orm ing v ieW m a intena nce in a ccorda nce With a n inno v a tiv e a s pect. At 700, v ieW m a intena nce is initia ted. At 702, th e a f f ected ba s ed ta ble is upda ted ? rs t. As a s ide ef f ect of th is opera tion, th e s et of ins erted tuples or th e s et of deleted tuples is obta ined. At 704 , th e m a intena nce gra ph is ch eck ed f or directly -a f f ected term s . If no s uch term s a re f ound, a t 706 , th e proces s term ina tes . If s uch term s a re f ound, a t 706 , How is to 708, Wh ere th e outer union of ch a nges to th e net contributions of directly -a f f ected term s is com puted, a nd th es e a re a pplied to th e v ieW. At 710, th e m a intena nce gra ph is ch eck ed f or indirectly -a f f ected term s . Aga in, a t 712, no s uch term s a re f ound, th e proces s term ina tes . If s uch term s a re f ound, a t 712, How progres s es to 714 , Wh ere th e outer union of ch a nges to th e net contributions of indirectly a lf ected term s is com puted, a nd th es e a re a pplied to th e v iew . [0090] Follow ing a re deriv a tions of m a intena nce expres s ions f or ins ertions a nd f or deletions . Firs t, cons truct v ieW m a intena nce expres s ions f or a v ieW V in th e ca s e of ins er tions . Th e s et of neW roWs ins erted into a ta ble T is denoted by AT. If Ei ( D i) is a n expres s ion, th e expres s ion obta ined f rom Ei ( D i) by repla cing ev ery occurrence of T by AT is denoted by EiAT ( D iAT) . Aug. 16 , 2007 [0091] Cons ider th e f olloWing exa m ple. A s et of tuples AO h a s been ins erted into ta ble 0 a nd it is des ired to m a inta in v ieW V1. FIG. 5 ( b) s h oWs th e m a intena nce gra ph f or th is ca s e. TWo nodes a re directly a f f ected, na m ely { C, O, L} a nd { C, O} . Th e neW tuples to be ins erted into th e v ieW ca n be com puted by s ubs tituting O w ith A0 in th e expres s ion f or th e net contribution of ea ch term . Th is giv es th e f olloWing Al-expres s ions , [0092] Predica te q of th e a nti-s em ij oin eq ua ls ( l. ok =r. ok ) Wh ere l. ok ( r. ok ) des igna tes th e colum n ok f rom th e lef t ( righ t) opera nd of th e j oin. [0093] N ext, cons ider th e indirectly a f f ected term A new 0 tuple m a y j oin With s om e C tuple th a t prev ious did not j oin With a ny th ing. Th e term m a y currently conta in s uch orph a ned C tuples , Wh ich m us t noW be deleted. Th e v ieW tuples to be deleted ca n be com puted a s , = ( a 5 15 % Wh ere th e j oin predica te q eq ua ls ( l. ck =r. ck ) . [0094 ] Com bining th e pieces , th e f olloWing com plete m a intena nce expres s ion ca n be obta ined. V1( C, 0+ A0, L) =VI( C, O, L) H-JAID COLL1-JAID CO UAZD C [0095 ] Lem m a . Cons ider a term in th e norm a l f orm of a SPOJ v ieW Wh os e net contribution is de? ned by D i=Eil><1q 1a ( EilU . . . UEim ) Suppos e ta ble T h a s been upda ted by ins erting AT tuples . If th e term is directly a f f ected by th e ins ertion, th e tuples a dded to th e net contribution of th e term ca n be com puted a s , AID FD Q ALEQ ATIXILIla ( EHATLTJ . . . k -JEim AT) . If th e term is indirectly a f f ected, th e tuples deleted f rom th e net contribution of th e term ca n be com puted a s , A2ni=nil><lq ls ( EilATh -J . HEFJEi AT) Wh ere q is a n eq uij oin predica te ov er a uniq ue k ey of E. [0096 ] Th e prev ious exa m ple cons idered v ieW V1 a nd ins ertions into 0; noW cons ider deletions f rom 0. As in th e prev ious ca s e, tWo term s a re directly a f f ected, na m ely { C, O, L} a nd { C, O} , s ee FIG. 5 ( b) . Th e Al-expres s ions f or th e directly -a f f ected term s a re th e s a m e a s f or ins ertion but noW th e res ulting tuples a re deleted f rom th e v ieW. Th ere is one indirectly -a f f ected term A deleted 0 tuple m a y be th e la s t tuple to j oin With a C tuple. If s o, it s h ould a ppea r in th e res ult of th e { C} term a f ter th e upda te. Th e tuples to be ins erted ca n be com puted a s , Wh ere th e j oin predica te q eq ua ls ( l. ck =r. ck ) .