Subject About warnings when submitting SPs...
Author Rasmus Olesen
Hi

When i submit some SPs i get these strange plan-warnings, f.x. :

INFO: Warning: SubOptimal Query Line 6 Column 7 - May not use Index
(PLAN (T_ENTRIES NATURAL))

on this example :

CREATE PROCEDURE A
returns (
maxtid int)
AS
begin
select max(tid) from T_ENTRIES into :maxtid;
end

..and it seems to be because the 'tid' is a primary key in the
table. It also happenes with a foreign key though, and even
though i haven't explicitly defined any indicies anywhere in the
entire db.

(1.1) I'm guessing that defining a primary key, makes FB1.5(which
i'm using btw.) implicitly defines an automatic index on the same
column, at least thats what Marathon 3 told me...but is that the
case ??

(1.2) Why is this warning coming up ?

(1.2.1) Because it might execute slower than it optimally can ?
(=Performance warning)
(1.2.2) Because it might execute a give a wrong answer ?
(=Correctness warning)

(1.3) How can i modified these SPs of this form that gives this kind
of warnings ??

(1.4) Should one always change a SPs just because a compilation
generates a warning or are some of them conceptual and therefore
execution-wise irrelevant ?

(2) What are the professional guidelines for indicies anyway, when
SHOULDN'T they(should = faster searches, got that part) be used in a
table ?

tia.
/Rasmus Olesen