Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

optimzer fail to optimize #1642

Open
liyichao opened this issue Apr 23, 2022 · 0 comments
Open

optimzer fail to optimize #1642

liyichao opened this issue Apr 23, 2022 · 0 comments

Comments

@liyichao
Copy link

liyichao commented Apr 23, 2022

Bug Report

optimzer fail to optimize

NoisePage

noisepage=# create table foo (a int); create table bar (b int);
CREATE TABLE
CREATE TABLE
noisepage=# insert into foo values (1),(2),(3); insert into bar values (1),(2);
INSERT 0 3
INSERT 0 2
noisepage=# select * from foo where exists (select * from bar limit 1);

(noisepage stucks until oom at a 8GB machine)

Postgres

postgres=# create table foo (a int); create table bar (b int);
CREATE TABLE
CREATE TABLE
postgres=# insert into foo values (1),(2),(3); insert into bar values (1),(2);
INSERT 0 3
INSERT 0 2
postgres=#  select * from foo where exists (select * from bar limit 1);
 a
---
 1
 2
 3
(3 rows)

this is the stack of noisepage:

Thread 9 (Thread 0x7f2b83bff700 (LWP 7291)):
#0  0x00007ffe2039aaed in clock_gettime ()
#1  0x00007f2b8c5070b5 in __GI___clock_gettime (clock_id=0, tp=0x7f2b83bfc550) at ../sysdeps/unix/sysv/linux/clock_gettime.c:38
#2  0x00007f2b8c855bd2 in std::chrono::_V2::system_clock::now() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x0000564449a28ba8 in noisepage::common::ScopedTimer<std::chrono::duration<long, std::ratio<1l, 1000l> > >::~ScopedTimer (this=0x7f2b83bfc610, __in_chrg=<optimized out>) at /Projects/noisepage/src/include/common/scoped_timer.h:34
#4  0x0000564449a25956 in noisepage::optimizer::Optimizer::ExecuteTaskStack (this=0x7f2b83bfc980, task_stack=0x7f2b81000180, root_group_id=..., root_context=0x7f2b810436c0) at /Projects/noisepage/src/optimizer/optimizer.cpp:248
#5  0x0000564449a257ad in noisepage::optimizer::Optimizer::OptimizeLoop (this=0x7f2b83bfc980, root_group_id=..., required_props=0x7f2b83bfc940) at /Projects/noisepage/src/optimizer/optimizer.cpp:227
#6  0x0000564449a23a45 in noisepage::optimizer::Optimizer::BuildPlanTree (this=0x7f2b83bfc980, txn=0x7f2b8102fa00, accessor=0x7f2b81034000, storage=0x7f2b8bcb43f0, query_info=..., op_tree=std::unique_ptr<class noisepage::optimizer::AbstractOptimizerNode> = {...}, parameters=...) at /Projects/noisepage/src/optimizer/optimizer.cpp:53
#7  0x0000564449984f96 in noisepage::trafficcop::TrafficCopUtil::Optimize (txn=..., accessor=..., query=..., db_oid=..., stats_storage=..., cost_model=std::unique_ptr<class noisepage::optimizer::AbstractCostModel> = {...}, optimizer_timeout=5000, parameters=...) at /Projects/noisepage/src/traffic_cop/traffic_cop_util.cpp:78
#8  0x00005644496c0add in noisepage::trafficcop::TrafficCop::OptimizeBoundQuery (this=0x7f2b8bc25020, connection_ctx=..., query=..., parameters=...) at /Projects/noisepage/src/traffic_cop/traffic_cop.cpp:194
#9  0x00005644491b81bb in noisepage::network::SimpleQueryCommand::Exec (this=0x7f2b8100f090, interpreter=..., out=..., t_cop=..., connection=...) at /Projects/noisepage/src/network/postgres/postgres_network_commands.cpp:215
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant