× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thank you all for your replies!
On Friday, September 2, 2022, 12:30:59 PM CDT, Birgitta Hauser <hauser@xxxxxxxxxxxxxxx> wrote:

"DDS defined tables default to the old iseries SQL engine and are less efficient using SQL" which in context I'm told to use native I/O RPG to code instead of embedded SQL if I am to use DDS files.
NO! That's wrong!

SQL Tables and DDS described physical files are both handled by the SQE in the same way!
There are small differences in the architecture, so WRITEs/INSERTs (independent if native I/O or SQL is used) to DDS described physical files are slightly faster, while READs (independent whether native I/O or SQL is used) from SQL Tables are (slightly) faster.
How may READS are performed and how many UPDATES/INSERTES? ... So in total using SQL tables (even with native I/O) is faster.

Before Release 7.1 TR 5. All SQL Statement accessing DDS described logical files were rerouted to the old Query Engine.
Because the SQL statement must be rewritten based on the physical files/tables and the field selections, join information and SELECT/OMIT clauses within the DDS description before optimization can start.
Before Release 7.1 TR 5 IBM always said, the new Query Engine SQE (=SQL Query Engine) is an SQL Query Engine and not a DDS (decomposing) engine.
Beginning with 7.1 TR 5 even Query where DDS described logical files are specified are executed with the SQE!
... independent of this behaviour: Specifying DDS described logical files in a SQL Statement. Always use physical files/SQL Tables or SQL Views.

BTW since Release 7.2 any file access (even native I/O, Query/400, OPNQRYF) is executed by the SQE! 

But in either way you should not write (embedded) SQL in the same way as native I/O ... then RPG might win (at least the first 2 runs), i.e. NO Optimization - F-Spec is taken independent whether is good or bad! Versus FULL Optimization with SQL.
After the second run SQL may use a PSEUDO optimization, i.e. the ODP is reused and only the data is updated.
If SQL is well written, can block and the optimal Access Paths are available it should be much faster then native I/O.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser
Modernization – Education – Consulting on IBM i


"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them and keeping them!"
„Train people well enough so they can leave, treat them well enough so they don't want to.“ (Richard Branson)


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Code 1109 via RPG400-L
Sent: Freitag, 2. September 2022 18:44
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Cc: Code 1109 <code1109@xxxxxxxxx>
Subject: DDS define files on SQL statements

Hello all, can someone confirm what I've been told: "DDS defined tables default to the old iseries SQL engine and are less efficient using SQL" which in context I'm told to use native I/O RPG to code instead of embedded SQL if I am to use DDS files.
thank you!
--
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.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.