Subject Re: mystery
Author tomconlon7777777
> I am trying to determine the "uniqueness" (selectivity)
> of the REGIONID values.

select rdb$index_name, rdb$relation_name, rdb$statistics
from rdb$indices
where rdb$index_name in
(
'IDXSITE_REGIONID',
'RDB$PRIMARY8',
'RDB$FOREIGN44',
'RDB$FOREIGN122'
)

RDB$FOREIGN122 VACANCY 0.000100613746326417
RDB$FOREIGN44 CLIENT 2.97956030408386E-5
IDXSITE_REGIONID SITE 0.0625
RDB$PRIMARY8 COMPANY 3.07843874907121E-5

Then ran
SET statistics INDEX IDXSITE_REGIONID;
SET statistics INDEX RDB$PRIMARY8;
SET statistics INDEX RDB$FOREIGN44;

Stats seemed to be up-to-date

RDB$FOREIGN122 VACANCY 0.000100613746326417
RDB$FOREIGN44 CLIENT 2.97956030408386E-5
IDXSITE_REGIONID SITE 0.0625
RDB$PRIMARY8 COMPANY 3.07843874907121E-5

Perhaps 1 or more of the foreign keys is contributing to the poor
performance?