Subject Re: derived table within EXISTS (was: Different performance Superserver VS. Embeded ?)
Author danyschaer
Hi Sean;

Yes, of course, your sintaxis works VERY VERY WELL (see the report at
the end), but, even when it returns very faster the right result, it
is a totaly different approach, and does not what I need. Because I
have to test a good number of related tables like MOVI (maybe 20
tables, with lots of conditions each one), and because of that I used
the WHERE EXISTS approach, thinking the select will fail, will stop
running, and will return cero records at the first where clause fail.

Starting transaction...
Preparing query: Select
p.PROC, p.EXP1 as EXPE, p.ACTO, p.DEMA, p.OBSE, t.DSCR as D_TPRO
from (
SELECT
distinct PROC
from MOVI
where
TIPO = 'B') m
JOIN PROC p on p.PROC = m.PROC
left join TPRO t on p.TPRO=t.TPRO
order by
lower(p.ACTO)

Prepare time: 00:00:00.
Field #01: PROC.PROC Alias:PROC Type:STRING(10)
Field #02: PROC.EXP1 Alias:EXPE Type:STRING(18)
Field #03: PROC.ACTO Alias:ACTO Type:STRING(200)
Field #04: PROC.DEMA Alias:DEMA Type:STRING(200)
Field #05: PROC.OBSE Alias:OBSE Type:STRING(120)
Field #06: TPRO.DSCR Alias:D_TPRO Type:STRING(120)
PLAN JOIN (SORT (JOIN (SORT (M MOVI INDEX (MOVI_TIPO)), P INDEX
(PROC_PK))), T INDEX (TPRO_PK))


Executing...
Done.
35282 fetches, 8 marks, 333 reads, 8 writes.
0 inserts, 0 updates, 0 deletes, 1088 index, 15300 seq.
Delta memory: 52260 bytes.
Execute time: 00:00:00.

Thank you !!!

Dany