連線 (SQL)操作是資料庫管理中重要的一環,而嵌套循環連線是通過嵌套的循環語句把多個表連線起來的簡單算法,但是效率並不理想。
基本介紹
- 中文名:嵌套循環連線
- 外文名:Nested loop join
簡介
算法內容
For each tuple r in R do
For each tuple s in S do
If r and s satisfy the join condition
Then output the tuple <r,s>
改進方法
For each block block_r in R do
For each tuple s in S do
For each tuple r in block_r do
If r and s satisfy the join condition
Then output the tuple <r,s>