matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: cte recursive: multi recursive layers, insufficient memory error reported

Open heni02 opened this issue 1 year ago • 58 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):6828ed04cefb5e2b306120f655ab34c16c56aa1a
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

mo limit 100 iterations,mem 16GB mac execute sql reported :Invalid alloc size 1147486208,about 1GB 企业微信截图_0a65cf72-5009-4fb5-ac79-051c425becdc

mysql: 企业微信截图_a47a46d1-161d-43cd-a489-db7c67a0e74e

Expected Behavior

No response

Steps to Reproduce

with recursive  cte_ab_8(productID,price) as(select p_id,price from product  union all select c.productID,p.price from product p join cte_ab_8 c on p.p_id = c.productID)select * from cte_ab_8;

ddl:
create table product (id int primary key,p_id int,p_name varchar(25),price decimal(10,3));
insert into product values (3,2,"bed",3560.98),(2,null,"chair",1599.00),(4,1,"desk",2999.99),(5,3,"door",8123.09),(6,3,"mirrors",698.00),(7,4,"tv",5678);

Additional information

No response

heni02 avatar Aug 18 '23 08:08 heni02

@iamlinjunhong plz confirm

heni02 avatar Aug 18 '23 08:08 heni02

retest on 128 server, it is reported same error :internal error: Invalid alloc size 1147486208 企业微信截图_cb2411c2-88ca-413c-baf5-519bd82a78e8

so it is two questions: 1.Invalid alloc size 1147486208, about 1GB is small? 2.which priority is higher for memory limit and limit 100 limit errors? mysql returns limit errors quickly during execution

heni02 avatar Aug 22 '23 03:08 heni02

无进度,在看其他问题

iamlinjunhong avatar Aug 28 '23 11:08 iamlinjunhong

在看其他问题

iamlinjunhong avatar Sep 01 '23 14:09 iamlinjunhong

join 的结果是个超过 1G 的batch,导致在 dup 的时候出错

iamlinjunhong avatar Sep 05 '23 03:09 iamlinjunhong

把join probe 出来的大 batch,切分成小 batch 后由于递归计算出的中结果太大(几十上百亿行数据),mo 跑一段时间会 oom,需要做 spill。mysql 在 129 上还未能跑出结果

iamlinjunhong avatar Sep 06 '23 08:09 iamlinjunhong

mysql 在 128上报错 截屏2023-09-06 下午5 31 49

iamlinjunhong avatar Sep 06 '23 09:09 iamlinjunhong

还需要做 spill

iamlinjunhong avatar Sep 06 '23 11:09 iamlinjunhong

Not working on this today

aunjgr avatar Sep 11 '23 11:09 aunjgr

不需要做spill。应该把大的batch按8192行切块。等pipeline重构吧

aunjgr avatar Sep 12 '23 09:09 aunjgr

not working on this

aunjgr avatar Sep 15 '23 10:09 aunjgr

not working on this today

aunjgr avatar Sep 20 '23 14:09 aunjgr

Not started

aunjgr avatar Sep 26 '23 14:09 aunjgr

Not started

aunjgr avatar Oct 13 '23 10:10 aunjgr

Not started

aunjgr avatar Oct 18 '23 15:10 aunjgr

pipeline重构之后可自然解决

aunjgr avatar Oct 23 '23 12:10 aunjgr

暂无进展

zengyan1 avatar Dec 21 '23 10:12 zengyan1

暂无进展

zengyan1 avatar Dec 26 '23 10:12 zengyan1

暂无进展

zengyan1 avatar Dec 29 '23 10:12 zengyan1

本周请假

zengyan1 avatar Jan 03 '24 14:01 zengyan1

暂无进展

zengyan1 avatar Jan 08 '24 11:01 zengyan1

暂无进展

zengyan1 avatar Jan 11 '24 12:01 zengyan1

https://github.com/matrixorigin/matrixone/pull/14136 这个pr合入后会长时间不报错

zengyan1 avatar Jan 15 '24 05:01 zengyan1

企业微信20240115-132407@2x

zengyan1 avatar Jan 15 '24 05:01 zengyan1

还需要限制递归深度

zengyan1 avatar Jan 18 '24 10:01 zengyan1

暂无进展

zengyan1 avatar Jan 23 '24 10:01 zengyan1

暂无进展

zengyan1 avatar Jan 26 '24 10:01 zengyan1

暂无进展

zengyan1 avatar Jan 31 '24 10:01 zengyan1

暂无进展

zengyan1 avatar Feb 06 '24 13:02 zengyan1

暂无进展

zengyan1 avatar Feb 21 '24 10:02 zengyan1