Hi Paul, maybe it's Friday and my eyes are tired.

The scope of the delete is NOT In

Thanks
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno ven 24 gen 2025 alle ore 14:49 Paul Therrien via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> ha scritto:

I ran into something similar, and I changed my statement this way:

DELETE FROM TSEDAT4/MULTTT400F
WHERE LGIDL1 <> ' '
and LGIDL1 In
(Select L1ID
FROM TSEDAT4/MULTTT400F
join TSEDAT4/MULTTT100F
On lgidl1 = L1ID)

... also having appropriate indexes is helpful.

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Marco Facchinetti
Sent: Friday, January 24, 2025 6:59 AM
To: Midrange Systems Technical Discussion <MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
Subject: Help about Sql Delete performance

Hi we are performing this Sql over a table without triggers, LF and
journals:

DELETE FROM TSEDAT4/MULTTT400F WHERE LGIDL1 <> ' ' AND LGIDL1 NOT
IN(Select L1ID FROM TSEDAT4/MULTTT100F)

The statement runs but I see in Wrkactjob opt. 14 that I/O and RRN almost
the same numbers as if each record generate a single I/O. Since it's an Sql
statement and not RPG files access I was expecting blocked I/O operations
and thus better performances.

Get Diagnostic resturns:

COMMAND_FUNCTION_CODE=+43
COMMAND_FUNCTION=EXECUTE IMMEDIATE
CONDITION_NUMBER=+1
DB2_MESSAGE_ID=SQL7955
DB2_ORDINAL_TOKEN_1=MULTTT400F
DB2_ORDINAL_TOKEN_2=TSEDAT4
DB2_ORDINAL_TOKEN_3=38952036
DB2_ORDINAL_TOKEN_4=0
DB2_SQL_ATTR_CONCURRENCY=L
DB2_SQL_ATTR_CURSOR_CAPABILITY=D
DB2_SQL_ATTR_CURSOR_HOLD=N
DB2_SQL_ATTR_CURSOR_ROWSET=N
DB2_SQL_ATTR_CURSOR_SCROLLABLE=N
DB2_SQL_ATTR_CURSOR_SENSITIVITY=S
DB2_SQL_ATTR_CURSOR_TYPE=F
DB2_SQLERRD_SET=Y
DB2_SQLERRD3=+38952036
DB2_SQLERRD6=-134613515
DB2_TOKEN_COUNT=+4
DB2_TOKEN_STRING=MULTTT400F TSEDAT4 38952036 0
DYNAMIC_FUNCTION_CODE=+19
DYNAMIC_FUNCTION=DELETE WHERE
MESSAGE_TEXT=38952036 righe rilevate da MULTTT400F in TSEDAT4.
MORE=N
NUMBER=+1
RETURNED_SQLSTATE=00000
ROW_COUNT=+38952036

Any hint?

TIA
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2025 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.