You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The optimization time grows exponentially as the number of subqueries increases which could lead to tokio runtime thread pool can't schedule other tasks and cause starving.
createtablet1(a int, b int);
createtablet2(c intprimary key, d int);
-- 4s to optimize
explain
select
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0),
COALESCE((SELECT b FROM t2 WHEREt1.a=t2.c), 0)
from t1;
The text was updated successfully, but these errors were encountered:
createtablet1(a int, b int);
createtablet2(c intprimary key, d int);
createtablet3(e int, f int);
createtablet4(g int, h int);
createtablet5(i int, j int);
createtablet6(k int, l int);
select
COALESCE((SELECTsum(d) FROM t2 left join t3 on e = a and f = c left join t4 on g = a and h = c left join t5 on i = a and j = c WHEREt1.a=t2.candt1.a=t2.cand j in (select k from t6 where b = l) ), 0),
COALESCE((SELECTsum(d) FROM t2 left join t3 on e = a and f = c left join t4 on g = a and h = c left join t5 on i = a and j = c WHEREt1.a=t2.candt1.a=t2.cand j in (select k from t6 where b = l) ), 0),
COALESCE((SELECTsum(d) FROM t2 left join t3 on e = a and f = c left join t4 on g = a and h = c left join t5 on i = a and j = c WHEREt1.a=t2.candt1.a=t2.cand j in (select k from t6 where b = l) ), 0),
COALESCE((SELECTsum(d) FROM t2 left join t3 on e = a and f = c left join t4 on g = a and h = c left join t5 on i = a and j = c WHEREt1.a=t2.candt1.a=t2.cand j in (select k from t6 where b = l) ), 0),
COALESCE((SELECTsum(d) FROM t2 left join t3 on e = a and f = c left join t4 on g = a and h = c left join t5 on i = a and j = c WHEREt1.a=t2.candt1.a=t2.cand j in (select k from t6 where b = l) ), 0),
from t1;
The optimization time grows exponentially as the number of subqueries increases which could lead to tokio runtime thread pool can't schedule other tasks and cause starving.
The text was updated successfully, but these errors were encountered: