gpt4 book ai didi

mysql - BigQuery 表对于 JOIN 来说太大,并且在查询执行期间超出了资源

转载 作者:行者123 更新时间:2023-11-30 23:01:03 25 4
gpt4 key购买 nike

我尝试了两种不同的方法来执行此查询,但我收到第一个表太大而无法加入,第二个收到查询执行期间超出资源...

这些查询:

SELECT COUNT(DISTINCT(s_pageview_id)) as total
FROM impressions.tbl_impressions_201405
WHERE i_browser IN (1)
AND fk_i_id_tbl_vertical IN (1)
AND i_section IN (1)
AND s_ads_list != ''
AND b_is_human = true
AND DATE(dt_date) = '2014-05-28'
AND s_pageview_id NOT IN (
SELECT s_pageview_id
FROM impressions.tbl_impressions_201405
WHERE i_section IN (26,27,83,96)
AND i_browser IN (1)
AND fk_i_id_tbl_vertical IN (1)
AND DATE(dt_date) = '2014-05-28'
AND s_ads_list != ''
AND b_is_human = true
)

第二个查询:

SELECT COUNT(*) AS total
FROM impressions.tbl_impressions_201405 as impressions_1
LEFT OUTER JOIN EACH impressions.tbl_impressions_201405 as impressions_2
ON impressions_1.s_pageview_id = impressions_2.s_pageview_id
WHERE impressions_2.i_browser IN (1)
AND impressions_2.fk_i_id_tbl_vertical IN (1)
AND impressions_2.i_section IN (1)
AND impressions_2.b_is_human = true
AND DATE(impressions_2.dt_date) = '2014-05-28'
AND impressions_1.i_section IN (26,27,83,96)

你知道还有其他方法可以尝试吗?!

非常感谢...

最佳答案

您的问题在元数据方面严重不足。你的表有多大,第一个表的连接在哪里等。但是:

1) 尝试JOIN EACH。您可以使用 this visualisation as a guide 更具体地连接。 .
2) 尝试保存表格并允许较大的结果。 enter image description here

关于mysql - BigQuery 表对于 JOIN 来说太大,并且在查询执行期间超出了资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23942162/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com