[
https://issues.apache.org/jira/browse/DERBY-7173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17912938#comment-17912938
]
Bryan Pendleton edited comment on DERBY-7173 at 1/14/25 3:12 PM:
-----------------------------------------------------------------
Perhaps you could start with some of [the suggestions from this wiki
page|https://cwiki.apache.org/confluence/display/DERBY/PerformanceDiagnosisTips],
and see what you can learn about the behavior that you're observing. Also,
there's a vast amount of additional information about the tools you can use for
this purpose in [the Derby Tuning
Guide|https://db.apache.org/derby/docs/10.17/tuning/index.html]
was (Author: bpendleton):
Perhaps you could start with some of [the suggestions from this wiki
page|https://cwiki.apache.org/confluence/display/DERBY/PerformanceDiagnosisTips],
and see what you can learn about the behavior that you're observing.
> Very poor performance with a = ? AND b = ? OR a = ? AND b = ? in query
> ----------------------------------------------------------------------
>
> Key: DERBY-7173
> URL: https://issues.apache.org/jira/browse/DERBY-7173
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.16.1.1
> Reporter: Richard Evans
> Priority: Major
> Attachments: lkp.java
>
>
> Execute a query like:
> SELECT * FROM table WHERE col1 = ? AND col2 = ? OR col1 = ? AND col2 = ?
> Performance is significantly worse then the simpler:
> SELECT * FROM table WHERE col1 = ? AND col2 = ?
> even though both col1 and col2 are indexed.
> Simple test case attached - run with db directory and number of OR clauses in
> query - use 2 for first example above and 1 for second.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)