Rbod,
That's what we are also trying by doing RUNSTATS (I have given the exact RUNSTATS systax that we are using )
But its behaving wierd..!!
Of course we have lot more columns in Table1 & Temp_Table other than what is used in the query itself...
so,what do you think ? shall i collect...
Ans1 ##
We dont have DB2ADVIS tool but i tried all the different combinations of cols in the INDEX ,but the QUERY2 is just very much adamant to use only INDEX1 (1,3,9) and running forever...
If only i drop INDEX1, its using INDEX2( or others) and running fast as its expected to do.
Ans2 ##...
Hi,
we are doing the 2 following updates in DB2 8.1,the index meant for 1st update is getting used in 2nd update and making it very slow.
** Table c has 7MM rows.
** Table w has 300K records.
** RUN STATS are Current for both tables.
** REORGCHK on table c has been done and it looks ok
/** For...
The Program is running on UNIX.
Which file you are asking about ? Please clarify a little so that i can amswer.
Here we are building a sql string ( basically INSERT statement ) dynamically within a CURSOR loop ,storing that within a local variable say v_sql_string within the loop itself...
Hi,
We are encountering a strange situation which using PREPARE and then EXECUTE for a dynamic INSERT statement.
The Stored proc is not returning any error but the insert is not happening. We tried running the INSERT statement outside and its doing fine ..
do you have any idea why the thing is...
Marc,
yeah the first one is a great suggestion,though the COST
in the db2expln plan doesn't change that much , i can see
improvements while actually running the altered query.
BUSS_KEY_PART_08 may not contain date always..no we dont get -180, what actually u are meaning by that ?
Thanks,
Hi,
I wrote last week about some costly queries and kind of tuned them by adding a NEW index with all your valuable help.
Looks like the story didn't end here. There are another set of queries [which is having SELF JOIN on a 25 MM table]Its picking up the NEW index,showing improvement in...
Greg and others,
I'm on UNIX... I tried looking for Db2advis -help like you find the commands for Db2expln -help.. But its not coming up.. U are rgt..we would have been here without much effort on last Thursday itself if Db2advis were there..
Yep,the queries are are showing decent PLAN costs...
Marc/Ties,
You may be right,it looks like Db2 8 versions support indexing even on <> columns.I mean if you include the column in the index get picked and helps cutting costs.
Earlier i made the new index as follows :-
SOURCE_SYSTEM_NM
LOAD_PROCESS_KEY_PART_01
BUSINESS_KEY_PART_04...
Hi Marc,
Yep,DELETE_DT is Nullable and its used in some other
queries like " and b.DELETE_DT is null "...
I was thinking of a index on the following..The reason i excluded LOAD_PROCESS_KEY_PART_02 is because in most of the queries its used as <> , so would it help if we add that in the INDEX...
Unfortunately that's how the current business logic is built..!!
do you have any alternatives in mind for those clauses,
of course the result should not alter.
By the way, we dont have Db2advis,so i cant really check that tools advise.. But i'm thinking of a different INDEX ...
let me know if creating a different index instead of the one its using can make a difference...
Thanks
The query plan(COST) is same as earlier even after removing "NOT EQUAL" clause.
In the Production environment they have RUN STATS scheduled but REORG is done in certain intervals and its for sure the tables are monitored for Fragmentation etc.
Let me send you the Tables,Query INDEX its using...
Greg,
First thx for ur reply... i did do the RUNSTATS...
The spooky thing is that the query is taking 20 mins though the db2expln is showing that its using INDEX !!
is it like i have to find a better index through db2advis?
the tables are having 16 MM and 200k rows respectively so there is...
Hi,
1> i have a composite index I1 on column A,B,C,D,E out of which A,B is present in where clause and column D is also present in where clause but with a <> operator.
The query plan is showing INDEX I is being used still the query is kind of slow ... any tips for improving?
by the way ,i...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.