Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Skip scan instead of range scan
Just figured it out myself. The UNION was the problem.
SELECT c1 + c2
FROM (
SELECT /*+ INDEX (w myindex) */
COUNT(*) c1
FROM
mytable w,
(
SELECT 'POOL' AS rkat, fkey AS rkey FROM othertable WHERE kat = 'LINKPOOL' AND typ = 'POLL' START WITH pcode = 3 CONNECT BY PRIOR icode = pcode
AND w.rkey = m.rkey AND w.folder = 'MYFOLDER' AND w.stopdat = to_date ('01.01.3000', 'DD.MM.YYYY') AND w.startdat > to_date ('01.01.1900', 'DD.MM.YYYY')
AND w.rkey = 'ZZCISAMB' AND w.folder = 'INBOX' AND w.stopdat = to_date ('01.01.3000', 'DD.MM.YYYY') AND w.startdat > to_date ('01.01.1900', 'DD.MM.YYYY')
![]() |
![]() |