Subject | Stored Procedures ordering perfomance |
---|---|
Author | Adomas Urbanavicius |
Post date | 2004-11-22T10:25:48Z |
Hello all,
I ' ve noticed interesting , kind of disapointing ordering feature in
stored proc :
if I have stored proc something like :
P_NAMES
for select name,surname from people into :name,:surname do suspend;
and make from it selection :
select * from P_NAMES, in statistics I get reads from table PEOPLE ~
1.00.000, but if I make
selection with ordering
select * from P_NAMES order by NAME,
in statistics I get reads~ 290.000, this means it slows down performance
about 3x!
Same is with much more compilcated procedures, whee I must get output
only about 100 records, but must scan about 2.000.000 records, then
perfomance significantly drops down.
Adomas Urbanavicius
I ' ve noticed interesting , kind of disapointing ordering feature in
stored proc :
if I have stored proc something like :
P_NAMES
for select name,surname from people into :name,:surname do suspend;
and make from it selection :
select * from P_NAMES, in statistics I get reads from table PEOPLE ~
1.00.000, but if I make
selection with ordering
select * from P_NAMES order by NAME,
in statistics I get reads~ 290.000, this means it slows down performance
about 3x!
Same is with much more compilcated procedures, whee I must get output
only about 100 records, but must scan about 2.000.000 records, then
perfomance significantly drops down.
Adomas Urbanavicius
>
>
>