lateral-join.svg 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  3. "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  4. <!-- Generated by graphviz version 2.43.0 (0)
  5. -->
  6. <!-- Title: G Pages: 1 -->
  7. <svg width="844pt" height="871pt"
  8. viewBox="0.00 0.00 844.00 870.98" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  9. <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 866.98)">
  10. <title>G</title>
  11. <polygon fill="white" stroke="transparent" points="-4,4 -4,-866.98 840,-866.98 840,4 -4,4"/>
  12. <text text-anchor="middle" x="418" y="-7.8" font-family="Times,serif" font-size="14.00">select * from t1, lateral(select f1 from t2 where t2.f2 = t1.f3 group by f1) as l &#160;where t1.f1 = l.f1; (before rewrites)</text>
  13. <g id="clust1" class="cluster">
  14. <title>cluster0</title>
  15. <polygon fill="none" stroke="black" points="217.5,-685.99 217.5,-854.98 788.5,-854.98 788.5,-685.99 217.5,-685.99"/>
  16. <text text-anchor="middle" x="268" y="-839.78" font-family="Times,serif" font-size="14.00">Box0:Select</text>
  17. </g>
  18. <g id="clust3" class="cluster">
  19. <title>cluster5</title>
  20. <polygon fill="none" stroke="black" points="380.5,-544.44 380.5,-657.54 786.5,-657.54 786.5,-544.44 380.5,-544.44"/>
  21. <text text-anchor="middle" x="431" y="-642.34" font-family="Times,serif" font-size="14.00">Box5:Select</text>
  22. </g>
  23. <g id="clust5" class="cluster">
  24. <title>cluster4</title>
  25. <polygon fill="none" stroke="black" points="216.5,-369.99 216.5,-501.99 622.5,-501.99 622.5,-369.99 216.5,-369.99"/>
  26. <text text-anchor="middle" x="278.5" y="-486.79" font-family="Times,serif" font-size="14.00">Box4:Grouping</text>
  27. </g>
  28. <g id="clust7" class="cluster">
  29. <title>cluster2</title>
  30. <polygon fill="none" stroke="black" points="55.5,-182 55.5,-350.99 365.5,-350.99 365.5,-182 55.5,-182"/>
  31. <text text-anchor="middle" x="106" y="-335.79" font-family="Times,serif" font-size="14.00">Box2:Select</text>
  32. </g>
  33. <g id="clust9" class="cluster">
  34. <title>cluster3</title>
  35. <polygon fill="none" stroke="black" points="47.5,-31 47.5,-163 209.5,-163 209.5,-31 47.5,-31"/>
  36. <text text-anchor="middle" x="123.5" y="-147.8" font-family="Times,serif" font-size="14.00">Box3:BaseTable T2</text>
  37. </g>
  38. <g id="clust11" class="cluster">
  39. <title>cluster1</title>
  40. <polygon fill="none" stroke="black" points="209.5,-534.99 209.5,-666.99 371.5,-666.99 371.5,-534.99 209.5,-534.99"/>
  41. <text text-anchor="middle" x="285.5" y="-651.79" font-family="Times,serif" font-size="14.00">Box1:BaseTable T1</text>
  42. </g>
  43. <!-- boxhead0 -->
  44. <g id="node1" class="node">
  45. <title>boxhead0</title>
  46. <polygon fill="none" stroke="black" points="634.5,-701.48 634.5,-816.48 780.5,-816.48 780.5,-701.48 634.5,-701.48"/>
  47. <text text-anchor="middle" x="707.5" y="-801.28" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  48. <polyline fill="none" stroke="black" points="634.5,-793.48 780.5,-793.48 "/>
  49. <text text-anchor="middle" x="707.5" y="-778.28" font-family="Times,serif" font-size="14.00">0: Q0.c0 as F1</text>
  50. <polyline fill="none" stroke="black" points="634.5,-770.48 780.5,-770.48 "/>
  51. <text text-anchor="middle" x="707.5" y="-755.28" font-family="Times,serif" font-size="14.00">1: Q0.c1 as F2</text>
  52. <polyline fill="none" stroke="black" points="634.5,-747.48 780.5,-747.48 "/>
  53. <text text-anchor="middle" x="707.5" y="-732.28" font-family="Times,serif" font-size="14.00">2: Q0.c2 as F3</text>
  54. <polyline fill="none" stroke="black" points="634.5,-724.48 780.5,-724.48 "/>
  55. <text text-anchor="middle" x="707.5" y="-709.28" font-family="Times,serif" font-size="14.00">3: Q4.c0 as F1</text>
  56. </g>
  57. <!-- Q0 -->
  58. <g id="node2" class="node">
  59. <title>Q0</title>
  60. <ellipse fill="none" stroke="black" cx="290.5" cy="-758.98" rx="64.99" ry="64.99"/>
  61. <text text-anchor="middle" x="290.5" y="-755.28" font-family="Times,serif" font-size="14.00">Q0(F) as T1</text>
  62. </g>
  63. <!-- Q4 -->
  64. <g id="node3" class="node">
  65. <title>Q4</title>
  66. <ellipse fill="none" stroke="black" cx="557.5" cy="-758.98" rx="59.29" ry="59.29"/>
  67. <text text-anchor="middle" x="557.5" y="-755.28" font-family="Times,serif" font-size="14.00">Q4(F) as L</text>
  68. </g>
  69. <!-- Q0&#45;&gt;Q4 -->
  70. <g id="edge1" class="edge">
  71. <title>Q0&#45;&gt;Q4</title>
  72. <path fill="none" stroke="black" d="M355.82,-758.98C399.35,-758.98 456.11,-758.98 498.32,-758.98"/>
  73. <text text-anchor="middle" x="426.92" y="-765.78" font-family="Times,serif" font-size="14.00">(Q0.c0) = (Q4.c0)</text>
  74. </g>
  75. <!-- Q1 -->
  76. <g id="node9" class="node">
  77. <title>Q1</title>
  78. <ellipse fill="none" stroke="black" cx="128.5" cy="-254.99" rx="64.99" ry="64.99"/>
  79. <text text-anchor="middle" x="128.5" y="-251.29" font-family="Times,serif" font-size="14.00">Q1(F) as T2</text>
  80. </g>
  81. <!-- Q0&#45;&gt;Q1 -->
  82. <g id="edge2" class="edge">
  83. <title>Q0&#45;&gt;Q1</title>
  84. <path fill="none" stroke="black" d="M241.6,-715.65C227.98,-701.48 214.48,-684.74 205.5,-666.99 148.32,-553.95 133.32,-404.05 129.56,-320.07"/>
  85. <text text-anchor="middle" x="219" y="-513.79" font-family="Times,serif" font-size="14.00">(Q1.c1) = (Q0.c2)</text>
  86. </g>
  87. <!-- boxhead1 -->
  88. <g id="node11" class="node">
  89. <title>boxhead1</title>
  90. <polygon fill="none" stroke="black" points="217.5,-543.49 217.5,-635.49 363.5,-635.49 363.5,-543.49 217.5,-543.49"/>
  91. <text text-anchor="middle" x="290.5" y="-620.29" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  92. <polyline fill="none" stroke="black" points="217.5,-612.49 363.5,-612.49 "/>
  93. <text text-anchor="middle" x="290.5" y="-597.29" font-family="Times,serif" font-size="14.00">0: c0 as F1</text>
  94. <polyline fill="none" stroke="black" points="217.5,-589.49 363.5,-589.49 "/>
  95. <text text-anchor="middle" x="290.5" y="-574.29" font-family="Times,serif" font-size="14.00">1: c1 as F2</text>
  96. <polyline fill="none" stroke="black" points="217.5,-566.49 363.5,-566.49 "/>
  97. <text text-anchor="middle" x="290.5" y="-551.29" font-family="Times,serif" font-size="14.00">2: c2 as F3</text>
  98. </g>
  99. <!-- Q0&#45;&gt;boxhead1 -->
  100. <g id="edge3" class="edge">
  101. <title>Q0&#45;&gt;boxhead1</title>
  102. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M290.5,-693.7C290.5,-684.96 290.5,-675.92 290.5,-666.99"/>
  103. </g>
  104. <!-- boxhead5 -->
  105. <g id="node4" class="node">
  106. <title>boxhead5</title>
  107. <polygon fill="none" stroke="black" points="481,-554.99 481,-623.99 778,-623.99 778,-554.99 481,-554.99"/>
  108. <text text-anchor="middle" x="629.5" y="-608.79" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  109. <polyline fill="none" stroke="black" points="481,-600.99 778,-600.99 "/>
  110. <text text-anchor="middle" x="629.5" y="-585.79" font-family="Times,serif" font-size="14.00">0: Q3.c0 as F1</text>
  111. <polyline fill="none" stroke="black" points="481,-577.99 778,-577.99 "/>
  112. <text text-anchor="middle" x="629.5" y="-562.79" font-family="Times,serif" font-size="14.00">UNIQUE KEY [0]</text>
  113. </g>
  114. <!-- Q4&#45;&gt;boxhead5 -->
  115. <g id="edge4" class="edge">
  116. <title>Q4&#45;&gt;boxhead5</title>
  117. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M580.68,-704.06C587.05,-689.25 594.03,-672.99 600.68,-657.53"/>
  118. </g>
  119. <!-- Q3 -->
  120. <g id="node5" class="node">
  121. <title>Q3</title>
  122. <ellipse fill="none" stroke="black" cx="425.5" cy="-589.49" rx="37.09" ry="37.09"/>
  123. <text text-anchor="middle" x="425.5" y="-585.79" font-family="Times,serif" font-size="14.00">Q3(F)</text>
  124. </g>
  125. <!-- boxhead4 -->
  126. <g id="node6" class="node">
  127. <title>boxhead4</title>
  128. <polygon fill="none" stroke="black" points="317,-378.49 317,-470.49 614,-470.49 614,-378.49 317,-378.49"/>
  129. <text text-anchor="middle" x="465.5" y="-455.29" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  130. <polyline fill="none" stroke="black" points="317,-447.49 614,-447.49 "/>
  131. <text text-anchor="middle" x="465.5" y="-432.29" font-family="Times,serif" font-size="14.00">0: Q2.c0 as F1</text>
  132. <polyline fill="none" stroke="black" points="317,-424.49 614,-424.49 "/>
  133. <text text-anchor="middle" x="465.5" y="-409.29" font-family="Times,serif" font-size="14.00">GROUP Q2.c0 Ascending</text>
  134. <polyline fill="none" stroke="black" points="317,-401.49 614,-401.49 "/>
  135. <text text-anchor="middle" x="465.5" y="-386.29" font-family="Times,serif" font-size="14.00">UNIQUE KEY [0]</text>
  136. </g>
  137. <!-- Q3&#45;&gt;boxhead4 -->
  138. <g id="edge5" class="edge">
  139. <title>Q3&#45;&gt;boxhead4</title>
  140. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M434.18,-553.12C437.88,-538.06 442.34,-519.86 446.73,-501.98"/>
  141. </g>
  142. <!-- Q2 -->
  143. <g id="node7" class="node">
  144. <title>Q2</title>
  145. <ellipse fill="none" stroke="black" cx="261.5" cy="-424.49" rx="37.09" ry="37.09"/>
  146. <text text-anchor="middle" x="261.5" y="-420.79" font-family="Times,serif" font-size="14.00">Q2(F)</text>
  147. </g>
  148. <!-- boxhead2 -->
  149. <g id="node8" class="node">
  150. <title>boxhead2</title>
  151. <polygon fill="none" stroke="black" points="211.5,-208.99 211.5,-300.99 357.5,-300.99 357.5,-208.99 211.5,-208.99"/>
  152. <text text-anchor="middle" x="284.5" y="-285.79" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  153. <polyline fill="none" stroke="black" points="211.5,-277.99 357.5,-277.99 "/>
  154. <text text-anchor="middle" x="284.5" y="-262.79" font-family="Times,serif" font-size="14.00">0: Q1.c0 as F1</text>
  155. <polyline fill="none" stroke="black" points="211.5,-254.99 357.5,-254.99 "/>
  156. <text text-anchor="middle" x="284.5" y="-239.79" font-family="Times,serif" font-size="14.00">1: Q1.c1 as F2</text>
  157. <polyline fill="none" stroke="black" points="211.5,-231.99 357.5,-231.99 "/>
  158. <text text-anchor="middle" x="284.5" y="-216.79" font-family="Times,serif" font-size="14.00">2: Q1.c2 as F3</text>
  159. </g>
  160. <!-- Q2&#45;&gt;boxhead2 -->
  161. <g id="edge6" class="edge">
  162. <title>Q2&#45;&gt;boxhead2</title>
  163. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M266.43,-387.56C267.94,-376.59 269.67,-363.97 271.46,-350.98"/>
  164. </g>
  165. <!-- boxhead3 -->
  166. <g id="node10" class="node">
  167. <title>boxhead3</title>
  168. <polygon fill="none" stroke="black" points="55.5,-39.5 55.5,-131.5 201.5,-131.5 201.5,-39.5 55.5,-39.5"/>
  169. <text text-anchor="middle" x="128.5" y="-116.3" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  170. <polyline fill="none" stroke="black" points="55.5,-108.5 201.5,-108.5 "/>
  171. <text text-anchor="middle" x="128.5" y="-93.3" font-family="Times,serif" font-size="14.00">0: c0 as F1</text>
  172. <polyline fill="none" stroke="black" points="55.5,-85.5 201.5,-85.5 "/>
  173. <text text-anchor="middle" x="128.5" y="-70.3" font-family="Times,serif" font-size="14.00">1: c1 as F2</text>
  174. <polyline fill="none" stroke="black" points="55.5,-62.5 201.5,-62.5 "/>
  175. <text text-anchor="middle" x="128.5" y="-47.3" font-family="Times,serif" font-size="14.00">2: c2 as F3</text>
  176. </g>
  177. <!-- Q1&#45;&gt;boxhead3 -->
  178. <g id="edge7" class="edge">
  179. <title>Q1&#45;&gt;boxhead3</title>
  180. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M128.5,-189.72C128.5,-180.97 128.5,-171.93 128.5,-163"/>
  181. </g>
  182. </g>
  183. </svg>