Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Query takes 1min 15 secs and tables are indexed !
I make a query using three tables on Oracle 10g.
The query lasts 1 min 15 sec !
SELECT CA.cod_dni AS cod_dni,
P.apepat AS apepat , P.apemat AS apemat, P.nombre AS nombres, OP.DES_OP AS DES_OP, OP.cod_op AS cod_op, CA.FECHA AS FECHA, CA.flg_renuncia AS flg_renuncia, 'COMITES DE AFILIADOS' AS des_parteFROM PADRON P, TBL_COMITES_AFIL CA, TBL_OP OP
WHERE CA.cod_op = OP.cod_op AND CA.cod_dni = P.numdle(+) AND CA.flg_renuncia <> 0
I analyze the three tables:
Table TBL_COMITES_AFIL:
Table TBL_OP:
Table PADRON:
It seems that the problem is table PADRON, because it has about 16
millions records and a simple COUNT('x') on the table takes 45-50 secs,
even that the table is indexed: Primary Key on numdle field. If I make
a query like:
SELECT * from PADRON where numdle='12345678', the results are
immediately.
I would like to know what is missing, because I think that Oracle 10g can manage tables of 16 millions records without taking almost 1 minute for a simple Record Count. Received on Mon Jul 31 2006 - 10:55:51 CDT