|
It looks like this: C/EXEC SQL C+ declare C2 cursor for C+ select XXXXX00F.*, tasaas*10000+tasmgs C+ from XXXXX00F where tasnrs >= :parnrs and C+ tastsp <> :partsp and C+ tasaas*10000+tasmgs between :p75ds1 and :p75ds2 C+ union C+ select XXXXX10F.*, tasaas*10000+tasmgs C+ from XXXXX10F where tasnrs >= :parnrs and C+ tastsp <> :partsp and C+ tasaas*10000+tasmgs between :p75ds1 and :p75ds2 C+ union C+ select XXXXXP0F.*, tasaas*10000+tasmgs C+ from XXXXXP0F where tasnrs >= :parnrs and C+ tastsp <> :partsp and C+ tasaas*10000+tasmgs between :p75ds1 and :p75ds2 C+ order by tasaas, taslnp, tasnrs C+ for fetch only C/END-EXEC XXXXX00F => 3.500.000 records XXXXX10F => 24.000.000 records XXXXXP0F => 35.000.000 records p75ds* are date in format 20020101 Any ideas??? Fabrizio Gurrieri - BARTOLINI SPA Via E.Mattei 42 - 40138 BOLOGNA (Italy) Tel:+39 051 6015593 - Fax:+39 051 530365 E-Mail: Fabrizio.Gurrieri@bartolini.it Internet: http://www.bartolini.it -----Messaggio originale----- Da: Wills, Mike N. (TC) [mailto:MNWills@taylorcorp.com] Inviato: mercoledì 26 giugno 2002 16.52 A: 'rpg400-l@midrange.com' Oggetto: RE: Any ideas??? What does your statement look like? -----Original Message----- From: Gurrieri Fabrizio [mailto:fabrizio.gurrieri@bartolini.it] Sent: Wednesday, June 26, 2002 1:51 AM To: rpg400-l@midrange.com Subject: Any ideas??? This is a multi-part message in MIME format. -- [ Picked text/plain from multipart/alternative ] Hi, I have 3 big files with the same record format, they are divided by date => the first are the most recent records, the second the old records and the third the historical records (totally are 63 milion of records). Now I have to run SQL (into an SQLRPGLE) on all of these three files order by date and other three fields with some selection and I've the problem below: when I run SQL for a period that is completely included in the first file the SQL (it works using UNION) read all three files and naturally it works for for too much hours. How can I optimize my SQL statement, any ideas??? Thanks a lot Fabrizio Gurrieri - BARTOLINI SPA Via E.Mattei 42 - 40138 BOLOGNA (Italy) Tel:+39 051 6015593 - Fax:+39 051 530365 E-Mail: Fabrizio.Gurrieri@bartolini.it Internet: http://www.bartolini.it <http://www.bartolini.it/> _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.