-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DISTINCT in subquery prevents Db2 from selecting optimal execution plan #1327
Comments
Can not remember if the distinct was added to avoid the duplication issue ... |
It was, Robin has an alternative. |
The new EXISTS queries follow a similar form to this:
The EXISTS sub-queries are correlated with the main join using the predicate |
…execution plans Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
…ter order Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
Signed-off-by: Robin Arnold <robin.arnold23@ibm.com>
Issue #1327 Improve execution plans for search
Describe the bug
Search request including tokens generates the following SQL:
Several of the sub-selects use
SELECT DISTINCT
. This prevents the optimizer from pushing down join predicates resulting in a less-than-optimal execution plan.To Reproduce
Performance test with search requests.
Expected behavior
Rewrite the query to permit a more efficient execution plan.
Additional context
N/A
The text was updated successfully, but these errors were encountered: