The only difference between the two statements is that the first one
uses the view "V001" to acces table "T001" whereas the second accesses
the table "T001" directly.

The results are the same, BUT the execution-time of the statements are
totally different.

The first Statement didn't use any index of T001 and made an
tabelspace-scan.
The second Statement used the index of T001 and is much more faster than
the first one.
The statements are passed to DB2 using dynamic-sql.

How could this be ?
Anny suggestions ?
Could this be an error of DB2 ?

Thanks in advance
Ralf-Henning Glomb

--
Ralf-Henning Glomb
BMW AG
80788 München

ralf-henning glomb

sponsored links

2
30th April 12:05

ralf-henning glomb

External User

Posts: 1

Correction of the statements:

Hi Knut,

Knut Stolze schrieb:

you are right.

Yes i have.
The first one shows an table-scan.
The second one shows an index scan.