Subject | Re: derived table within EXISTS (was: Different performance Superserver VS. Embeded ?) |
---|---|
Author | danyschaer |
Post date | 2008-02-25T14:32:33Z |
Hi Set,
Yeah, more choices = more complex.
Is truth, as I told before, our select statments are not perfect,
they can be better, I we will improve them.
I think I understand what you say about the use of the EXISTS clause,
and I will see if I can do things in other ways.
But also is truth we tested them on Oracle and Postgree, and the
results are fine.
I don't like to say that, but I tested your suggested sintaxis, and
does not run instantly as you expect, it need a little more time than
mine:
Starting transaction...
Preparing query: select p.PROC, p.EXP1 as EXPE, p.ACTO, p.DEMA,
p.OBSE, t.DSCR as D_TPRO
from PROC p
left join TPRO t on p.TPRO=t.TPRO
where exists(select * from MOVI m
where p.PROC = m.PROC
and m.TIPO = 'B')
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 (M INDEX (MOVI_PROC))
PLAN SORT (JOIN (P NATURAL, T INDEX (TPRO_PK)))
Executing...
Done.
429914 fetches, 8 marks, 139758 reads, 8 writes.
0 inserts, 0 updates, 0 deletes, 151675 index, 33586 seq.
Delta memory: 49644 bytes.
Execute time: 00:10:25.
Of course I want to contribute with developers team, just tell me
what I have to do. I can upload my test database and so.
BTW, we people like you and Helen, this forum is a very nice place
for living and working <G>, THANK YOU !!
Dany
Yeah, more choices = more complex.
Is truth, as I told before, our select statments are not perfect,
they can be better, I we will improve them.
I think I understand what you say about the use of the EXISTS clause,
and I will see if I can do things in other ways.
But also is truth we tested them on Oracle and Postgree, and the
results are fine.
I don't like to say that, but I tested your suggested sintaxis, and
does not run instantly as you expect, it need a little more time than
mine:
Starting transaction...
Preparing query: select p.PROC, p.EXP1 as EXPE, p.ACTO, p.DEMA,
p.OBSE, t.DSCR as D_TPRO
from PROC p
left join TPRO t on p.TPRO=t.TPRO
where exists(select * from MOVI m
where p.PROC = m.PROC
and m.TIPO = 'B')
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 (M INDEX (MOVI_PROC))
PLAN SORT (JOIN (P NATURAL, T INDEX (TPRO_PK)))
Executing...
Done.
429914 fetches, 8 marks, 139758 reads, 8 writes.
0 inserts, 0 updates, 0 deletes, 151675 index, 33586 seq.
Delta memory: 49644 bytes.
Execute time: 00:10:25.
Of course I want to contribute with developers team, just tell me
what I have to do. I can upload my test database and so.
BTW, we people like you and Helen, this forum is a very nice place
for living and working <G>, THANK YOU !!
Dany