Skip to content

Don't try to use Orca for queries that it doesn't support#279

Draft
andr-sokolov wants to merge 2 commits intoOPENGPDB_STABLEfrom
use_postgres_planner
Draft

Don't try to use Orca for queries that it doesn't support#279
andr-sokolov wants to merge 2 commits intoOPENGPDB_STABLEfrom
use_postgres_planner

Conversation

@andr-sokolov
Copy link
Copy Markdown
Contributor

@andr-sokolov andr-sokolov commented Oct 25, 2025

Don't try to use Orca for queries that it doesn't support

On translating to DXL we can find out that the query is unsupported. The better
time to make this decision is analyse stage, because in this case we can run
Postgres planner without trying to run Orca and, as a consequence, significantly
reduce planning time.
Orca doesn't support gp_dist_random, queries on master-only tables, and function
exec locations except for any. It's easy to detect on analyse stage, that
a query contains these unsupported query properties.
The number of unsupported query properties to check before translating to DXL
will be increased later.


Before the patch

postgres=# select oid from pg_class where relname='pg_class';
 oid  
------
 1259
(1 row)

Time: 9,869 ms
postgres=# 

After the patch

postgres=# select oid from pg_class where relname='pg_class';
 oid  
------
 1259
(1 row)

Time: 1,995 ms
postgres=#

Don't plan simple inserts using Orca

@leborchuk
Copy link
Copy Markdown
Contributor

+1, Also we could use PG optimizer for insert values queries

andr-sokolov and others added 2 commits April 21, 2026 16:30
On translating to DXL we can find out that the query is unsupported. The better
time to make this decision is analyse stage, because in this case we can run
Postgres planner without trying to run Orca and, as a consequence, significantly
reduce planning time.
Orca doesn't support gp_dist_random, queries on master-only tables, and function
exec locations except for any. It's easy to detect on analyse stage, that
a query contains these unsupported query properties.
The number of unsupported query properties to check before translating to DXL
will be increased later.
@Alena0704 Alena0704 force-pushed the use_postgres_planner branch from ab23e5e to 0f36433 Compare April 21, 2026 14:18
@Alena0704
Copy link
Copy Markdown
Contributor

I think this patch looks promising. I rebased the patch and also propose to switch off Orca to prepare query plan (last commit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants