Ver Mensaje Individual
  #11  
Antiguo 22-03-2008
Avatar de RONPABLO
[RONPABLO] RONPABLO is offline
Miembro Premium
 
Registrado: oct 2004
Posts: 1.514
Reputación: 21
RONPABLO Va por buen camino
Hola Rudi, reviviendo este hilo y leyendo recientemente los FAQ de Firebird me encontré con lo siguiente

Cita:
Empezado por FAQ Firebird
Why is my query that uses IN or NOT IN slow?


This is an issue with Firebird optimizer. In newer Firebird versions the problem with IN is fixed, but the problem with NOT IN remains. In any case, it is safe and often faster to use EXISTS and NOT EXISTS instead. Each IN and NOT IN query can be rewritten to use EXISTS and NOT EXISTS.

Example:


select * from employee e
where e.emp_no in (select s.emp_no from SALARY_HISTORY s);

-- rewritten with EXISTS:

select * from employee e
where exists (select 1 from SALARY_HISTORY s where e.emp_no = s.emp_no);

Con lo poco que entiendo de ingles se refiere que en versiones antiguas el problema de velocidad lo tenia tanto la clausula IN y NOT IN, pero que en las nuevas versiones el IN fue optimizado pero el NOT IN continua lento... es decir que si antes era aceptable para ti ahora no debe ser tanto... Aunque tu hablaste de Indexar y esa parte aun no la he visto y depronto estoy siendo muy apresurado en emitir mi opinión... pero podrías probar si la velocidad se ve afectada o no con antiguas consultas que usan el NOT IN
__________________
"Como pasa el tiempo..... ayer se escribe sin H y hoy con H"
Responder Con Cita