473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Is there a way to estimate view table size in DB2?

Greetings,
I would like to know whether there is a way to estimate/calculate
the view table size in DB2. As what I understand, view is just a
logical table and we cannot simply calculate the size based on the
physical table(s) that made up the view. Any ideas?

Nov 12 '05 #1
4 4651
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

Nov 12 '05 #2
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


Nov 12 '05 #3
xe******@gmail.com wrote:
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?
The view definition is comparable to a query that is stored in the database.
After all, a query just returns a table, so you could run another query on
top of it. (Subqueries do exactly that.) And views represent tables -
same thing there.

That's just THE basic SQL concept: everything is in tables and all
operations take tables as input and return a tables as output.
Besides what you have suggested, is there a way to check out view table
info from the DB2 SYS schema?


Have a look an SYSCAT.VIEWS.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #4
Thanks for the explanation. I wonder I should have aksed this earlier.
Appreciate for all your kind feedback.

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: sql-db2-dba | last post by:
Does DB2 just fudge it when it is an empty table? Is there a "formula" for average row size when you have variable length records. Or you really have to know what your application is packing into...
12
by: xixi | last post by:
hi, i am using db2 udb v8.1 on windows, i try to use control center to estimate table size, but some of them showing 0 rows even though there are 6000 rows in the table, some of them showing...
4
by: Fan Ruo Xin | last post by:
How to estimate the size of log space when I need to run "INSERT INTO tgt_tbl SELECT * FROM src_tbl WHERE..." ? What is the difference of before image between the above INSERT stmt and the...
31
by: Bob | last post by:
I have recently joined a healthcare company where I am the solo programmer. I am going to be starting work on a project. The management has asked me to provide an estimate of hours I am going to...
12
by: Raed Sawalha | last post by:
I have the following table which i can not switcha to design view error message said Could not open in Design view. Quote values differently inside a '<% ...."value"... %>' block. and the...
1
by: stabbert | last post by:
We are on DB2 UDB 8.2.2 on AIX. I know this question has been asked many times on the ng but I am just not finding a real good answer. I need to be able to not only determine existing table data...
1
by: Nogusta123 | last post by:
Hi, I have had a lot of problems getting web pages, master pages and content pages to render in VS2005 design view the same as they would in Internet Explorer. I did a lot of looking on the...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
4
by: Alvin SIU | last post by:
Hi all, I am now doing development using DB2. Q1. There is one tablespace to store 5 tables. But, when in production, there will be one tablespace for EACH of the tables.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.