Merge pull request #32 from cromerc/indices

crear indexes.sql en la raiz
This commit is contained in:
HieloxZack 2020-08-02 17:08:39 -04:00 committed by GitHub
commit 58cb065af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

18
indexes.sql Normal file
View File

@ -0,0 +1,18 @@
SELECT P.NOMBRE, M.CANTIDAD_ATLETA
FROM MAX_ATLETA_ATLETISMO_PAIS M
LEFT JOIN PAIS P ON (P.ID_PAIS = M.ID_PAIS)
WHERE (M.CANTIDAD_ATLETA = (SELECT MAX(CANTIDAD_ATLETA) FROM MAX_ATLETA_ATLETISMO_PAIS));
SELECT P.ID_PAIS, P.NOMBRE, COUNT(*) AS CANTIDAD_ATLETA
FROM COMPETENCIA C
LEFT JOIN PARTICIPAR_COMPETENCIA PC ON (C.ID_COMPETENCIA = PC.ID_COMPETENCIA)
LEFT JOIN ATLETA A ON A.ID_ATLETA = PC.ID_ATLETA
INNER JOIN DELEGACION D ON (D.ATLETA = A.ID_ATLETA)
INNER JOIN PAIS P ON (P.ID_PAIS = D.PAIS)
WHERE TIPO = (SELECT TD.ID_TIPO FROM TIPOS_DEPORTES TD WHERE (UPPER(TD.DESCRIPCION) = 'ATLETISMO'))
GROUP BY (P.ID_PAIS, P.NOMBRE);
-- Indices
CREATE BITMAP INDEX IX_DES ON TIPOS_DEPORTES(DESCRIPCION);
ALTER INDEX IX_APE MONITORING USAGE;
SELECT * FROM USER_INDEXES WHERE TABLE_NAME = 'TIPOS_DEPORTES';