Hallo *all
Hier gab es folgendes Statement:

Code:
with a as (select key1, key2, key3, dajj, damm, datt,   
        stor from FILE1 where rgma = 140850022                 
                      and (bank = 9 and stgr not in(0, 1, 91)   
                           or bank <> 9) and stat = 9           
and zahl < 0  and kzze = 1                                      
)                                                                   
select sum(zahl), count(*)
          from file1 where                
       (key1, key2, key3, dajj, damm, datt, sanr) in  
(select key1, key2, key3, dajj, damm, datt, stor      
                                                           from a)  
                              and kzze = 1
das läuft auf 25 Mio Datensätze 3-5 Sekunden

mache ich aus dem
Code:
with a as (select key1, key2, key3, dajj, damm, datt,   
        stor from FILE1 where rgma = 140850022                 
                      and (bank = 9 and stgr not in(0, 1, 91)   
                           or bank <> 9) and stat = 9           
and zahl < 0  and kzze = 1                                      
)                                                                   
select key1, key2, key3, zahl 
          from file1 where                
       (key1, key2, key3, dajj, damm, datt, sanr) in  
(select key1, key2, key3, dajj, damm, datt, stor      
                                                           from a)  
                              and kzze = 1
läuft das ding > 45 minuten

muß er für SUM(Zahl), nicht auch alle passenden lesen?
LF mit key1, 2, 3 gibt es
wieso lauft das so lange

Robi