Open bajinsheng opened 1 week ago
Hi @bajinsheng, please add branch-* labels to identify which branch(es) this C-bug affects.
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.
Hello, I am Blathers. I am here to help you get the issue triaged.
Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.
I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.
Thanks for this report!
Describe the problem
For query 7 in TPC-H benchmark:
Its execution time is 15.7s, as shown in its query plan original.txt
I found that negatingthe following IF code block brings a significant performance improvement:
Its execution time is reduced to 5.4s, as shown in the new query plan derived.txt
I am not proposing a fixing patch. Instead, I believe this case shows that the optimizer produces a more efficient query plan based on the current implementation. I wonder whether we can optimize the code anywhere to enable the second query plan.
To Reproduce
Then execute the above query.
Environment:
psql "postgresql://root@127.0.0.1:26257/tpch"
]Jira issue: CRDB-44256
Jira issue: CRDB-44329