1. 试述查询优化在关系数据库系统中的重要性和可能性。
2. 假设关系R(A,B)和S(B,C,D)情况如下:R有20000个元组,S有1200个元组,一个块能装40个R的元组,能装30个S的元组,估算下列操作需要多少次磁盘块读写。
(1)R上没有索引,select * from R;
(2)R中A为主码,A有3层B+树索引,select * from R where a=10;
(3)嵌套循环连接R⋈S;
(4)排序合并连接R⋈S,区分R与S在B属性上已经有序和无序两种情况。
3. 对学生-课程数据库,查询信息系学生选修了的所有课程名称。
Select cname
from student,course,sc
Where student.sno=sc.sno and sc.cno=course.cno and student.sdept=”IS”
试画出用关系代数表示的语法树,并用关系代数表达式优化算法对原始语法进行优化处理,画出优化后的标准语法树。
4. 对于下面的数据库模式
Teacher(tno,tname,tage,tsex);department(dno,dname,tno);work(tno,dno,year,salary)假设teacher的tno属性,department的dno属性以及work的year属性上有B+树索引,说明下列查询语句的一种较优的处理方法。
(1)select * from teacher where tsex=’女’
(2)Select * from department where dno<301
(3)Select * from work where year<>2000
(4)Select * from work where year>2000 and salary<5000
(5)Select * from work where year<2000 or salary<5000
5. select tname
From teacher,department,work
Where teacher.tno=work.tno and department.dno=work.dno and
Department.dname=”计算机系”and salary>5000
画出语法树以及用关系代数表示的语法树,并对关系代数语法树进行优化,画出优化后的语法树。
6. 试述关系数据库管理系统查询优化的一般准则。
7. 试述关系数据库管理系统查询优化的一般步骤。

