Comments (1)
insert into bar select i%100 from generate_series(1,10000) i;
insert into t1 select i%100 from generate_series(1,10000) i;
I inserted tuple and the query generates the right plan.
vraghavan=# set optimizer = on;
SET
vraghavan=# explain select * from bar where exists (select a from t1);
QUERY PLAN
------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..1324255.94 rows=10000 width=4)
-> Nested Loop EXISTS Join (cost=0.00..1324255.79 rows=3334 width=4)
Join Filter: true
-> Table Scan on bar (cost=0.00..431.06 rows=3334 width=4)
-> Materialize (cost=0.00..431.07 rows=1 width=1)
-> Broadcast Motion 1:3 (slice2) (cost=0.00..431.07 rows=3 width=1)
-> Limit (cost=0.00..431.07 rows=1 width=1)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.07 rows=1 width=1)
-> Limit (cost=0.00..431.07 rows=1 width=1)
-> Table Scan on t1 (cost=0.00..431.06 rows=3334 width=1)
Settings: optimizer=on
Optimizer status: PQO version 2.48.1
(12 rows)
Reason GPORCA did not pick the plan u wanted is because there is no data, in which the subplan is equally fast.
from gporca.
Related Issues (20)
- make error on aarch64 with gcc 8.3.0 on archlinuxarm 64 HOT 8
- Memory leak when running JoinPlanWithRedistribute.mdp in debug mode
- Incorrect join partition elimination HOT 3
- Long plan generation utilising all available memory HOT 1
- make error on solaris HOT 3
- GPORCA doesn't support aarch64 platform.
- can orca apply to innodb?
- gporca occurs exception when using statistic from numeric(30, 8) column to optimize plan
- clang-format in Allman style always indents the contents of extern "C" blocks in C headers
- no <dxl:DistrOpfamilies> tag in gporca/server/dxl.xsd
- CHistogram should keep track of row count (cardinality)
- Orca optimizer single-threaded vs. multi-threaded HOT 3
- why COptCtxt to tls
- [question] why use `virtual` instead of `override`
- Delegating query optimization task to Orca HOT 1
- Orca - how to use
- Is there any formal grammar for the definition of query/plan?
- Should consider startup cost of inner table in NLJ? HOT 1
- Is a bug of CExpression.cpp:505?
- Incorrect result about group by SQL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gporca.