Subject No indexed reads upon RDB$RELATION_CONSTRAINTS
Author mmenaz
FB 1.0
Hi, often in my queries (select...), I've not experimented if only with join upon stored procedures or not, I get all indexed reads upon my tables, upon most of the RDB$ ones, but exception is RDB$RELATION_CONSTRAINTS. How can avoid it? Is it a bug, must I add some index to RDB$RELATION_CONSTRAINTS, or whatever?
Thanks
Marco Menardi

(QuickDesk) Info:
+--------------------------+-------+-----------+
| Table Name | Index | Non-Index |
| | reads | reads |
+--------------------------+-------+-----------+
| RDB$FIELDS| 122 | 0 |
| RDB$RELATION_FIELDS| 122 | 0 |
| RDB$RELATIONS| 14 | 0 |
| RDB$RELATION_CONSTRAINTS| 0 | 1.694 |
| RDB$INDEX_SEGMENTS| 7 | 0 |
| BANCHE| 7 | 0 |
| CLIENTI| 6 | 0 |
| CONDOMINI| 7 | 0 |
|CONDOMINI_U_CONTI_CORRENTE| 7 | 0 |
| CONTI_CORRENTE| 7 | 0 |
| UNITA_IMMOBILIARI| 7 | 0 |
| UNITA_U_CLIENTI| 6 | 0 |
+--------------------------+-------+-----------+

Plan:
PLAN JOIN (UNITA_IMMOBILIARI INDEX (RDB$FOREIGN70,RDB$FOREIGN69),CONDOMINI_U_CONTI_CORRENTE INDEX (RDB$PRIMARY11,RDB$FOREIGN48),CONTI_CORRENTE INDEX (RDB$PRIMARY13),BANCHE INDEX (RDB$PRIMARY2),CONDOMINI INDEX (RDB$PRIMARY9),UNITA_U_CLIENTI INDEX (RDB$PRIMARY38,RDB$FOREIGN72),CLIENTI INDEX (RDB$PRIMARY8))

Adapted plan:
PLAN JOIN (UNITA_IMMOBILIARI INDEX (FK_UNITA_IMM_SCALA,RDB$FOREIGN69),CONDOMINI_U_CONTI_CORRENTE INPK_CONDOMINI_U_CONTI_CORRENTEARY11,RDB$FOREIGN48),CINTEG_180 INDEX (RDB$PRIMARY1INTEG_172DEX (RDB$PRIMARY2),CONINTEG_179 (RDB$PRIMARY9),UNITA_U_CLIEINTEG_201B$PRIMARY38,RDB$FOREIGN72),CLIENTI INTEG_178RIMARY8))


SELECT UNITA_U_CLIENTI.UICC_ID,
UNITA_IMMOBILIARI.DESCRIZIONE_ESTRATTOCONTO,
CONDOMINI.NOME,
CLIENTI.NOME_INDIRIZZO,
CLIENTI.TITOLO,
CLIENTI.PRESSO,
CLIENTI.VIA,
CLIENTI.CAP,
CLIENTI.COMUNE,
CLIENTI.PROVINCIA,
CLIENTI.STATO,
CLIENTI.STATO_SIGLA,
BANCHE.NOME,
BANCHE.ABI,
BANCHE.CAB,
BANCHE.BIC,
CONTI_CORRENTE.NUMERO,
CONTI_CORRENTE.INTESTATARIO,
CONTI_CORRENTE.CIN,
CONTI_CORRENTE.BBAN,
CONTI_CORRENTE.IBAN
FROM UNITA_U_CLIENTI
INNER JOIN UNITA_IMMOBILIARI ON (UNITA_U_CLIENTI.UNITAIMM_ID = UNITA_IMMOBILIARI.UNITAIMM_ID)
INNER JOIN CONDOMINI ON (UNITA_IMMOBILIARI.CONDOMINIO_ID = CONDOMINI.CONDOMINIO_ID)
INNER JOIN CONDOMINI_U_CONTI_CORRENTE ON (CONDOMINI.CONDOMINIO_ID = CONDOMINI_U_CONTI_CORRENTE.CONDOMINIO_ID)
INNER JOIN CONTI_CORRENTE ON (CONDOMINI_U_CONTI_CORRENTE.CONTO_CORRENTE_ID = CONTI_CORRENTE.CONTO_CORRENTE_ID)
INNER JOIN BANCHE ON (CONTI_CORRENTE.BANCA_ID = BANCHE.BANCA_ID)
INNER JOIN CLIENTI ON (UNITA_U_CLIENTI.CLIENTE_ID = CLIENTI.CLIENTE_ID)
WHERE (UNITA_U_CLIENTI.ESERCIZIO_ID = '000000') AND
(UNITA_U_CLIENTI.UICC_ID BETWEEN 'CC' AND 'CCZZZZ') AND
(UNITA_IMMOBILIARI.CONDOMINIO_ID BETWEEN 'PRIM' AND 'PRIM')