LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

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

Open dynamobi-build opened 12 years ago

dynamobi-build commented 12 years ago

[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$PRIMARYKEY], 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 commented 12 years ago

[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 commented 12 years ago

[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!