60 likes | 188 Views
E 31 E 32 E 33. E 3. S. 4 4 3 3 3 2 3 4 4 4 4 3 4 3 4 4 3 4. 1 1 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 1.
E N D
E31 E32 E33 E3 S 4 4 3 3 3 2 3 4 4 4 4 3 4 3 4 4 3 4 1 1 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 0 E 8 2 1 7E3pt (purity template) 4 1 0 3 0 0 1 1 0 1 0 0 2 2 1 2 18 0 2 3 2 1 13021 02 C41 1 0 0 1 1 1 S5 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 2 1 4 E31 2 0 1 0 0 1 1 0 1 0 0 0 2 1 1 10 01 3 3 2 1 021 2 5 0 0 3 E32 2 1 0 2 2 0 0 1 8 230 01 13 0 C 4 0 0 3 E33 2 1 0 1 2 0 0 1 7 230 1 13 0 4 3 C4 purity tree 2 1 7 1 E31NZP1 [] 1111 0110 00 10 1 00 0 11 0111 0110 00.00 1100 00.11 00 1 11.11 0 1 S5 NZP1 [] 11 00 0 11 00 1 10 10 0.0 01 0.1 10 C4 NZP1 [] 11 01 0 10 11 1 11 11 1.1 1 1 S5C4NZP1 [] 1111 0000 00 1010 0000 01 1111 0000 10 1000 1000 11 1100 1100 00.00 0011 00.10 1100 01.00 0011 01.01 0 1 01.10 1100 01.11 1 0 11.01 1 1 11.11 0 0 E32 NZP1 [] 1001 0000 00 10 1 00 0 11 1001 1000 00.00 0011 00.11 11 0 11.11 1 0 E33NZP1 [] 1001 0000 00 10 1 00 0 11 1001 1000 00.00 0011 00.11 01 0 11.11 1 0
Query: Find the GPA of married students in classes that require permits. 1. Form the selection vectors, S5 = 0110 1100 and C4 = 1100 111 on the dimensions and “cross” them. (one for each dimension - if there’s no selection on a given dimension, use the pure1 P-tree for it - I.e. select everything) 3. And with E31 , multiply the rc by 4 4. And with E32 , multiply the rc by 2 5. And with E33 , multiply the rc by 1 6. Add values 7. Calculate S5xC4^E3pt 8. Divide sum by rc(S5xC4^E3pt) E31 E32 E33 E3pt 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 0 S5 NZP1 [] 11 00 0 11 00 1 10 10 0.0 01 0.1 10 S5C4 NZP1 [] 1111 0000 00 1010 0000 01 1111 0000 10 1000 1000 11 1100 1100 00.00 0011 00.10 1100 01.00 0011 01.01 0 1 01.10 1100 01.11 1 1 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C4 NZP1 [] 11 01 0 10 11 1 11 11 1.1 1 1 3. 4. 5. 7. E31NZP1 [] 1111 0110 00 10 1 00 0 11 0111 0110 00.00 1100 00.11 00 1 11.11 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 E32 NZP1 [] 1001 0000 00 10 1 00 0 11 1001 1000 00.00 0011 00.11 11 0 11.11 1 0 E33NZP1 [] 1001 0000 00 10 1 00 0 11 1001 1000 00.00 0011 00.11 01 0 11.11 1 0 6. 2*22 + 4*21 + 4*20 = 20 8. 6 8. 20/6 = 3.33
Query: What is the GPA of married grad students taking courses in rooms holding less than 45 students? 1. Form S= S5 ^ SV(S.y > 4) = 0110 1100 ^ 0000 1111 = 0000 1100 and C=SV(C.cp < 45) = 1000 001: 2. Cross the P-tree forms of those vectors (one for each dimension) 3. And with E31, mult rc by 4; with E32, mult rc by 2; with E33 , mult rc by 1 4. Add values 5. Calculate rc(S5xC4^E3pt) 6. Divide E31 E32 E33 E3pt 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6. 2*22 + 0*21 + 0*20 = 8 7. 2 8. 8/2 = 4
Query: Change the grad of the married student in FM (Finite Math) from B to A. (I don’t remember the name or s-# or c-# and therefore hope there is only one such student!!) 1. Form S = S5 = 0110 1100 and C=SV(C.nm = FM) = 0100 000: 2. Cross the P-tree forms of those vectors (one for each dimension) 3. Calculate S5xC4^E3pt 4.Lock the record and change the grade. What is the best structure for CC? If bfr=2 and the file is clustered on s (allowing only 2 students per page therefore using ( DIV2(s), c ) as RIDs) one can use the OR-rollup of the QV to get the pg-RV (in ptree form). E31 E32 E33 E3pt 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 WRITE-ROLL null Rv0 NZP1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 RV (tuple) NZP1 [] 1000 0000 00 1000 0000 00.11 0001 Rvi-2NZP1 POST Rvi-1NZP1 4. It is student with qid=00.00.11 and therefore coordinates, (001, 001) or (1,1). That is enrollment of s=1 and c=1. Use the green Ptree to request access to this enrollment record, By ANDing this ptree into the write-ROLL ptree, if you get a 1, wait, if you get a 0 then OR it into the ROLL and you have the lock. RViNZP1 [] 1000 0000 00 1000 0000 00.11 0001
Use the ROLL as the log?? That is, retain all entries in the ROLL (both read and write) back to the last checkpoint. • Thesis topic: Develop this approach and prove it effective for all types of checkpointing algorithms, all UNDO/REDO scenarios, etc. How much improvement does it offer? • Note that finding the lcv (last committed value) should be easy PG NZP1 [] 10 00 0 10 10 val 5. When access is available, use rolled-up RV (to S only) determine exactly which pages need to be accessed (pg=0) WRITE-ROLL null Rv0 NZP1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 RV (tuple) NZP1 [] 1000 0000 00 1000 0000 00.11 0001 Rvi-2NZP1 POST Rvi-1NZP1 4. It is student with qid=00.00.11 and therefore coordinates, (001, 001) or (1,1). That is enrollment of s=1 and c=1. Use the green Ptree to request access to this enrollment record, By ANDing this ptree into the write-ROLL ptree, if you get a 1, wait, if you get a 0 then OR it into the ROLL and you have the lock. RViNZP1 [] 1000 0000 00 1000 0000 00.11 0001