doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] About the limit query, limit 1, the background will still perform a large number of calculations after the output of 1 result.关于limit查询,limit 1,输出结果1条后,后台仍会进行大量计算的问题。

Open shaotianfeng opened this issue 3 years ago • 10 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

doris operating environment and configuration: 6 clusters, 4 fe and be mixed, 2 be alone, doris version 2.0.1. About the limit query, limit 1, after the output result 1, the background will still perform a large number of calculations, the big table 1.7 billion data, the small table 50 million data, Run select s1.* from ele_5000_1 s1 join ele_5000 s2 where s1.ele_id=s2.ele_id limit 1.. doris运行环境和配置:6台集群,4台fe和be混用,2台单独be,doris版本2.0.1。关于limit查询,limit 1,输出结果1条后,后台仍会进行大量计算的问题,大表17亿条数据,小表5千万数据,在执行select s1.* from ele_5000_1 s1 join ele_5000 s2 where s1.ele_id=s2.ele_id limit 1 。

What's Wrong?

When executing this statement query, the result can be produced in one or two seconds, but there will still be a lot of resources (cpu, memory, bandwidth) in the background, and these resources will be released after a period of time. 在执行这条语句查询时,一二秒可以出结果,但后台仍会存在大量资源(cpu、内存、带宽)利用,一段时间后这些资源才会释放.

What You Expected?

Can you provide a solution, or what configuration changes need to be made. 请问能否给出一个解决方案,或者说需要进行什么配置修改。

How to Reproduce?

If there are 1.7 billion data in the big table and 50 million data in the small table, run select s1.* from ele_5000_1 s1 join ele_5000 s2 where s1.ele_id=s2.ele_id limit 1. 大表17亿条数据,小表5千万数据,在执行select s1.* from ele_5000_1 s1 join ele_5000 s2 where s1.ele_id=s2.ele_id limit 1 。

Anything Else?

no. 没有了

Are you willing to submit PR?

  • [x] Yes I am willing to submit a PR!

Code of Conduct

shaotianfeng avatar Oct 19 '23 01:10 shaotianfeng

This sql could have found 5000 pieces of data, and found one after adding limit 1, but the background still has a lot of resources occupied after querying the data. 这个sql原本可以查出5000条数据,添加limit 1之后查出一条,但后台在查询出数据之后还在有大量资源被占用。

shaotianfeng avatar Oct 19 '23 07:10 shaotianfeng

doris1.2.7版本并没有这个问题,换了一个版本同样的场景没有问题

shaotianfeng avatar Oct 20 '23 02:10 shaotianfeng

大表和小表的join的limit才会出现这个问题, 单独查一个表limit是不存在这个问题的

shaotianfeng avatar Oct 20 '23 03:10 shaotianfeng

set experimental_enable_pipeline_engine = false 关了pipeline试试

LemonLiTree avatar Oct 20 '23 04:10 LemonLiTree

set experimental_enable_pipeline_engine = false 关闭管道尝试

这个是有效的,可以解决这个问题,准确的说是set enable_pipeline_engine = false。这个Pipeline执行引擎应该还存在这个问题,目前版本先不开启了

shaotianfeng avatar Oct 20 '23 06:10 shaotianfeng

可以升级到2.0.2 试试,后续版本pipeline会优化

LemonLiTree avatar Oct 20 '23 06:10 LemonLiTree

昨天有试着升级2.0.2还是存在这个问题,然后又降级了

shaotianfeng avatar Oct 20 '23 07:10 shaotianfeng

昨天有试着升级2.0.2还是存在这个问题,然后又降级了

请问,降级需要什么特殊操作么,还是直接替换原来备份的代码并重启就好

feng-kui avatar Oct 30 '23 09:10 feng-kui

版本:2.1.1 也有 limit 不受限的问题。 比如:select * from table where xxx limit 1。想要的效果是给任何一条满足条件的数据即可,但实际会扫描所有满足条件的数据。

eleven-f avatar Apr 28 '24 13:04 eleven-f

We're closing this issue because it hasn't been updated in a while. If you'd like to revive this issue, please reopen it and feel free a maintainer to remove the Stale tag!

github-actions[bot] avatar Sep 13 '25 00:09 github-actions[bot]