




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、完美WORD格式专业整理知识分享复习题1、试分别判断下列图中G侪口 G2a/VGi=/bcGi a v b c否互模拟(bisimulation),并说明理由: a .G2=b/cG2Ab ccdJ答案:在图中标出各点的状态,我们构造关系”明曲倡向色&的),可知G2可以*II拟G1,下面我们讨论是否可模拟,在G2中2)有一个a变换可对应到G1中2个变换,即(&国小4。但0有两个变换b, c,而在G1中仅存在只有b或只有c的状态点,可知G1和G2不能互模拟。(2)如图,标出各状态点,构造有关系S=狷胤纵说以国心出0)戏而可知其中G1中的点均可由G2中的点模拟,下面我们考虑电q6歌
2、。百创可知同样其中G2中的点均可由G1中的点模拟.所以G1和G2为互模拟的。试给出其Strong DataGuide 图答案:3、Consider the relation, following query :r , shown in Figure 5.27 . Give theresult ofthebuildingrooHumnibcrconrseJdsecddGarfield359ABIO-1011Garfield359BBIO-1012Saucon651ACS-1012Saucon550CCS-3191Painter705DMU-1991Painter403DFIN-2011Figur
3、e 5.27Query 1 :select building , room number; time_slo_ id , count (*) from rgroup by rollup (building , room number; time_slo_ id )Query 1 :select building ; room number; time_slo_ id ; count (*) from rgroup by cube ( building ; room number; time_slo_ id )答案:Query 1返回结果集:为以下四种分组统计结果集的并集且未去掉重复数据。bui
4、ldingroom numbertime_slo_ idcount (*)产生的分组种数:4种;种:group by A,B,CGarfield359A1Garfield359B1Saucon651A1Saucon550C1Painter705D1Painter403D1第二种:group by A,BGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter705D1Painter403D1第三种:group by AGarfield359A2Garfield359B2Saucon651A2Saucon550C2Painter705D2Pa
5、inter403D2第四种:group by NULL 。本没有group by NULL 的写法,在这里指是为了方便说明,而采用之。含义是:没有分组,也就是所有数据做一个统计。例如聚合函数是SUM的话,那就是对所有满足条件的数据进行求和。Garfield359A6Garfield359B6Saucon651A6Saucon550C6Painter705D6Painter403D6Query 2 :group by后带rollup 子句与group by后带cube子句的 唯一区别 就是:带cube子句的group by会产生更多的分组统计数据。cube后的列有多少种组合(注意组合是与顺序无关
6、的)就会有多少种分组。返回结果集:为以下八种分组统计结果集的并集且未去掉重复数据。buildingroom numbertime_slo_ idcount (*)产生的分组种数:8种笫L 种:group by A,B,CGarfield359A1Garfield359B1Saucon651A1Saucon550C1Painter705D1Painter403D1第二种:group by A,BGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter705D1Painter403D1第三种:group by A,CGarfield359A1G
7、arfield359B1Saucon651A1Saucon550C1Painter705D2Painter403D2第四种:group by B,CGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter705D1Painter403D1第五种:group by AGarfield359A2Garfield359B2Saucon651A2Saucon550C2Painter705D2Painter403D2种:group by BGarfield359A2Garfield359B2Saucon651A1Saucon550C1Painter7
8、05D1Painter403D1第七种:group by CGarfield359A2Garfield359B1Saucon651A2Saucon550C1Painter705D2Painter403D2第八种:group by NULLGarfield359A6Garfield359B6Saucon651A6Saucon550C6Painter705D6Painter403D64、 Disks and Access Time Consider a disk with a sector 扇区 size of 512 bytes, 63 sectors per track 磁道,16,383 t
9、racks per surface 盘面,8 double-sided platters 柱面(i.e., 16 surfaces). The disk plattersrotate at 7,200 rpm (revolutions per minute). The average seek time is 9 msec, whereas the track-to-track seek time is 1 msec.Suppose that a page size of 4096 bytes is chosen. Suppose that a file containing 1,000,00
10、0 records of 256 bytes each is to be stored on such a disk. No record is allowed to span two pages (use these numbers in appropriate places in your calculation).(a) What is the capacity of the disk?(b) If the file is arranged sequentially on the disk, how many cylinders are needed?(c) How much time
11、is required to read this file sequentially?(d) Howmuchtime is needed to read 10%of the pages in the file randomly?Answer:(a) Capacity = sector size * num. of sectors per track * num. of tracks per surface * num of surfaces = 512 * 63 * 16383 * 16 = 8 455 200 768 (b) File: 1,000,000 records of 256 by
12、tes each Num of records per page: 4096/256 = 16 1,000,000/ 16 = 62,500 pages or 62,500 * 8 = 500,000 sectors Each cylinder has 63 * 16 = 1,008 sectorsSo we need 496.031746 cylinders.(c) We analyze the cost using the following three components:Seek time: This access seeks the initial position of the
13、file (whose cost can be approximated using the average seek time) and then seeks between adjacent tracks 496 times (whose cost is the track-to-track seek time). So the seek time is 0.009 + 496*0.001 = 0.505 seconds.Rotational delay:The transfer time of one track of data is 1/ (7200/60) = 0.0083 seco
14、nds. For this question, we use 0.0083/2 as an estimate of the rotational delay (other numbers between 0 and 0.00415 are also fine). So the rotational delay for 497 seeks is 0.00415 * 497 = 2.06255.Transfer time: It takes 0.0083*(500000/63)= 65.8730159 seconds to transfer data in 500,000 sectors.Ther
15、efore, total access time is 0.505 + 2.06255 + 65.8730159 = 68.4405659 seconds.(d) number of pages = 6250time cost per page: 0.009 (seek) + 0.0083/2 (rotational delay) + 0.0083*8/63 (transfer) = 0.0142 seconds total cost = 6250 * 0.0142 = 88.77 seconds5、Disk Page Layout The figure below shows a page
16、containing variable length records. The page size is 1KB(1024 bytes). It contains 3 records, some free space, and a slot directory in that order. Each record has its record id, in the form of Rid=(page id, slot number), as well as its start and end addresses in the page, as shown in the figure.321St
17、art of(J fret spaceSLOT DIRECTORYNowa new record of size 200 bytes needs to be inserted into this page. Apply the record insertion operation with page compaction, if necessary. Showthe content of the slot directory after the new record is inserted. Assumethat you have only the page, not any other te
18、mporary space, to work with.Page Format: Variable Length RecordsSLOT DIRECTORYPointer to 占 3Tt of free space* CompncHoti: get nil slots whose offset is not -1, st)rf bi/ startddresw move their records up in sorted order. No change of rids!Answer:Content of the slot directory, from left to right, is:
19、 (650, 200), (0, 200), (500, 150), (200, 300), 4, 8506、Buffer Management for File and Index Accesses Consider the following two relations:student(snum:integer, sname:char(30), major:char(25), standing:char(2), age:integer)enrolled(snum:integer, cname:char(40)The following index is available:A B+ Tre
20、e index on the <snum> attribute of the student relation.Assume that the buffer size is large enough to store multiple paths of each B+ Tree but not an entire tree.(a) Consider Query 1 and Query 2 that retrieve the snuM s of students who have taken (Database Systems' and (Operating Systems
21、', respectively, from the enrolled table. We know that Query 1 will be executed before Query 2, and both queries are executed using a file scan of the enrolled table.Which replacement policy would you recommend for the buffer manager to use to support this workload?(b) Nowassumethat we have retr
22、ieved the snumi s of students who have taken ( Database Systems' from the enrolled table. In the exact order of the retrieved snum ' s (not necessarily in sorted order),we then retrieve the names of those students via repeated lookups in the B+ Tree on <snum>.For these repeated accesse
23、s to the index on student.snum, which replacement policy would you recommend for efficient buffer management?Query 1: select snum from student s, enrolled e where s.snum=e.snum and cname like ' Database Systems'Query 2: select snum from student s, enrolled e where s.snum=e.snum and cname lik
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 情绪洞察报告范文
- 二零二五年度电子商务股东股权转让与物流配送协议
- 二零二五年度排水沟工程风险评估合同范本
- 2025年度餐饮企业员工福利待遇劳动合同
- 2025年度智能家居产品推广介绍费合同书
- 二零二五年度生态园区前期物业服务合同
- 二零二五年度医疗设备试用与产品推广及技术服务合同
- 二零二五年度个体经营企业资金走账与审计合同
- 二零二五年度光伏发电施工安全责任书
- 二零二五年度网络安全培训商业技术合作保密协议书
- 2024年国家公务员考试《申论》真题(地市级)及答案解析
- 批判性思维能力测量表(CDTI-CV)-彭美慈
- 《现代家政导论》电子教案 4.1模块四项目一家政教育认知
- 一年级数学个位数加减法口算练习题大全(连加法-连减法-连加减法直接打印版)
- 羽毛球课件教学课件
- 幼儿园6S管理培训课件
- (人教PEP2024版)英语一年级上册Unit 4 教学课件(新教材)
- 2024年重庆市中考英语试卷(AB合卷)附答案
- 中医基础理论(一)
- Q-GDW 12461-2024 电力物资包装通.用技术规范
- 新人教版二年级数学下册期末考试卷及答案【1套】
评论
0/150
提交评论