tailieunhanh - Query processing

Query processing presents about an overview of query processing; fast access paths; tranformation rules; algebra based optimization; Example of Execution plan; Cost of evaluating a query; Search space of query optimization. | QUERY PROCESSING 1. AN OVERVIEW OF QUERY PROCESSING 2. FAST ACCESS PATHS 3. TRANFORMATION RULES 4. ALGEBRA-BASED OPTIMIZATION An overview of query processing When a user query is received, query processor first checks - whether the query has the correct syntax and - whether the relations and attributes it references are in the database. Next, if the query is acceptable, then an execution plan for the query is generated. Def: An execution plan is a sequence of steps for query execution. Each step in the plan corresponds to one relational operation plus the method to be used for the evaluation of the operation. Example of Execution plan For a given relational operation, there are a number of methods that can be used to evaluate it. Example: SELECT * FROM R, S, T WHERE > a AND = AND = A possible execution plan for this query consists of : 1. Perform selection A>a (R) based on a sequential scan of the tuples of R. Let R1 be the result of this selection. 2. . | QUERY PROCESSING 1. AN OVERVIEW OF QUERY PROCESSING 2. FAST ACCESS PATHS 3. TRANFORMATION RULES 4. ALGEBRA-BASED OPTIMIZATION An overview of query processing When a user query is received, query processor first checks - whether the query has the correct syntax and - whether the relations and attributes it references are in the database. Next, if the query is acceptable, then an execution plan for the query is generated. Def: An execution plan is a sequence of steps for query execution. Each step in the plan corresponds to one relational operation plus the method to be used for the evaluation of the operation. Example of Execution plan For a given relational operation, there are a number of methods that can be used to evaluate it. Example: SELECT * FROM R, S, T WHERE > a AND = AND = A possible execution plan for this query consists of : 1. Perform selection A>a (R) based on a sequential scan of the tuples of R. Let R1 be the result of this selection. 2. Perform join R1 = S using a sort merge join algorithm. Let R2 be the result of the join. 3. Perform join R2 = T using the nested loop join algorithm Execution plan (cont.) An alternative execution plan: 1. A>a (R). Let R1 be the result. 2. S = T. Let R3 be the result. 3. R1 = R3 Different execution plans that can produce the same result are said to be equivalent. However, different equivalent plans are evaluated with very different costs. Cost of evaluating a query The goal of query optimization is to find an execution plan, among all possible equivalent plans, that can be evaluated with the minimum cost. Such a plan is an optimal plan. In a centralized database system, the cost of evaluating a query is the sum of two components, the I/O cost and the CPU cost. The I/O cost is caused by the transfer of data between main memory and secondary memory. The CPU cost is incurred when tuples in memory are joined or checked against .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.