github-16036.slt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # Regression test for https://github.com/MaterializeInc/materialize/pulls/16036
  10. mode cockroach
  11. statement ok
  12. CREATE TABLE t1 (v1 TEXT, k1 INTEGER, k2 INTEGER);
  13. statement ok
  14. CREATE TABLE t2 (v2 TEXT, k1 INTEGER);
  15. statement ok
  16. CREATE TABLE t3 (v3 TEXT, k2 INTEGER);
  17. statement ok
  18. CREATE INDEX i1 ON t1 (k1);
  19. statement ok
  20. CREATE INDEX i2 ON t2 (k1);
  21. statement ok
  22. CREATE INDEX i3 ON t3 (k2);
  23. statement ok
  24. CREATE VIEW test AS SELECT v1, v2, v3 FROM t1, t2, t3 where t1.k1 = t2.k1 and t1.k2 = t3.k2;
  25. query T multiline
  26. EXPLAIN PHYSICAL PLAN AS VERBOSE TEXT FOR SELECT * FROM test;
  27. ----
  28. Explained Query:
  29. Join::Delta
  30. plan_path[0]
  31. delta_stage[1]
  32. closure
  33. project=(#1..=#3)
  34. lookup={ relation=2, key=[#1{k2}] }
  35. stream={ key=[#1{k2}], thinning=(#0, #2) }
  36. delta_stage[0]
  37. closure
  38. project=(#1..=#3)
  39. lookup={ relation=1, key=[#1{k1}] }
  40. stream={ key=[#1{k1}], thinning=(#0, #2) }
  41. initial_closure
  42. project=(#1, #0, #2)
  43. source={ relation=0, key=[#1{k1}] }
  44. plan_path[1]
  45. delta_stage[1]
  46. closure
  47. project=(#1..=#3)
  48. lookup={ relation=2, key=[#1{k2}] }
  49. stream={ key=[#1{k2}], thinning=(#0, #2) }
  50. delta_stage[0]
  51. closure
  52. project=(#2, #3, #1)
  53. lookup={ relation=0, key=[#1{k1}] }
  54. stream={ key=[#1{k1}], thinning=(#0) }
  55. initial_closure
  56. project=(#1, #0)
  57. source={ relation=1, key=[#1{k1}] }
  58. plan_path[2]
  59. delta_stage[1]
  60. closure
  61. project=(#1, #3, #2)
  62. lookup={ relation=1, key=[#1{k1}] }
  63. stream={ key=[#1{k1}], thinning=(#0, #2) }
  64. delta_stage[0]
  65. closure
  66. project=(#2, #3, #1)
  67. lookup={ relation=0, key=[#2{k2}] }
  68. stream={ key=[#1{k2}], thinning=(#0) }
  69. initial_closure
  70. project=(#1, #0)
  71. source={ relation=2, key=[#1{k2}] }
  72. ArrangeBy
  73. raw=true
  74. arrangements[0]={ key=[#1{k1}], permutation={#0: #1, #1: #0}, thinning=(#0, #2) }
  75. arrangements[1]={ key=[#2{k2}], permutation={#0: #1, #1: #2, #2: #0}, thinning=(#0, #1) }
  76. types=[text?, integer, integer]
  77. Get::Arrangement materialize.public.t1
  78. project=(#1, #0, #2)
  79. filter=((#0{k1}) IS NOT NULL AND (#2{k2}) IS NOT NULL)
  80. key=#1{k1}
  81. raw=false
  82. arrangements[0]={ key=[#1{k1}], permutation={#0: #1, #1: #0}, thinning=(#0, #2) }
  83. types=[text?, integer?, integer?]
  84. Get::PassArrangements materialize.public.t2
  85. raw=false
  86. arrangements[0]={ key=[#1{k1}], permutation={#0: #1, #1: #0}, thinning=(#0) }
  87. types=[text?, integer?]
  88. Get::PassArrangements materialize.public.t3
  89. raw=false
  90. arrangements[0]={ key=[#1{k2}], permutation={#0: #1, #1: #0}, thinning=(#0) }
  91. types=[text?, integer?]
  92. Used Indexes:
  93. - materialize.public.i1 (*** full scan ***)
  94. - materialize.public.i2 (delta join lookup)
  95. - materialize.public.i3 (delta join lookup)
  96. Target cluster: quickstart
  97. EOF