Hi i am in the learning phase of query tuning, I have this query executed in our prod, which does more sorting.. Just want to understand how this can be tuned to give better performance.
SELECT SUM(consumption), SUM(demand), MIN(start_dts_lt), MAX(end_dts_lt), MIN(start_dts_z), MAX(end_dts_z) FROM GEMS.METER_CON
S_SUM_1H WHERE ruletimestamp= '2012-01-11 06:31:02.674050' AND HOUR(start_dts_lt)=17 AND DATE(start_dts_lt)='2012-01-10' AND o
rgname='WPL' AND location='EC4' AND meterid IN (SELECT assetuid FROM GEMS.MAXIMO_ASSETMETER_SVC_CONS_SUM_DAY WHERE parentuid L
IKE 'C_WPLxL_EC4xMA_OFA02xEC_11' AND type='CALCULATED')
there are many such query i want to have a basic understanding hw to approach on these kind of query.
have you looked at the access plan with db2 explain tool
try db2advis to see what is recommended
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be