Hey Kent, question for you.
Why can't we use a subselect when creating am index, sure would be handy.
CREATE INDEX mm4r6lib.invaudix1
ON mm4r6lib.invaud (itrhot asc, itrtyp asc, itrloc asc, istype asc)
WHERE itrhot = '1'
AND itflag <> 'P'
AND itrtyp IN (SELECT tblval
FROM t1mm4r6ctl.tblfld
WHERE tblnam = 'RCSTYP'
AND tbldef = 'N') RCDFMT rinvaud ADD ALL COLUMNS;
------------------------------
James King
------------------------------
Original Message:
Sent: Thu July 14, 2022 09:54 AM
From: Kent Milligan
Subject: SQL View
I'm guessing that this month-end process uses a lot of native record-level access. As Paul points out, you could go "all SQL" by creating an SQL Index with a WHERE clause to create the SQL equivalent of a Select/Omit logical. That would provide the performance boost you're looking for in the short-term and then long-term you could migrate some of the native record-level access to SQL>
------------------------------
Kent Milligan
------------------------------
Original Message:
Sent: Thu July 14, 2022 02:07 AM
From: Paul Nicolay
Subject: SQL View
A view doesn't improve performance, it only makes your program easier to code as you don't need to include a complex SQL statement. The fact that a view externalizes the SQL also makes maintenance easier (you can change the view without recompiling your program).
In order to speed up processing you need to create the correct SQL indexes... Visual Explain (part of Run SQL Scripts) can help you with this.
I would not recommend logicals (with select/omit) anymore... I suggest to go "all SQL".
------------------------------
Paul Nicolay