Kann mir jemand erklären, warum diese
Query mehr als 100x so langsam ist (47s):
Code:
select lsptext.*
from lscoll
left outer join lspack on lspack.lskopf_id = lscoll.lskopf_id and lspack.colli_nr = lscoll.colli_nr
inner join lsptext on lsptext.lspos_id = lspack.lspos_id and lsptext.position = 25
and lsptext.art in ('G1', 'G2', 'G3', 'G4', 'D1', 'D2', 'D3', 'D4', 'D5')
where lscoll.id = :ColliId
wie diese (300ms):
Code:
select lsptext.*
from lscoll
left outer join lspack on lspack.lskopf_id = lscoll.lskopf_id and lspack.colli_nr = lscoll.colli_nr
left outer join lsptext on lsptext.lspos_id = lspack.lspos_id
where lscoll.id = :ColliId
and lsptext.position = 25
and lsptext.art in ('G1', 'G2', 'G3', 'G4', 'D1', 'D2', 'D3', 'D4', 'D5')
Logisch und vom Ergebnis sind die gleich. Der
Query-Plan hat keine Warnungen, alle zu verbindenden Felder sind indiziert.