Don't use Orca to plan trivial constant queries#400
Draft
Alena0704 wants to merge 1 commit into
Draft
Conversation
25c8169 to
8e4ab9e
Compare
andr-sokolov
reviewed
Jul 7, 2026
andr-sokolov
reviewed
Jul 7, 2026
Comment on lines
+5879
to
+5882
| return parse->commandType == CMD_SELECT && | ||
| parse->rtable == NIL && | ||
| !parse->hasSubLinks && | ||
| parse->parentStmtType == PARENTSTMTTYPE_NONE; |
Contributor
There was a problem hiding this comment.
I think we should somehow change this condition to don't affect this test
select aggfns(a,b,c)
from (values (1,3,'foo'),(0,null,null),(2,2,'bar'),(3,1,'baz')) v(a,b,c);
-INFO: GPORCA failed to produce a plan, falling back to planner
-DETAIL: Feature not supported: ROW EXPRESSION
-CONTEXT: SQL function "aggfns_trans" during startup
Contributor
Author
There was a problem hiding this comment.
I had to update the expected .out files because we now never invoke Orca for trivial constant queries, so there is nothing to fail and the notice is gone.
f0ece2e to
66d4c4a
Compare
Queries such as "SELECT 42" have no range table and nothing to distribute across segments. Sending them to Orca brings no benefit and only adds optimization overhead before falling back to the Postgres planner anyway.
90844bd to
6b7ed8f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't use Orca to plan trivial constant queries
Queries such as "SELECT 42" have no range table and nothing to distribute across segments. Sending them to Orca brings no benefit and only adds optimization overhead before falling back to the Postgres planner anyway.