Speeding up reports, general processing in 4GL?
Posted in 1996
Informix 4GL 6.0, Online 5.0, SCO Unix.
I've long been interested in the subject of speeding up reports / 4GL
processing in general.
Anyone want to comment on the general subject?
There are some obvious things like the creation of indexes.
What about the not so obvious?, for example.
1. Because a cursor is not being constantly re-declared,should the following
construct be faster ?
declare l_a record like a.*
declare l_b record like b.*
declare cursor cursa for select * from table a
declare cursor cursb for select * from table b where b.keyfield =
l_a.keyfield
foreach cursa into l_a.*
foreach cursb into l_b.*
# code
end foreach
end foreach
(this works, by the way!).
as opposed to :
declare cursor cursa for select * from table a
foreach cursa into l_a.*
declare cursor cursb for select * from table b where b.keyfield =
l_a.keyfield
foreach cursb into l_b.*
# code
end foreach
end foreach
2. Would the above (top example) be improved by preparing the cusor(s)?
3. If an SQL is executed more than once it is best to prepare it (I hope?).
If the equivalent code was placed in a stored procedure would it be faster
than the prepared version?
4. Are there any rules for choosing the following construct, as opposed to
the example in 1. above?
declare l_a record like a.*
declare l_b record like b.*
declare cursor cursab for
select * from table a, outer b
where a.keyfield = b.keyfield
foreach cursab into l_a.*,l_b.*
# code
end foreach
5. Is it better to ORDER BY in the report or the SELECT (and thus use ORDER
external by)?
6. Does moving to the 7.1 engine have any bearing on answers to the above?
Please feel free to expand on this list, any tips on improving performance
would be greatly appreciated.