⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exam3.txt

📁 ssd7考试exam3,绝对有用~欢迎下载
💻 TXT
字号:
*************************PART 1************************** 
QUESTION  1
The transaction should begin after step 1, while end after step 2.The isolation level should be READ UNCOMMIT.

Reason:
A transaction should only contain the operation to access the database, and should not include the operation of the user's interactivation of the application. But the first step1 is only chooses a part category from a menu and the third step3 is only displays all the retrieved parts' information.Both of them don't have any influence in making the data inconsistent,so the transaction is not include those two steps.

Because the user only need to read the part's information and would not write them. In order to make the best concurrency. We can set the isolation to READ UNCOMMIT.

QUESTION  2
The transaction should begin first step of part2 and end both after the second and third step of the part2.

Reason:
Because the part1 and the first step of the application does't relate to the any writing operaion and only writing operaion is to make the data inconsistent.So we should start our transaction after the first step of the part2.Because the transcaion have a if-else statement ,so we should set two commit operation both at the end of the the second and third step of the part2.

Set the isolation level the transaction  as serializable.
Because all the operations of this tranction are writing operaions so it must be set as serializable which can avoid the tranction inconsistent.

*************************PART 2************************** 
QUESTION  1

The first query is set a hash index on the column encrypted_name.And the second query is set a b_tree index on column family_income.Because the hash index can improve the select operation when it is a equal operation and the b_tree index can improve the select operation when it lookup in a range.

QUESTION  2

We can set a clustering index on the column family_income.Because the clustering index will improve the operation when it is used in a range and the selective on the corresponding column is very low. 

QUESTION  3

No,If there are only one or two disk blocks,we don't have to set an index .Because when we set an index in another disk blocks.If we use these indexs to lookup the data.The system have to change the pages ,As we know ,the change between the disk blocks is very low efficiency .To the small database I think maybe no index is better for our database.

*************************PART 3************************** 
QUESTION  1
the answer is in  alterDBexam3.sql .

QUESTION  2

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -