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

Indices not used for views [CORE1306] #1726

Closed
firebird-automations opened this issue Jun 6, 2007 · 13 comments
Closed

Indices not used for views [CORE1306] #1726

firebird-automations opened this issue Jun 6, 2007 · 13 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alexander Tyutik (tut)

Is related to CORE1245
Is related to QA140

Indices using completely broken for views

CREATE TABLE "TABLE" (ID INTEGER NOT NULL PRIMARY KEY);

COMMIT;

INSERT INTO "TABLE" (ID) VALUES (1);
INSERT INTO "TABLE" (ID) VALUES (2);
INSERT INTO "TABLE" (ID) VALUES (3);

COMMIT;

CREATE VIEW "VIEW" AS SELECT * FROM "TABLE";

Now test query:

SELECT * FROM "TABLE" WHERE ID = 1
UNION ALL
SELECT * FROM "VIEW" WHERE ID = 1

Plan for table: PLAN (TABLE INDEX (PK_TABLE))

Plan for view: PLAN (VIEW TABLE NATURAL)

Commits: 595a185

@firebird-automations
Copy link
Collaborator Author

Commented by: Alexander Tyutik (tut)

FB 2.1 build 15913

@firebird-automations
Copy link
Collaborator Author

Modified by: Alexander Tyutik (tut)

Version: 2.1 Alpha 1 [ 10150 ]

description: Indi?es using completely broken for views

CREATE TABLE "TABLE" (ID INTEGER NOT NULL PRIMARY KEY);

COMMIT;

INSERT INTO "TABLE" (ID) VALUES (1);
INSERT INTO "TABLE" (ID) VALUES (2);
INSERT INTO "TABLE" (ID) VALUES (3);

COMMIT;

CREATE VIEW "VIEW" AS SELECT * FROM "TABLE";

Now test query:

SELECT * FROM "TABLE" WHERE ID = 1
UNION ALL
SELECT * FROM "VIEW" WHERE ID = 1

Plan for table: PLAN (TABLE INDEX (PK_TABLE))

Plan for view: PLAN (VIEW TABLE NATURAL)

=>

Indices using completely broken for views

CREATE TABLE "TABLE" (ID INTEGER NOT NULL PRIMARY KEY);

COMMIT;

INSERT INTO "TABLE" (ID) VALUES (1);
INSERT INTO "TABLE" (ID) VALUES (2);
INSERT INTO "TABLE" (ID) VALUES (3);

COMMIT;

CREATE VIEW "VIEW" AS SELECT * FROM "TABLE";

Now test query:

SELECT * FROM "TABLE" WHERE ID = 1
UNION ALL
SELECT * FROM "VIEW" WHERE ID = 1

Plan for table: PLAN (TABLE INDEX (PK_TABLE))

Plan for view: PLAN (VIEW TABLE NATURAL)

summary: Indi?es not used for views => Indices not used for views

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Link: This issue is related to CORE1245 [ CORE1245 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

When i undid part of changes made in cmp.1.254 near

+if (relation->rel_view_rse)
+{
+ // dimitr: if we reference view columns, we need to pass them
+ // as belonging to a view (in order to compute the access
+ // permissions properly).

both cases began to work ok.

Not sure it is correct 'fix' ;)

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Adriano, as you worked with CORE1245, look at this ticket too, please

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.1 Beta 1 [ 10141 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA140 [ QA140 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Fix verified for Beta 1, test added. The bug was actually introduced after the Alpha 1 was released.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12279 ] => Firebird [ 14713 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => 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