Hi,
when executing the following statement:
select distinct substr(tabname,5,4),substr(tabname,10,2),'dummy' from syscat.tables where tabschema = 'user' AND tabname like 'TRX___________' and substr(tabname,5,4)||substr(tabname,10,2) between to_char(current_timestamp-1 year + 1 month,'YYYYMM') and to_char(current_timestamp,'YYYYMM')
, I get the output:
<<<
1 2 3
---- -- -----
SQL0437W Performance of this complex query may be sub-optimal. Reason code:
"1". SQLSTATE=01602
2010 01 dummy
2010 02 dummy
2010 03 dummy
2010 04 dummy
2010 05 dummy
2010 06 dummy
2010 07 dummy
2010 08 dummy
2010 09 dummy
2010 10 dummy
2009 11 dummy
2009 12 dummy
12 record(s) selected with 1 warning messages printed.
>>
What could be the problem here and what to do?
I have daily tables, like TRX_2010_08_01, TRX_2010_08_02 and so on.
Based on the result I want to create monthly views with "union all". But with that error message is not possible anymore. I'm talking about 650 tables.
I do also have daily views, like TRX_V_2010_08_01. An SQl-cmd based on syscat.views doesn't show that problem.
Thanks.