Subject | So confused |
---|---|
Author | robert_difalco |
Post date | 2005-08-17T21:06:37Z |
For some reason, I can't get rid of the table scan on the Element
Names table even though the Element Names ID is it's primary key. Any
ideas? Selectivity of this index is very good since all values are unique.
SELECT
EVers.ID, Elems.nodeID, Elems.ID, EAttribs.MD5
FROM Vers
JOIN Elems ON EVers.elementId = Elems.ID
JOIN ENames ON Elems.nameId = ENames.ID
JOIN EAttribs ON EVers.attribsID = EAttribs.ID
WHERE
(
Elems.lastVersionID = EVers.ID AND
Elems.nodeID = -9223372036853775797
)
I get this:
PLAN SORT (JOIN (ENAMES NATURAL,ELEMS INDEX (ELEMS_13_ASC),VERS INDEX
(RDB$PRIMARY20,VERS_1_ASC),ATTRIBS INDEX (RDB$PRIMARY18)))
Any idea why this would be doing a natural on ENames? If I put in the
primary key index for Enames into the plan, I get an invalid index for
query exception.
Btw, this is 1.0.3. We are unable to upgrade to 1.5 at this point.
R.
Names table even though the Element Names ID is it's primary key. Any
ideas? Selectivity of this index is very good since all values are unique.
SELECT
EVers.ID, Elems.nodeID, Elems.ID, EAttribs.MD5
FROM Vers
JOIN Elems ON EVers.elementId = Elems.ID
JOIN ENames ON Elems.nameId = ENames.ID
JOIN EAttribs ON EVers.attribsID = EAttribs.ID
WHERE
(
Elems.lastVersionID = EVers.ID AND
Elems.nodeID = -9223372036853775797
)
I get this:
PLAN SORT (JOIN (ENAMES NATURAL,ELEMS INDEX (ELEMS_13_ASC),VERS INDEX
(RDB$PRIMARY20,VERS_1_ASC),ATTRIBS INDEX (RDB$PRIMARY18)))
Any idea why this would be doing a natural on ENames? If I put in the
primary key index for Enames into the plan, I get an invalid index for
query exception.
Btw, this is 1.0.3. We are unable to upgrade to 1.5 at this point.
R.