Label Décisionnel
Bienvenue, Invité
Merci de vous identifier ou de vous inscrire.    Mot de passe perdu?
[Performance] Retrouver les FK sans indexes (1 lecteur(s)) (1) Invité(s)
Aller en bas Répondre Ajouté aux favoris : 0
SUJET: [Performance] Retrouver les FK sans indexes
#470
ChrYStophe (Utilisateur)
Expert Boarder
Messages: 158
graphgraph
Personne n'est hors ligne Cliquez ici pour voir le profil de cet utilisateur
[Performance] Retrouver les FK sans indexes depuis 9 Mois Karma: 17  
Il faut des indexes, normalement, sur toutes les contraintes FK.

Voici la requête qui aide à déterminer où il manque des indexes


select distinct acc.OWNER,
acc.CONSTRAINT_NAME,
acc.COLUMN_NAME,
acc.POSITION,
'No Index' Problem
from dba_cons_columns acc,
dba_constraints ac
where ac.CONSTRAINT_NAME = acc.CONSTRAINT_NAME
and ac.CONSTRAINT_TYPE = 'R'
and acc.OWNER = 'SCOTT'
and not exists (
select 'TRUE'
from dba_ind_columns b
where b.TABLE_OWNER = acc.OWNER
and b.TABLE_NAME = acc.TABLE_NAME
and b.COLUMN_NAME = acc.COLUMN_NAME
and b.COLUMN_POSITION = acc.POSITION)
order by acc.OWNER, acc.CONSTRAINT_NAME, acc.COLUMN_NAME, acc.POSITION

ChrYStophe
 
  L'administrateur a désactivé l'accès public en écriture.
Revenir en haut Répondre
Développé par FireBoardObtenir les derniers messages directement sur votre PC
Joomla Template by Joomlashack
Joomla Templates by JoomlaShack Joomla Templates