Skip to content
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

PK index is not used for derived tables [CORE2910] #3294

Closed
firebird-automations opened this issue Mar 5, 2010 · 8 comments
Closed

PK index is not used for derived tables [CORE2910] #3294

firebird-automations opened this issue Mar 5, 2010 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dmitry-starodubov

Is related to QA433

create database 'test.fdb';

set plan on;

CREATE TABLE R$TMP (
POSTING_ID INTEGER
);

CREATE TABLE TMP (
POSTING_ID INTEGER NOT NULL
);

ALTER TABLE TMP ADD CONSTRAINT PK_TMP PRIMARY KEY (POSTING_ID);

select r.POSTING_ID as r$POSTING_ID, t.POSTING_ID from (
SELECT POSTING_ID
FROM r$tmp
) r left join (
select POSTING_ID from
(select
posting_id
from tmp)
) t on r.POSTING_ID = t.POSTING_ID;

drop database;

This SELECT in FB 2.1 and FB-HEAD uses such plan:
PLAN JOIN (R R$TMP NATURAL, T TMP INDEX (PK_TMP))

And FB 2.5 doesn't use primary key index :
PLAN JOIN (R R$TMP NATURAL, T TMP NATURAL)

Commits: 05b983b

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: In Progress [ 3 ] => Open [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Dmitry Yemanov [ dimitr ] => Adriano dos Santos Fernandes [ asfernandes ]

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC3 [ 10381 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @samofatov

Thanks a lot, Andriano! This was pretty important issue for us as it broke replication and materialized views support.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA433 [ QA433 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants