Subject Problem with plan selection?
Author Jacob Alberty
I have a view named PSearch, its contents are as follows

CREATE VIEW "PSEARCH" (
"OWNERID",
"PETID",
"PETNAME",
"SPECIES",
"BREED",
"FULLNAME",
"OWNERLNAME",
"OWNERFNAME"
) AS

select p.OwnerID,
p.PetID,
p.PetName,
p.Species,
p.Breed,
o.OwnerFName || ' ' || o.OwnerLName as FullName,
o.OwnerLName,
o.OwnerFName
from Pets p join Owners o on o.OwnerID = p.OwnerID
;
when i do the following select statement performance is excelent

select * from psearch where ownerlname like 'ALBERTY%'
plan is
PLAN JOIN (PSEARCH O INDEX (OWNERLNAMEONLY),PSEARCH P INDEX (RDB$PRIMARY10))
however when i do this query
select * from psearch where petname like 'JETHRO%'
performance sucks the plan it uses is
PLAN JOIN (PSEARCH O NATURAL,PSEARCH P INDEX (RDB$PRIMARY10,PETNAMEONLY))
, however if i specify the plan and use
SELECT * FROM PSearch WHERE PetName like 'JETHRO%' PLAN JOIN (PSEARCH P
INDEX (PETNAMEONLY),PSEARCH O INDEX (OWNERIDOWNERS))
performance is just fine, i have tried turning the indexes off and then
back on but it does not see mto help its plan selection, any ideas what
could cause this?