> How about this index? (Expecting more matching with WHERE clause)
>
> CREATE UNIQUE INDEX TABELLAI2 ON TABELLA1
> (CAMPO3, CAMPO1, CAMPO8, CAMPO5, CAMPO2, CAMPO4);
thanks for the suggestion, unfortunately this index has no effects;
the message in joblog are:
The OS/400® Query optimizer considered all access paths built over
member TABELLA1 of file TABELLA1 ...
...
Following each access path name in the list is a reason code which
explains why the access path was not used. A reason code of 0
indicates that the access path was used to implement the query.
LIBRARY/TABELLAI2 5, LIBRARY/TABELLAI1 4
...
4 - The cost to use this access path, as determined by the optimizer,
was higher than the cost associated with the chosen access method.
5 - The keys of the access path did not match the fields specified for
the ordering/grouping criteria. For distributed file queries, the
access path keys must exactly match the ordering fields if the access
path is to be used when ALWCPYDTA(*YES or *NO) is specified.
...
...
A temporary access path was built to access records from member
TABELLA1 of file TABELLA1 in library LIBRARY for reason code 1
( Perform specified ordering/grouping criteria)
...
The access path was built using the following key fields. The key
fields and their corresponding sequence (ASCEND or DESCEND) will be
shown:
(CAMPO1 ASCEND, CAMPO2 ASCEND, CAMPO3 ASCEND, CAMPO8
ASCEND, CAMPO4 DESCEND, CAMPO5 ASCEND )
And this is the index TABELLAI1 already in the system...