If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
may someone help me with this ?! ...
i want to know how can i calculate the cost for processing a query ..
i mean how can i calculate the number of disc accesses to process the query ..
in order to optimize the query processing ... thanks
The [estimated] I/O and CPU load figures can be found in the query explain plan. Use Visual Explain, db2expln or db2exfmt to obtain the plan in readable form.
You can do an Explain, which will estimate the cost and number of rows based on the statistics as of the last runstats. You can run the explain via command line, or use the Visual Explain from the Control Center.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
i meant it simple ..
an example ...my selection will select 400 records out of 1000 record and then select another 200 records out of 1000 records and cartisian product them (Selection 1 × Selection 2).. and every block carries 4 records (blocking factor = 4 records) .. how many hard accesses then ? ..
each time will be different due to what is in bufferpool at the time, so there is never anyway to determine how many times you will actually go to disk. The way to optimize your query is to use visual explain and ensure proper index access with matching columns to all of your tables. Also, stay away from cartesian products.
Dave
Rows read = 23640
Internal rows updated = 0
Rows written = 0
Statement sorts = 3
Statement sort overflows = 0
Total sort time = 0
Buffer pool data logical reads = 192
Buffer pool data physical reads = 1
Buffer pool temporary data logical reads = 0
Buffer pool temporary data physical reads = 0
Buffer pool index logical reads = 1
Buffer pool index physical reads = 1
Buffer pool temporary index logical reads = 0
Buffer pool temporary index physical reads = 0