Reusing subqueries in AWS Athena generate large amount of data scanned

笑着哭i 提交于 2019-12-23 03:44:10

问题


On AWS Athena, I am trying to reuse computed data using a WITH clause, e.g.

WITH temp_table AS (...)
SELECT ...
FROM temp_table t0, temp_table t1, temp_table t2
WHERE ...

If the query is fast, the "Data scanned" goes through the roof. As if temp_table is computed for each time it is reference in the FROM clause.

I don't see the issue if I create a temp table separately and use it multiple times in the query.

Is there a way to really reuse a subquery multiple times without any penalty?

来源:https://stackoverflow.com/questions/54816300/reusing-subqueries-in-aws-athena-generate-large-amount-of-data-scanned

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!