|
Hi Marco,
Am 20.08.2024 um 16:50 schrieb Marco Facchinetti <marco.facchinetti@xxxxxxxxx>:
Hi all, I'm talking about embedded SQL.
execute the following code 1.260 times:
<snip>
Takes 2/3 seconds.is the cursor's code):
Executing 1.260 times any variation of these 4 statements (the last one
<snip>
You can try the statements in iACS and look, what Visual Explain says
about them. Sometimes the problem is a missing index - sometimes something
that makes it impossible to cache the access plan or result.
But first, you should think about the application logic - repeating a SQL
statement (or a whole SQL cursor loop) for over 1.000 times is a big no-no.
To utilize the full power of SQL you should think about "data sets" and
how the a linked together - maybe you can join the data to another table -
so that you don't have thousands of open/close operations or select-into
statements.
So rethinking the application design might be a good idea - from this very
restricted point of view.
HTH
Daniel
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.