Skip to content

Commit

Permalink
update subquery title
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeanhwea committed Jul 4, 2024
1 parent 0bc2e68 commit 31191e6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions assets/subquery-examples.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#+PROPERTY: header-args:sql :dbhost 127.0.0.1 :database employees :engine mysql :dbuser root :exports both


* 标量子查询 ~subq01.sql~
- [[file:subq01_scalar_exp.sql.json][exp_json]] | [[file:subq01_scalar_opt.sql.json][opt_trace]]
* ~subq01.sql~
- 标量子查询 [[file:subq01_scalar_exp.sql.json][exp_json]] | [[file:subq01_scalar_opt.sql.json][opt_trace]]
#+BEGIN_SRC sql
explain
select
Expand All @@ -32,8 +32,8 @@
| 1 | PRIMARY | a | NULL | range | PRIMARY,dept_no | dept_no | 20 | NULL | 32 | 100.00 | Using where; Using index |
| 2 | SUBQUERY | d | NULL | const | dept_name | dept_name | 162 | const | 1 | 100.00 | Using index |

* 唯一性的 IN 子查询 ~subq02.sql~
- [[file:subq02_unique_exp.sql.json][exp_json]] | [[file:subq02_unique_opt.sql.json][opt_trace]]
* ~subq02.sql~
- 唯一性的 IN 子查询 [[file:subq02_unique_exp.sql.json][exp_json]] | [[file:subq02_unique_opt.sql.json][opt_trace]]
#+BEGIN_SRC sql
explain
select
Expand All @@ -56,8 +56,8 @@
| 1 | SIMPLE | a | NULL | ref | PRIMARY,dept_no | dept_no | 16 | const | 2 | 100.00 | Using where; Using index |
| 1 | SIMPLE | e | NULL | eq_ref | PRIMARY | PRIMARY | 4 | employees.a.emp_no | 1 | 100.00 | NULL |

* 非唯一性的 IN 子查询 ~subq03.sql~
- [[file:subq03_non-unique_exp.sql.json][exp_json]] | [[file:subq03_non-unique_opt.sql.json][opt_trace]]
* ~subq03.sql~
- 非唯一性的 IN 子查询 [[file:subq03_non-unique_exp.sql.json][exp_json]] | [[file:subq03_non-unique_opt.sql.json][opt_trace]]
#+BEGIN_SRC sql
explain
select
Expand All @@ -81,8 +81,8 @@
| 1 | SIMPLE | <subquery2> | NULL | eq_ref | <auto_distinct_key> | <auto_distinct_key> | 16 | employees.d.dept_no | 1 | 100.00 | NULL |
| 2 | MATERIALIZED | a | NULL | ALL | dept_no | NULL | NULL | NULL | 24 | 33.33 | Using where |

* EXISTS 子查询 ~subq04.sql~
- [[file:subq04_exists_exp.sql.json][exp_json]] | [[file:subq04_exists_opt.sql.json][opt_trace]]
* ~subq04.sql~
- EXISTS 子查询 [[file:subq04_exists_exp.sql.json][exp_json]] | [[file:subq04_exists_opt.sql.json][opt_trace]]
#+BEGIN_SRC sql
explain
select
Expand Down

0 comments on commit 31191e6

Please sign in to comment.