Hi Artur,
Thanks for the hints. I will try it out as what you suggested.
Anyway, do you have any idea how the view table is constructed? Is it
made up by pointers to the physical table or there are something else?
Besides what you have suggested, is there a way to check out view table
info from the DB2 SYS schema?
Thanks in advance.......
Artur wrote:
Data for views is generated dynamically based on the select definition,
so it's difficult to talk about "view table size". If you want to
calculate the size of returned row you can use:
db2 describe output select ...from view
and multiply by numbers of returned rows.
But, if your question was "How much intermediate data db2 has to
process to return the result set from a view" than the answer is "it
depends on the view definition". Some views require whole table scan,
for some db2 can rewrite the query to access base tables with indexes.
I would suggest to play with explaining sql queries (hint: compare
"Show SQL text" and "Show optimized SQL text).
-- Artur Wronski