0
次のクエリがあり、HUEで実行するのに12時間かかります。私は、クエリのパフォーマンスを向上させたいと思います。私はHQLパフォーマンスを向上させる方法
SELECT ordernum,
Min(distance) mindist,
Min(CASE
WHEN type_name = 'T'
OR (type_name = 'I'
AND item LIKE '%D%') THEN distance
ELSE 9999999
END) min_t,
Min(CASE
WHEN type_name = 'A' THEN distance
ELSE 9999999
END) min_a
FROM (SELECT a.ordernum,
b.id,
b.type_name,
b.item,
Round(Least(Sqrt(Pow(b.sty-a.nrthng, 2)
+ Pow(b.stx-a.estng, 2)),
Sqrt(Pow(b.endy-a.nrthng, 2)
+ Pow(b.endx-a.estng, 2))))
distance
FROM temp_b a,
min_b1 b
WHERE ((b.stx BETWEEN (a.estng - 1000) AND (a.estng + 1000)
AND b.sty BETWEEN (a.nrthng - 1000) AND
(a.nthing + 1000))
OR (b.endx BETWEEN (a.estng - 1000) AND (a.esng + 1000)
AND b.endy BETWEEN (a.nrthng - 1000) AND
(a.nrthng + 1000)))) a
GROUP BY ordernum
読みやすくするために、クエリをフォーマットしてください。 – anon