为了更快的定位您的问题,请提供以下信息,谢谢
【详述】
ISNERT INTO的时候出现ERROR Runtime error: failed memory alloc in constructor
【背景】
多表关联导入Bitmap出现failed memory alloc in constructor,优化SQL之后改写成Bitmap还是不行
【业务影响】
为上线,测试环境中
【StarRocks版本】
2.3.13 974398d
【集群规模】例如:3fe(1 follower+2observer)+ 7be(fe与be混部)
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】xujianjun159@gmail.com
【附件】
INSERT INTO tag_user_uploaded
SELECT *
FROM (
WITH init_event AS (
SELECT bitmap_union(to_bitmap(mapid)) users, enddate
FROM xxxx
WHERE enddate BETWEEN ‘2023-07-10’ AND ‘2023-07-17’
AND product_id = 18
AND plat_name = 17
AND page_id = 227
AND BITMAP_CONTAINS((
SELECT BITMAP_UNION(users)
FROM tag_user_bitmap_string
WHERE id = 101622
AND tag_id = ‘fvio’
AND platform = ‘ALL’
AND tag_value IN (‘1’)
), mapid)
group by enddate
),
retention_event AS (
SELECT bitmap_union(to_bitmap(mapid)) users, enddate
FROM xxxx
WHERE enddate BETWEEN ‘2023-07-10’ AND ‘2023-07-24’
AND product_id = 18
AND plat_name = 17
AND page_id = 121014
group by enddate
),
retention_table AS (
SELECT bitmap_and(a.users, b.users) users, DATEDIFF(b.enddate, a.enddate) AS date_diff, a.enddate AS enddate
, ‘’ AS tag_value
FROM init_event a
INNER JOIN retention_event b ON a.enddate <= b.enddate
WHERE DATEDIFF(b.enddate, a.enddate) >= 0
AND DATEDIFF(b.enddate, a.enddate) <= 7
)
SELECT ‘TEST_0727’, 3
, (
SELECT users
FROM retention_table
WHERE date_diff = 1
AND enddate = ‘2023-07-12’
)
) t
- 慢查询:
- 查询报错:
ERROR Runtime error: failed memory alloc in constructor