simple-cte.svg 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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="922pt" height="958pt"
  8. viewBox="0.00 0.00 922.00 957.99" 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 953.99)">
  10. <title>G</title>
  11. <polygon fill="white" stroke="transparent" points="-4,4 -4,-953.99 918,-953.99 918,4 -4,4"/>
  12. <text text-anchor="middle" x="387.5" y="-7.8" font-family="Times,serif" font-size="14.00">with a(a, b, c) as (select * from t1) select * from a as a1 inner join a as a2 on a1.a = a2.c; (before rewrites)</text>
  13. <g id="clust1" class="cluster">
  14. <title>cluster3</title>
  15. <polygon fill="none" stroke="black" points="652,-740.99 652,-941.99 906,-941.99 906,-740.99 652,-740.99"/>
  16. <text text-anchor="middle" x="702.5" y="-926.79" font-family="Times,serif" font-size="14.00">Box3:Select</text>
  17. </g>
  18. <g id="clust3" class="cluster">
  19. <title>cluster4</title>
  20. <polygon fill="none" stroke="black" points="192,-520.99 192,-721.99 778,-721.99 778,-520.99 192,-520.99"/>
  21. <text text-anchor="middle" x="242.5" y="-706.79" font-family="Times,serif" font-size="14.00">Box4:Select</text>
  22. </g>
  23. <g id="clust5" class="cluster">
  24. <title>cluster2</title>
  25. <polygon fill="none" stroke="black" points="200,-369.99 200,-501.99 454,-501.99 454,-369.99 200,-369.99"/>
  26. <text text-anchor="middle" x="250.5" y="-486.79" font-family="Times,serif" font-size="14.00">Box2:Select</text>
  27. </g>
  28. <g id="clust7" class="cluster">
  29. <title>cluster0</title>
  30. <polygon fill="none" stroke="black" points="16,-182 16,-350.99 326,-350.99 326,-182 16,-182"/>
  31. <text text-anchor="middle" x="66.5" y="-335.79" font-family="Times,serif" font-size="14.00">Box0:Select</text>
  32. </g>
  33. <g id="clust9" class="cluster">
  34. <title>cluster1</title>
  35. <polygon fill="none" stroke="black" points="8,-31 8,-163 170,-163 170,-31 8,-31"/>
  36. <text text-anchor="middle" x="84" y="-147.8" font-family="Times,serif" font-size="14.00">Box1:BaseTable T1</text>
  37. </g>
  38. <!-- boxhead3 -->
  39. <g id="node1" class="node">
  40. <title>boxhead3</title>
  41. <polygon fill="none" stroke="black" points="752,-749.49 752,-910.49 898,-910.49 898,-749.49 752,-749.49"/>
  42. <text text-anchor="middle" x="825" y="-895.29" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  43. <polyline fill="none" stroke="black" points="752,-887.49 898,-887.49 "/>
  44. <text text-anchor="middle" x="825" y="-872.29" font-family="Times,serif" font-size="14.00">0: Q4.c0 as A</text>
  45. <polyline fill="none" stroke="black" points="752,-864.49 898,-864.49 "/>
  46. <text text-anchor="middle" x="825" y="-849.29" font-family="Times,serif" font-size="14.00">1: Q4.c1 as B</text>
  47. <polyline fill="none" stroke="black" points="752,-841.49 898,-841.49 "/>
  48. <text text-anchor="middle" x="825" y="-826.29" font-family="Times,serif" font-size="14.00">2: Q4.c2 as C</text>
  49. <polyline fill="none" stroke="black" points="752,-818.49 898,-818.49 "/>
  50. <text text-anchor="middle" x="825" y="-803.29" font-family="Times,serif" font-size="14.00">3: Q4.c3 as A</text>
  51. <polyline fill="none" stroke="black" points="752,-795.49 898,-795.49 "/>
  52. <text text-anchor="middle" x="825" y="-780.29" font-family="Times,serif" font-size="14.00">4: Q4.c4 as B</text>
  53. <polyline fill="none" stroke="black" points="752,-772.49 898,-772.49 "/>
  54. <text text-anchor="middle" x="825" y="-757.29" font-family="Times,serif" font-size="14.00">5: Q4.c5 as C</text>
  55. </g>
  56. <!-- Q4 -->
  57. <g id="node2" class="node">
  58. <title>Q4</title>
  59. <ellipse fill="none" stroke="black" cx="697" cy="-829.99" rx="37.09" ry="37.09"/>
  60. <text text-anchor="middle" x="697" y="-826.29" font-family="Times,serif" font-size="14.00">Q4(F)</text>
  61. </g>
  62. <!-- boxhead4 -->
  63. <g id="node3" class="node">
  64. <title>boxhead4</title>
  65. <polygon fill="none" stroke="black" points="624,-529.49 624,-690.49 770,-690.49 770,-529.49 624,-529.49"/>
  66. <text text-anchor="middle" x="697" y="-675.29" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  67. <polyline fill="none" stroke="black" points="624,-667.49 770,-667.49 "/>
  68. <text text-anchor="middle" x="697" y="-652.29" font-family="Times,serif" font-size="14.00">0: Q2.c0 as A</text>
  69. <polyline fill="none" stroke="black" points="624,-644.49 770,-644.49 "/>
  70. <text text-anchor="middle" x="697" y="-629.29" font-family="Times,serif" font-size="14.00">1: Q2.c1 as B</text>
  71. <polyline fill="none" stroke="black" points="624,-621.49 770,-621.49 "/>
  72. <text text-anchor="middle" x="697" y="-606.29" font-family="Times,serif" font-size="14.00">2: Q2.c2 as C</text>
  73. <polyline fill="none" stroke="black" points="624,-598.49 770,-598.49 "/>
  74. <text text-anchor="middle" x="697" y="-583.29" font-family="Times,serif" font-size="14.00">3: Q3.c0 as A</text>
  75. <polyline fill="none" stroke="black" points="624,-575.49 770,-575.49 "/>
  76. <text text-anchor="middle" x="697" y="-560.29" font-family="Times,serif" font-size="14.00">4: Q3.c1 as B</text>
  77. <polyline fill="none" stroke="black" points="624,-552.49 770,-552.49 "/>
  78. <text text-anchor="middle" x="697" y="-537.29" font-family="Times,serif" font-size="14.00">5: Q3.c2 as C</text>
  79. </g>
  80. <!-- Q4&#45;&gt;boxhead4 -->
  81. <g id="edge2" class="edge">
  82. <title>Q4&#45;&gt;boxhead4</title>
  83. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M697,-792.5C697,-772.87 697,-747.5 697,-721.99"/>
  84. </g>
  85. <!-- Q2 -->
  86. <g id="node4" class="node">
  87. <title>Q2</title>
  88. <ellipse fill="none" stroke="black" cx="266" cy="-609.99" rx="65.79" ry="65.79"/>
  89. <text text-anchor="middle" x="266" y="-606.29" font-family="Times,serif" font-size="14.00">Q2(F) as A1</text>
  90. </g>
  91. <!-- Q3 -->
  92. <g id="node5" class="node">
  93. <title>Q3</title>
  94. <ellipse fill="none" stroke="black" cx="540" cy="-609.99" rx="65.79" ry="65.79"/>
  95. <text text-anchor="middle" x="540" y="-606.29" font-family="Times,serif" font-size="14.00">Q3(F) as A2</text>
  96. </g>
  97. <!-- Q2&#45;&gt;Q3 -->
  98. <g id="edge1" class="edge">
  99. <title>Q2&#45;&gt;Q3</title>
  100. <path fill="none" stroke="black" d="M331.98,-609.99C375.05,-609.99 431.07,-609.99 474.12,-609.99"/>
  101. <text text-anchor="middle" x="403" y="-616.79" font-family="Times,serif" font-size="14.00">(Q2.c0) = (Q3.c2)</text>
  102. </g>
  103. <!-- boxhead2 -->
  104. <g id="node6" class="node">
  105. <title>boxhead2</title>
  106. <polygon fill="none" stroke="black" points="300,-378.49 300,-470.49 446,-470.49 446,-378.49 300,-378.49"/>
  107. <text text-anchor="middle" x="373" y="-455.29" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  108. <polyline fill="none" stroke="black" points="300,-447.49 446,-447.49 "/>
  109. <text text-anchor="middle" x="373" y="-432.29" font-family="Times,serif" font-size="14.00">0: Q1.c0 as A</text>
  110. <polyline fill="none" stroke="black" points="300,-424.49 446,-424.49 "/>
  111. <text text-anchor="middle" x="373" y="-409.29" font-family="Times,serif" font-size="14.00">1: Q1.c1 as B</text>
  112. <polyline fill="none" stroke="black" points="300,-401.49 446,-401.49 "/>
  113. <text text-anchor="middle" x="373" y="-386.29" font-family="Times,serif" font-size="14.00">2: Q1.c2 as C</text>
  114. </g>
  115. <!-- Q2&#45;&gt;boxhead2 -->
  116. <g id="edge3" class="edge">
  117. <title>Q2&#45;&gt;boxhead2</title>
  118. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M298.68,-552.94C308.06,-536.86 318.44,-519.06 328.39,-501.98"/>
  119. </g>
  120. <!-- Q3&#45;&gt;boxhead2 -->
  121. <g id="edge4" class="edge">
  122. <title>Q3&#45;&gt;boxhead2</title>
  123. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M496.12,-560.78C479.75,-542.79 460.74,-521.89 442.62,-501.98"/>
  124. </g>
  125. <!-- Q1 -->
  126. <g id="node7" class="node">
  127. <title>Q1</title>
  128. <ellipse fill="none" stroke="black" cx="245" cy="-424.49" rx="37.09" ry="37.09"/>
  129. <text text-anchor="middle" x="245" y="-420.79" font-family="Times,serif" font-size="14.00">Q1(F)</text>
  130. </g>
  131. <!-- boxhead0 -->
  132. <g id="node8" class="node">
  133. <title>boxhead0</title>
  134. <polygon fill="none" stroke="black" points="172,-208.99 172,-300.99 318,-300.99 318,-208.99 172,-208.99"/>
  135. <text text-anchor="middle" x="245" y="-285.79" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  136. <polyline fill="none" stroke="black" points="172,-277.99 318,-277.99 "/>
  137. <text text-anchor="middle" x="245" y="-262.79" font-family="Times,serif" font-size="14.00">0: Q0.c0 as F1</text>
  138. <polyline fill="none" stroke="black" points="172,-254.99 318,-254.99 "/>
  139. <text text-anchor="middle" x="245" y="-239.79" font-family="Times,serif" font-size="14.00">1: Q0.c1 as F2</text>
  140. <polyline fill="none" stroke="black" points="172,-231.99 318,-231.99 "/>
  141. <text text-anchor="middle" x="245" y="-216.79" font-family="Times,serif" font-size="14.00">2: Q0.c2 as F3</text>
  142. </g>
  143. <!-- Q1&#45;&gt;boxhead0 -->
  144. <g id="edge5" class="edge">
  145. <title>Q1&#45;&gt;boxhead0</title>
  146. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M245,-387.14C245,-376.27 245,-363.81 245,-350.99"/>
  147. </g>
  148. <!-- Q0 -->
  149. <g id="node9" class="node">
  150. <title>Q0</title>
  151. <ellipse fill="none" stroke="black" cx="89" cy="-254.99" rx="64.99" ry="64.99"/>
  152. <text text-anchor="middle" x="89" y="-251.29" font-family="Times,serif" font-size="14.00">Q0(F) as T1</text>
  153. </g>
  154. <!-- boxhead1 -->
  155. <g id="node10" class="node">
  156. <title>boxhead1</title>
  157. <polygon fill="none" stroke="black" points="16,-39.5 16,-131.5 162,-131.5 162,-39.5 16,-39.5"/>
  158. <text text-anchor="middle" x="89" y="-116.3" font-family="Times,serif" font-size="14.00">Distinct: Preserve</text>
  159. <polyline fill="none" stroke="black" points="16,-108.5 162,-108.5 "/>
  160. <text text-anchor="middle" x="89" y="-93.3" font-family="Times,serif" font-size="14.00">0: c0 as F1</text>
  161. <polyline fill="none" stroke="black" points="16,-85.5 162,-85.5 "/>
  162. <text text-anchor="middle" x="89" y="-70.3" font-family="Times,serif" font-size="14.00">1: c1 as F2</text>
  163. <polyline fill="none" stroke="black" points="16,-62.5 162,-62.5 "/>
  164. <text text-anchor="middle" x="89" y="-47.3" font-family="Times,serif" font-size="14.00">2: c2 as F3</text>
  165. </g>
  166. <!-- Q0&#45;&gt;boxhead1 -->
  167. <g id="edge6" class="edge">
  168. <title>Q0&#45;&gt;boxhead1</title>
  169. <path fill="none" stroke="black" stroke-dasharray="5,2" d="M89,-189.72C89,-180.97 89,-171.93 89,-163"/>
  170. </g>
  171. </g>
  172. </svg>