Query Processing (16) (Xử lý truy vấn trong hệ CSDL quan hệ) (Tiếng Anh)
Generating preview...
Tài liệu giới thiệu về xử lý truy vấn trong hệ cơ sở dữ liệu quan hệ, bao gồm SQL, đại số quan hệ, các kế hoạch truy vấn và tối ưu hóa truy vấn.
Description
Data-Intensive Computing Systems Introduction to Query Processing Shivnath Babu Query Processing Declarative SQL Query → Query Plan NOTE: You will not be tested on how well you know SQL. Understanding the SQL introduced in class will be sufficient (a primer follows). SQL is described in Chapter 6, GMUW. Focus: Relational System (i.e., data is organized as tables, or relations) SQL Primer We will focus on SPJ, or Select-Project-Join Queries Select <attribute list> From <relation list> Where <condition list> Example Filter Query over R(A,B,C): Select B From R Where R.A = “c” R.C > 10 SQL Primer (contd.) We will focus on SPJ, or Select-Project-Join-Queries Select <attribute list> From <relation list> Where <condition list> Example Join Query over R(A,B,C) and S(C,D,E): Select B, D From R, S Where R.A = “c” S.E = 2 R.C = S.C R A B C S C D E a 1 10 10 x 2 b 1 20 20 y 2 c 2 10 30 z 2 d 2 35 40 x 1 e 3 45 50 y 3 Select B,D From R,S Answer Where R.A = “c” S.E = 2 R.C=S.C B 2 D x How do we execute this query? Select B,D From R,S Where R.A = “c” S.E = 2 R.C=S.C One idea Do Cartesian product Select tuples Do projection RXS Select B,D R.A R.B R.C S.C S.D S.E a 1 10 10 x 2 a . . 1 10 20 y 2 c . . 2 10 10 x 2 From R,S Where R.A = “c” S.E = 2 R.C=S.C Bingo! Got one... Relational Algebra - can be used to describe plans Ex: Plan I B,D sR.A=“c” S.E=2 R.C=S.C X R S Relational Algebra Primer (Chapter 5, GMUW) Select: sR.A=“c” R.C=10 Project: B,D Cartesian Product: R X S Natural Join: R S Relational Algebra - can be used to describe plans Ex: Plan I B,D sR.A=“c” S.E=2 R.C=S.C X R S OR: B,D [ sR.A=“c” S.E=2 R.C = S.C (RXS)] Another idea: Plan II B,D sR.A = “c” Select B,D R(A,B,C) From R,S Where R.A = “c” S.E = 2 R.C=S.C sS.E = 2 S(C,D,E) natural join R S A B C s (R) s(S) C D E a 1 10 A B C C D E 10 x 2 b 1 20 c 2 10 10 x 2 20 y 2
AI summary
- Document name
- Query Processing (16) (Xử lý truy vấn trong hệ CSDL quan hệ) (Tiếng Anh)
- School / Course
- Duke University · Cơ sở dữ liệu
- Content
- Tài liệu này giải thích quá trình xử lý truy vấn SQL trong hệ thống cơ sở dữ liệu quan hệ, từ việc chuyển đổi truy vấn thành kế hoạch thực thi, các kỹ thuật tối ưu hóa, đến quy trình tổng thể của xử lý truy vấn.
- Table of contents
- Introduction to Query Processing
- Query Processing
- SQL Primer
- Relational Algebra Primer
- Overview of Query Processing
- Example Query
- Example: Parse Tree
- Along with Parsing …
- SQL query
- Initial Logical Plan
- Apply Rewrite Rule (1)
- Apply Rewrite Rule (2)
- Apply Rewrite Rule (3)
- Pages
- 49 pages
- Uploaded by
- Uni24h
Frequently asked questions
Is this document free?
Yes. “Query Processing (16) (Xử lý truy vấn trong hệ CSDL quan hệ) (Tiếng Anh)” is free — just sign in and click Download to get the original file.
How many pages is this document?
The document has 49 pages, for the course Cơ sở dữ liệu. You can preview it online before downloading.
Can I preview before downloading?
Yes. You can preview this document right on this page with the online reader, then decide whether to download.
Query Processing (16) (Xử lý truy vấn trong hệ CSDL quan hệ) (Tiếng Anh)
Generating preview...
Data-Intensive Computing Systems Introduction to Query Processing Shivnath Babu Query Processing Declarative SQL Query → Query Plan NOTE: You will not be tested on how well you know SQL. Understanding the SQL introduced in class will be sufficient (a primer follows). SQL is described in Chapter 6, GMUW. Focus: Relational System (i.e., data is organized as tables, or relations) SQL Primer We will focus on SPJ, or Select-Project-Join Queries Select <attribute list> From <relation list> Where <condition list> Example Filter Query over R(A,B,C): Select B From R Where R.A = “c” R.C > 10 SQL Primer (contd.) We will focus on SPJ, or Select-Project-Join-Queries Select <attribute list> From <relation list> Where <condition list> Example Join Query over R(A,B,C) and S(C,D,E): Select B, D From R, S Where R.A = “c” S.E = 2 R.C = S.C R A B C S C D E a 1 10 10 x 2 b 1 20 20 y 2 c 2 10 30 z 2 d 2 35 40 x 1 e 3 45 50 y 3 Select B,D From R,S Answer Where R.A = “c” S.E = 2 R.C=S.C B 2 D x How do we execute this query? Select B,D From R,S Where R.A = “c” S.E = 2 R.C=S.C One idea Do Cartesian product Select tuples Do projection RXS Select B,D R.A R.B R.C S.C S.D S.E a 1 10 10 x 2 a . . 1 10 20 y 2 c . . 2 10 10 x 2 From R,S Where R.A = “c” S.E = 2 R.C=S.C Bingo! Got one... Relational Algebra - can be used to describe plans Ex: Plan I B,D sR.A=“c” S.E=2 R.C=S.C X R S Relational Algebra Primer (Chapter 5, GMUW) Select: sR.A=“c” R.C=10 Project: B,D Cartesian Product: R X S Natural Join: R S Relational Algebra - can be used to describe plans Ex: Plan I B,D sR.A=“c” S.E=2 R.C=S.C X R S OR: B,D [ sR.A=“c” S.E=2 R.C = S.C (RXS)] Another idea: Plan II B,D sR.A = “c” Select B,D R(A,B,C) From R,S Where R.A = “c” S.E = 2 R.C=S.C sS.E = 2 S(C,D,E) natural join R S A B C s (R) s(S) C D E a 1 10 A B C C D E 10 x 2 b 1 20 c 2 10 10 x 2 20 y 2
Read full document
- Document name
- Query Processing (16) (Xử lý truy vấn trong hệ CSDL quan hệ) (Tiếng Anh)
- School / Course
- Duke University · Cơ sở dữ liệu
- Content
- Tài liệu này giải thích quá trình xử lý truy vấn SQL trong hệ thống cơ sở dữ liệu quan hệ, từ việc chuyển đổi truy vấn thành kế hoạch thực thi, các kỹ thuật tối ưu hóa, đến quy trình tổng thể của xử lý truy vấn.
- Table of contents
- Introduction to Query Processing
- Query Processing
- SQL Primer
- Relational Algebra Primer
- Overview of Query Processing
- Example Query
- Example: Parse Tree
- Along with Parsing …
- SQL query
- Initial Logical Plan
- Apply Rewrite Rule (1)
- Apply Rewrite Rule (2)
- Apply Rewrite Rule (3)
- Pages
- 49 pages
- Uploaded by
- Uni24h
Comments (0)
No comments yet. Be the first!
Thiết kế quản trị Cơ sở dữ liệu - Notes 2 (HUST) GV. Vũ Tuyết Trinh
Thiết kế quản trị Cơ sở dữ liệu - Notes 11 (HUST) GV. Vũ Tuyết Trinh
Thiết kế quản trị Cơ sở dữ liệu - Notes 12 (HUST) GV. Vũ Tuyết Trinh
Thiết kế quản trị Cơ sở dữ liệu - Notes 1 (HUST) GV. Vũ Tuyết Trinh
Thiết kế quản trị Cơ sở dữ liệu - Notes 3 (HUST) GV. Vũ Tuyết Trinh
Chương 7.Cơ học lượng tử - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 6.Quang học lượng tử - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 5.Thuyết tương đối - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 4. Tán xạ ánh sáng - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Chương 3.Phân cực ánh sáng - Vật lý đại cương 3 - TS.Nguyễn Thị Trang
Comments (0)
No comments yet. Be the first!