Issue Details (XML | Word | Printable)

Key: CORE-5965
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Haakon Nergaard
Votes: 0
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Firebird Core

FB3 Optimiser chooses less efficient plan than FB2.5 optimiser

Created: 16/Nov/18 08:48 PM   Updated: 09/Dec/18 08:59 AM
Component/s: Engine
Affects Version/s: 3.0.4
Fix Version/s: 4.0 Beta 1, 3.0.5

File Attachments: 1. File optimizer_test_setup.sql (2 kB)

Environment: Tested on MacOS and Debian9, both 3.0.4 and 2.5.8
Issue Links:
Relate
 

QA Status: Done successfully


 Description  « Hide
The optimiser in FB3 fails to use an index when there's an extra check in the where clause. The optimiser in FB2.5 can figure it out nicely. Code for creating and populating table in attachment. Example code below:

/**
 * Here's the select. Please test with and without "sysid"
 */
select * from opt_test
where
--sysid = 1 and
clid = 23 and
cust_type = 1 and
cust_id = 73
order by order_no desc

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.