Issue Details (XML | Word | Printable)

Key: CORE-4530
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Pavel Zotov
Votes: 0
Watchers: 2
Operations

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

DB_KEY based join of two tables may be ineffective

Created: 25/Aug/14 01:24 PM   Updated: 25/Sep/15 01:13 PM
Component/s: Engine
Affects Version/s: 3.0 Alpha 2, 2.5.3
Fix Version/s: 3.0 Beta 1, 2.5.4

Issue Links:
Relate
 

QA Status: Done successfully
Test Details: See also: CORE-4038, CORE-4492


 Description  « Hide
Simplified test case:

recreate table t (id int primary key);
commit;
set planonly;

select count(*)
from (select id, rdb$db_key k from t a order by id) x
left join t z on x.k = z.rdb$db_key -- (*)

PLAN JOIN (X A ORDER RDB$PRIMARY4, Z NATURAL)

vs

select count(*)
from (select id, rdb$db_key k from t a order by id) x
left join t z on z.rdb$db_key = x.k -- (*)

PLAN JOIN (X A ORDER RDB$PRIMARY4, Z INDEX ())

i.e. order of expressions in the join condition affects the generated plan and thus performance.

 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.