473,545 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4666
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
19934
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 those varchar columns. Bill Leung leungb@aptea.com
12
3232
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 correctly, so why is that?
4
6405
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 following: begin transaction INSERT INTO tgt_tbl VALUES (...); ... INSERT INTO tgt_tbl VALUES (...); end transaction;
31
3566
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 spend on the project. How do I estimate the number of hours I am going to spend on programming in a project? Thanks for help
12
2196
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 line which make the error is anchor but i cannot make it work. <TABLE id="tblDocList" dir="<%#strLangDir%>" style="DISPLAY:inline"
1
4907
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 size and index size but also estimate for the future. I keep seeing info regarding using reorgchk and the such however my dba will not allow us...
1
6321
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 internet for answers but didn't have much luck. Anyway I believe I have found the causes of the problems and thought I should share them in case any one...
0
2390
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 View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data...
4
13218
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
7669
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7439
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5987
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.