当前位置:网站首页>Database learning notes (Chapter 15)
Database learning notes (Chapter 15)
2022-06-13 10:40:00 【qq_ fifty-two million three hundred and seventy thousand and tw】
Chapter 15 Query processing
1. The basic steps of query processing
Grammar analysis and Translation ( Syntax check 、 Semantic check )+ Optimize + perform 
① Analysis and Translation
parsers Check grammar , Verify the relationship
Translate the query statement into The internal representation of the system , That is translated into Relational algebra
② perform
Query execution engine Receive a query execution plan , Execute the plan and return the results to the query
2. An important step in query processing : Optimize
A relational algebraic expression may have many equivalent expressions
Each relational algebra operation can be performed with a variety of different algorithms , Accordingly , A relational algebraic expression can be evaluated in many ways
Used to execute a query Primitive operation sequence be called Query execution plan
Query optimization : Select the plan with the minimum query execution cost among all the equivalent execution plans
3. Measurement of query cost
The cost of query processing can be used to measure the usage of various resources , These resources include disk access , Used to execute a query CPU Time , Even the cost of network communication
stay disk The cost of accessing data on is usually the main cost . It is measured by the following indicators :
Only Number of disk blocks transferred as well as Number of disk searches To measure the cost of querying the calculation plan 
Ignore CPU Time , Practical application CPU Time should be taken into account
Cost estimation Do not include The cost of writing the final result of the operation back to disk

4. Select operation —— File scanning ( I don't understand )
4.1 Algorithm A1 ( Linear search )

4.2 An index scan – Search algorithm using index
The selection criteria must be the search code of the index 




5. Nested loop connection 
Block nested loop connection
It is a variant of nested loop join , Each piece of the inner relationship corresponds to each piece of the outer relationship , Forming block pairs , In each block pair , Each tuple of one block is paired with each tuple of another block , So we can get all the group pairs
It is applicable to the case that the memory cannot fully accommodate any relationship , If we deal with relationships in blocks rather than tuples , You can reduce the number of block reads and writes .



6. Index loop nested join 

7. Merge and connect
Sort all relationships on the connection properties ( If it wasn't orderly before )
To connect them , Merge ordered relations :
The join step is similar to the merge phase in the merge sort algorithm
The main difference is to deal with duplicate values on connection properties — Tuples of each pair of connection attributes with the same value must be matched

8. Hash connection



9. Expression evaluation
Physicochemical : Enter a relationship or completed calculation , Produce the result of an expression , Materialize it on disk , Repeat the process
Assembly line : Part of the result of an ongoing operation is transferred to the next operation of the pipeline , So that the two operations can be carried out at the same time
9.1 Physicochemical
Physicochemical calculation : from At the bottom Start , Perform operations in the tree , Create... For each intermediate result of the operation ( Physicochemical , Create a temporary relationship ), Then it is used for the upper level operation



9.2 Assembly line 

I think this chapter is too difficult , I don't quite understand
END
边栏推荐
- Some experience in database table structure design
- AcWing第 55 场周赛
- Thingsboard tutorial (20): filtering telemetry data using regular chains
- Système de gestion des défauts du projet Cynthia
- 2022煤矿探放水特种作业证考试题库模拟考试平台操作
- 计算循环冗余码--摘录
- 数据库系统概念(第十七章)
- Go path package
- On the exploitation of a horizontal ultra vires vulnerability
- Implementation of fruit mall wholesale platform based on SSM
猜你喜欢

Idea life extension plug-in

Cynthia project defect management system

格林纳达代表团团长孙宇晨出席WTO MC12 强调发展数字经济

ADG备库MRP0状态WAIT_FOR_GAP

EasyClick 运行代码片段出Null

电解电容、钽电容、普通电容

C 11 new feature: static abstract members in interfaces

Necessary for Architects: system capacity status checklist

Write pytoch model in five minutes

检验冗余码是否出错题型解法-摘录
随机推荐
Programming principles
China SaaS industry panorama
Understanding RPC and rest
实战模拟│企业微信机器人实时报错预警
Write pytoch model in five minutes
Test cases that testers must master
Record several interesting XSS vulnerability discoveries
【图像去噪】基于matlab高斯+均值+中值+双边滤波图像去噪【含Matlab源码 1872期】
Node red series (24): use MySQL nodes in node red to add, delete, modify and query databases
Advanced technology management - what management tools can managers use
Deploy vscode on kubernetes cluster
Some experience in database table structure design
Electrolytic capacitor, tantalum capacitor, ordinary capacitor
flutter简单优秀的开源dialog使用free_dialog
2022 Gansu Province safety officer C certificate work certificate title and online simulation examination
Mysql database conceptual design using E-R model
Questions and answers of the labor worker general basic (labor worker) work license in 2022
Classical convolutional neural network model
Introduction to binary tree
为发泄对上司不满,百度95后程序员删库被判9个月