-
-
Notifications
You must be signed in to change notification settings - Fork 232
OR/IN predicates for RDB$DBKEY lead to NATURAL plan [CORE4492] #1566
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
Comments
Commented by: @mrotteveel Please: use one problem per ticket, do not put multiple problems into one even if they are related to the same feature. |
Commented by: @dyemanov Wiped out the second issue, especially given that it wasn't a bug. |
Modified by: @dyemanovdescription: SQL> set plan only; Test-1a:SQL> select count(*) from rdb$database where rdb$db_key = 1; PLAN (RDB$DATABASE INDEX ()) // Ok Test-1b:SQL> select count(*) from rdb$database where rdb$db_key in (1,2); PLAN (RDB$DATABASE NATURAL) // Bad SQL> quit; Also, consider the following cases (they seems not related with showed above but I don`t want to create separate ticket for these RDB$DB_KEY problems): -- ::: NB::: make reconnect now to ensure that set planonly = OFF Test-2a:SQL> out /dev/null; Trace:1 records fetched Table Natural Test-2b:SQL> select count(*) from rdb$database where rdb$db_key = cast(null as char(8) character set octets); Trace:select count(*) from rdb$database where rdb$db_key = cast(null as char(8) character set octets) Where statistics with RDB$DATABASE ? Test 2-c:SQL> select count(*) from rdb$database where rdb$db_key = cast('1234' as char(8) character set octets); Statement 6835: Table Natural Index Update Insert Delete Backout Purge Expunge Again no RDB$DATABASE in statistics but why RDB$PAGES appears here ? PS. Reproduced on both FB 2.5 and 3.0. => SQL> set plan only; Test-1a:SQL> select count(*) from rdb$database where rdb$db_key = 1; PLAN (RDB$DATABASE INDEX ()) // Ok Test-1b:SQL> select count(*) from rdb$database where rdb$db_key in (1,2); PLAN (RDB$DATABASE NATURAL) // Bad SQL> quit; |
Modified by: @dyemanovassignee: Dmitry Yemanov [ dimitr ] |
Modified by: @pavel-zotovstatus: Open [ 1 ] => Open [ 1 ] |
Modified by: @pavel-zotovstatus: Open [ 1 ] => Open [ 1 ] Test Details: See also CORE4038, CORE4530 => Deferred untill ticket will be fixed. QA Status: Deferred |
Modified by: @dyemanovVersion: 4.0 Alpha 1 [ 10731 ] Version: 3.0.2 [ 10785 ] Version: 2.5.7 [ 10770 ] Version: 3.0.1 [ 10730 ] Version: 2.5.6 [ 10721 ] Version: 3.0.0 [ 10740 ] Version: 4.0 Initial [ 10621 ] Version: 2.5.5 [ 10670 ] Version: 2.5.4 [ 10585 ] Version: 2.5.3 Update 1 [ 10650 ] Version: 2.5.3 [ 10461 ] Version: 2.5.2 Update 1 [ 10521 ] Version: 2.5.2 [ 10450 ] Version: 2.5.1 [ 10333 ] Version: 2.5.0 [ 10221 ] summary: Adding 2nd condition in WHERE which containing RDB$DBKEY leads to NATURAL plan => OR/IN predicates for RDB$DBKEY lead to NATURAL plan |
Commented by: @dyemanov Fixing it for v4 at the moment, to be backported after successful QA pass. |
Modified by: @dyemanovstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 Beta 1 [ 10750 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: Deferred => Done with caveats Test Details: Deferred untill ticket will be fixed. => Test includes only part of examples. Two cases remain uncleared. |
Modified by: @dyemanovFix Version: 3.0.3 [ 10810 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] Test Details: Test includes only part of examples. Two cases remain uncleared. => Following query will not compile: |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @pavel-zotov
SQL> set plan only;
Test-1a:
SQL> select count(*) from rdb$database where rdb$db_key = 1;
PLAN (RDB$DATABASE INDEX ()) // Ok
Test-1b:
SQL> select count(*) from rdb$database where rdb$db_key in (1,2);
PLAN (RDB$DATABASE NATURAL) // Bad
SQL> quit;
Commits: 134d923 57f2da4
====== Test Details ======
Following query will not compile:
select 1 from rdb$relations a join rdb$relations b using ( rdb$db_key );
Statement failed, SQLSTATE = 42000 / -Token unknown / -rdb$db_key
See also CORE4038, CORE4530
The text was updated successfully, but these errors were encountered: