outer-inner-join.svg 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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="1143pt" height="977pt"
  8. viewBox="0.00 0.00 1143.00 977.00" 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 973)">
  10. <title>G</title>
  11. <polygon fill="white" stroke="transparent" points="-4,4 -4,-973 1139,-973 1139,4 -4,4"/>
  12. <text text-anchor="middle" x="329" y="-7.8" font-family="Times,serif" font-size="14.00">select * from t1 inner join t3 on t1.f1 = t3.f1 left join t2 on t1.f1 = t2.f1; (before rewrites)</text>
  13. <g id="clust1" class="cluster">
  14. <title>cluster0</title>
  15. <polygon fill="none" stroke="black" points="873,-691 873,-961 1127,-961 1127,-691 873,-691"/>
  16. <text text-anchor="middle" x="923.5" y="-945.8" font-family="Times,serif" font-size="14.00">Box0:Select</text>
  17. </g>
  18. <g id="clust3" class="cluster">
  19. <title>cluster1</title>
  20. <polygon fill="none" stroke="black" points="472,-402 472,-672 999,-672 999,-402 472,-402"/>
  21. <text text-anchor="middle" x="534.5" y="-656.8" font-family="Times,serif" font-size="14.00">Box1:OuterJoin</text>
  22. </g>
  23. <g id="clust5" class="cluster">
  24. <title>cluster5</title>
  25. <polygon fill="none" stroke="black" points="681,-216.5 681,-348.5 843,-348.5 843,-216.5 681,-216.5"/>
  26. <text text-anchor="middle" x="757" y="-333.3" font-family="Times,serif" font-size="14.00">Box5:BaseTable T2</text>
  27. </g>
  28. <g id="clust7" class="cluster">
  29. <title>cluster2</title>
  30. <polygon fill="none" stroke="black" points="16,-182 16,-383 598,-383 598,-182 16,-182"/>
  31. <text text-anchor="middle" x="66.5" y="-367.8" font-family="Times,serif" font-size="14.00">Box2:Select</text>
  32. </g>
  33. <g id="clust9" class="cluster">
  34. <title>cluster4</title>
  35. <polygon fill="none" stroke="black" points="280,-31 280,-163 442,-163 442,-31 280,-31"/>
  36. <text text-anchor="middle" x="356" y="-147.8" font-family="Times,serif" font-size="14.00">Box4:BaseTable T3</text>
  37. </g>
  38. <g id="clust11" class="cluster">
  39. <title>cluster3</title>
  40. <polygon fill="none" stroke="black" points="8,-31 8,-163 170,-163 170,-31 8,-31"/>
  41. <text text-anchor="middle" x="84" y="-147.8" font-family="Times,serif" font-size="14.00">Box3:BaseTable T1</text>
  42. </g>
  43. <!-- boxhead0 -->
  44. <g id="node1" class="node">
  45. <title>boxhead0</title>
  46. <polygon fill="none" stroke="black" points="973,-699.5 973,-929.5 1119,-929.5 1119,-699.5 973,-699.5"/>
  47. <text text-anchor="middle" x="1046" y="-914.3" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  48. <polyline fill="none" stroke="black" points="973,-906.5 1119,-906.5 "/>
  49. <text text-anchor="middle" x="1046" y="-891.3" font-family="Times,serif" font-size="14.00">0: Q4.c0 as F1</text>
  50. <polyline fill="none" stroke="black" points="973,-883.5 1119,-883.5 "/>
  51. <text text-anchor="middle" x="1046" y="-868.3" font-family="Times,serif" font-size="14.00">1: Q4.c1 as F2</text>
  52. <polyline fill="none" stroke="black" points="973,-860.5 1119,-860.5 "/>
  53. <text text-anchor="middle" x="1046" y="-845.3" font-family="Times,serif" font-size="14.00">2: Q4.c2 as F2</text>
  54. <polyline fill="none" stroke="black" points="973,-837.5 1119,-837.5 "/>
  55. <text text-anchor="middle" x="1046" y="-822.3" font-family="Times,serif" font-size="14.00">3: Q4.c3 as F1</text>
  56. <polyline fill="none" stroke="black" points="973,-814.5 1119,-814.5 "/>
  57. <text text-anchor="middle" x="1046" y="-799.3" font-family="Times,serif" font-size="14.00">4: Q4.c4 as F2</text>
  58. <polyline fill="none" stroke="black" points="973,-791.5 1119,-791.5 "/>
  59. <text text-anchor="middle" x="1046" y="-776.3" font-family="Times,serif" font-size="14.00">5: Q4.c5 as F2</text>
  60. <polyline fill="none" stroke="black" points="973,-768.5 1119,-768.5 "/>
  61. <text text-anchor="middle" x="1046" y="-753.3" font-family="Times,serif" font-size="14.00">6: Q4.c6 as F1</text>
  62. <polyline fill="none" stroke="black" points="973,-745.5 1119,-745.5 "/>
  63. <text text-anchor="middle" x="1046" y="-730.3" font-family="Times,serif" font-size="14.00">7: Q4.c7 as F2</text>
  64. <polyline fill="none" stroke="black" points="973,-722.5 1119,-722.5 "/>
  65. <text text-anchor="middle" x="1046" y="-707.3" font-family="Times,serif" font-size="14.00">8: Q4.c8 as F2</text>
  66. </g>
  67. <!-- Q4 -->
  68. <g id="node2" class="node">
  69. <title>Q4</title>
  70. <ellipse fill="none" stroke="black" cx="918" cy="-814.5" rx="37.09" ry="37.09"/>
  71. <text text-anchor="middle" x="918" y="-810.8" font-family="Times,serif" font-size="14.00">Q4(F)</text>
  72. </g>
  73. <!-- boxhead1 -->
  74. <g id="node3" class="node">
  75. <title>boxhead1</title>
  76. <polygon fill="none" stroke="black" points="845,-410.5 845,-640.5 991,-640.5 991,-410.5 845,-410.5"/>
  77. <text text-anchor="middle" x="918" y="-625.3" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  78. <polyline fill="none" stroke="black" points="845,-617.5 991,-617.5 "/>
  79. <text text-anchor="middle" x="918" y="-602.3" font-family="Times,serif" font-size="14.00">0: Q2.c0 as F1</text>
  80. <polyline fill="none" stroke="black" points="845,-594.5 991,-594.5 "/>
  81. <text text-anchor="middle" x="918" y="-579.3" font-family="Times,serif" font-size="14.00">1: Q2.c1 as F2</text>
  82. <polyline fill="none" stroke="black" points="845,-571.5 991,-571.5 "/>
  83. <text text-anchor="middle" x="918" y="-556.3" font-family="Times,serif" font-size="14.00">2: Q2.c2 as F2</text>
  84. <polyline fill="none" stroke="black" points="845,-548.5 991,-548.5 "/>
  85. <text text-anchor="middle" x="918" y="-533.3" font-family="Times,serif" font-size="14.00">3: Q2.c3 as F1</text>
  86. <polyline fill="none" stroke="black" points="845,-525.5 991,-525.5 "/>
  87. <text text-anchor="middle" x="918" y="-510.3" font-family="Times,serif" font-size="14.00">4: Q2.c4 as F2</text>
  88. <polyline fill="none" stroke="black" points="845,-502.5 991,-502.5 "/>
  89. <text text-anchor="middle" x="918" y="-487.3" font-family="Times,serif" font-size="14.00">5: Q2.c5 as F2</text>
  90. <polyline fill="none" stroke="black" points="845,-479.5 991,-479.5 "/>
  91. <text text-anchor="middle" x="918" y="-464.3" font-family="Times,serif" font-size="14.00">6: Q3.c0 as F1</text>
  92. <polyline fill="none" stroke="black" points="845,-456.5 991,-456.5 "/>
  93. <text text-anchor="middle" x="918" y="-441.3" font-family="Times,serif" font-size="14.00">7: Q3.c1 as F2</text>
  94. <polyline fill="none" stroke="black" points="845,-433.5 991,-433.5 "/>
  95. <text text-anchor="middle" x="918" y="-418.3" font-family="Times,serif" font-size="14.00">8: Q3.c2 as F2</text>
  96. </g>
  97. <!-- Q4&#45;&gt;boxhead1 -->
  98. <g id="edge3" class="edge">
  99. <title>Q4&#45;&gt;boxhead1</title>
  100. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M918,-777.44C918,-750.34 918,-711.27 918,-672"/>
  101. </g>
  102. <!-- Q2 -->
  103. <g id="node4" class="node">
  104. <title>Q2</title>
  105. <ellipse fill="none" stroke="black" cx="517" cy="-525.5" rx="37.09" ry="37.09"/>
  106. <text text-anchor="middle" x="517" y="-521.8" font-family="Times,serif" font-size="14.00">Q2(P)</text>
  107. </g>
  108. <!-- Q3 -->
  109. <g id="node5" class="node">
  110. <title>Q3</title>
  111. <ellipse fill="none" stroke="black" cx="762" cy="-525.5" rx="64.99" ry="64.99"/>
  112. <text text-anchor="middle" x="762" y="-521.8" font-family="Times,serif" font-size="14.00">Q3(F) as T2</text>
  113. </g>
  114. <!-- Q2&#45;&gt;Q3 -->
  115. <g id="edge1" class="edge">
  116. <title>Q2&#45;&gt;Q3</title>
  117. <path fill="none" stroke="black" d="M554.21,-525.5C591.96,-525.5 651.16,-525.5 696.73,-525.5"/>
  118. <text text-anchor="middle" x="625.53" y="-532.3" font-family="Times,serif" font-size="14.00">(Q2.c0) = (Q3.c0)</text>
  119. </g>
  120. <!-- boxhead2 -->
  121. <g id="node7" class="node">
  122. <title>boxhead2</title>
  123. <polygon fill="none" stroke="black" points="444,-190.5 444,-351.5 590,-351.5 590,-190.5 444,-190.5"/>
  124. <text text-anchor="middle" x="517" y="-336.3" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  125. <polyline fill="none" stroke="black" points="444,-328.5 590,-328.5 "/>
  126. <text text-anchor="middle" x="517" y="-313.3" font-family="Times,serif" font-size="14.00">0: Q0.c0 as F1</text>
  127. <polyline fill="none" stroke="black" points="444,-305.5 590,-305.5 "/>
  128. <text text-anchor="middle" x="517" y="-290.3" font-family="Times,serif" font-size="14.00">1: Q0.c1 as F2</text>
  129. <polyline fill="none" stroke="black" points="444,-282.5 590,-282.5 "/>
  130. <text text-anchor="middle" x="517" y="-267.3" font-family="Times,serif" font-size="14.00">2: Q0.c2 as F2</text>
  131. <polyline fill="none" stroke="black" points="444,-259.5 590,-259.5 "/>
  132. <text text-anchor="middle" x="517" y="-244.3" font-family="Times,serif" font-size="14.00">3: Q1.c0 as F1</text>
  133. <polyline fill="none" stroke="black" points="444,-236.5 590,-236.5 "/>
  134. <text text-anchor="middle" x="517" y="-221.3" font-family="Times,serif" font-size="14.00">4: Q1.c1 as F2</text>
  135. <polyline fill="none" stroke="black" points="444,-213.5 590,-213.5 "/>
  136. <text text-anchor="middle" x="517" y="-198.3" font-family="Times,serif" font-size="14.00">5: Q1.c2 as F2</text>
  137. </g>
  138. <!-- Q2&#45;&gt;boxhead2 -->
  139. <g id="edge4" class="edge">
  140. <title>Q2&#45;&gt;boxhead2</title>
  141. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M517,-488.32C517,-460.63 517,-420.89 517,-383"/>
  142. </g>
  143. <!-- boxhead5 -->
  144. <g id="node6" class="node">
  145. <title>boxhead5</title>
  146. <polygon fill="none" stroke="black" points="689,-225 689,-317 835,-317 835,-225 689,-225"/>
  147. <text text-anchor="middle" x="762" y="-301.8" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  148. <polyline fill="none" stroke="black" points="689,-294 835,-294 "/>
  149. <text text-anchor="middle" x="762" y="-278.8" font-family="Times,serif" font-size="14.00">0: c0 as F1</text>
  150. <polyline fill="none" stroke="black" points="689,-271 835,-271 "/>
  151. <text text-anchor="middle" x="762" y="-255.8" font-family="Times,serif" font-size="14.00">1: c1 as F2</text>
  152. <polyline fill="none" stroke="black" points="689,-248 835,-248 "/>
  153. <text text-anchor="middle" x="762" y="-232.8" font-family="Times,serif" font-size="14.00">2: c2 as F2</text>
  154. </g>
  155. <!-- Q3&#45;&gt;boxhead5 -->
  156. <g id="edge5" class="edge">
  157. <title>Q3&#45;&gt;boxhead5</title>
  158. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M762,-460.46C762,-426.39 762,-384.27 762,-348.5"/>
  159. </g>
  160. <!-- Q0 -->
  161. <g id="node8" class="node">
  162. <title>Q0</title>
  163. <ellipse fill="none" stroke="black" cx="89" cy="-271" rx="64.99" ry="64.99"/>
  164. <text text-anchor="middle" x="89" y="-267.3" font-family="Times,serif" font-size="14.00">Q0(F) as T1</text>
  165. </g>
  166. <!-- Q1 -->
  167. <g id="node9" class="node">
  168. <title>Q1</title>
  169. <ellipse fill="none" stroke="black" cx="361" cy="-271" rx="64.99" ry="64.99"/>
  170. <text text-anchor="middle" x="361" y="-267.3" font-family="Times,serif" font-size="14.00">Q1(F) as T3</text>
  171. </g>
  172. <!-- Q0&#45;&gt;Q1 -->
  173. <g id="edge2" class="edge">
  174. <title>Q0&#45;&gt;Q1</title>
  175. <path fill="none" stroke="black" d="M154.15,-271C197.06,-271 253.02,-271 295.91,-271"/>
  176. <text text-anchor="middle" x="225" y="-277.8" font-family="Times,serif" font-size="14.00">(Q0.c0) = (Q1.c0)</text>
  177. </g>
  178. <!-- boxhead3 -->
  179. <g id="node11" class="node">
  180. <title>boxhead3</title>
  181. <polygon fill="none" stroke="black" points="16,-39.5 16,-131.5 162,-131.5 162,-39.5 16,-39.5"/>
  182. <text text-anchor="middle" x="89" y="-116.3" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  183. <polyline fill="none" stroke="black" points="16,-108.5 162,-108.5 "/>
  184. <text text-anchor="middle" x="89" y="-93.3" font-family="Times,serif" font-size="14.00">0: c0 as F1</text>
  185. <polyline fill="none" stroke="black" points="16,-85.5 162,-85.5 "/>
  186. <text text-anchor="middle" x="89" y="-70.3" font-family="Times,serif" font-size="14.00">1: c1 as F2</text>
  187. <polyline fill="none" stroke="black" points="16,-62.5 162,-62.5 "/>
  188. <text text-anchor="middle" x="89" y="-47.3" font-family="Times,serif" font-size="14.00">2: c2 as F2</text>
  189. </g>
  190. <!-- Q0&#45;&gt;boxhead3 -->
  191. <g id="edge6" class="edge">
  192. <title>Q0&#45;&gt;boxhead3</title>
  193. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M89,-205.82C89,-191.99 89,-177.24 89,-163"/>
  194. </g>
  195. <!-- boxhead4 -->
  196. <g id="node10" class="node">
  197. <title>boxhead4</title>
  198. <polygon fill="none" stroke="black" points="288,-39.5 288,-131.5 434,-131.5 434,-39.5 288,-39.5"/>
  199. <text text-anchor="middle" x="361" y="-116.3" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  200. <polyline fill="none" stroke="black" points="288,-108.5 434,-108.5 "/>
  201. <text text-anchor="middle" x="361" y="-93.3" font-family="Times,serif" font-size="14.00">0: c0 as F1</text>
  202. <polyline fill="none" stroke="black" points="288,-85.5 434,-85.5 "/>
  203. <text text-anchor="middle" x="361" y="-70.3" font-family="Times,serif" font-size="14.00">1: c1 as F2</text>
  204. <polyline fill="none" stroke="black" points="288,-62.5 434,-62.5 "/>
  205. <text text-anchor="middle" x="361" y="-47.3" font-family="Times,serif" font-size="14.00">2: c2 as F2</text>
  206. </g>
  207. <!-- Q1&#45;&gt;boxhead4 -->
  208. <g id="edge7" class="edge">
  209. <title>Q1&#45;&gt;boxhead4</title>
  210. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M361,-205.82C361,-191.99 361,-177.24 361,-163"/>
  211. </g>
  212. </g>
  213. </svg>