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

[FRG-7] problematic table reference syntax in explain plan #863

Open
dynamobi-build opened this issue Dec 30, 2011 · 2 comments
Open

[FRG-7] problematic table reference syntax in explain plan #863

dynamobi-build opened this issue Dec 30, 2011 · 2 comments

Comments

@dynamobi-build
Copy link

[reporter="jvs", created="Mon, 19 Dec 2005 15:23:59 -0500 (GMT-05:00)"]
Contrived script below shows the problem. Besides being ugly, the table reference syntax in explain plan can lead to problems because the optimizer uses these strings to match relational expressions, so in this case it could get a false match (assuming the index names were contrived to match as well).



0: jdbc:farrago:> create schema "a, b";

No rows affected (0.105 seconds)

0: jdbc:farrago:> create schema "a";

No rows affected (0.08 seconds)

0: jdbc:farrago:> create table "a, b"."c"(i int not null primary key);

No rows affected (0.343 seconds)

0: jdbc:farrago:> create table "a"."b, c"(i int not null primary key);

No rows affected (0.334 seconds)

0: jdbc:farrago:> explain plan for select * from "a, b"."c";

'column0'

'FennelToIteratorConverter'

' FtrsIndexScanRel(table=[[LOCALDB, a, b, c]], projection=[], index=[SYS$CONSTRAINT_INDEX$c$SYS$PRIMARY_KEY], preserveOrder=[false])'

2 rows selected (0.143 seconds)

0: jdbc:farrago:> explain plan for select * from "a"."b, c";

'column0'

'FennelToIteratorConverter'

' FtrsIndexScanRel(table=[[LOCALDB, a, b, c]], projection=[
], index=[SYS$CONSTRAINT_INDEX$b, c$SYS$PRIMARY_KEY], preserveOrder=[false])'

2 rows selected (0.141 seconds)

0

@dynamobi-build
Copy link
Author

[author="jvs", created="Mon, 19 Dec 2005 15:25:14 -0500 (GMT-05:00)"]
Of course, fixing this will cause lots of plan diffs.

@dynamobi-build
Copy link
Author

[author="jvs", created="Sun, 12 Feb 2006 17:16:12 -0500 (GMT-05:00)"]
Need to take care of UDX calls also; they're not being qualified at all!

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

1 participant