![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
My aplication has query that returns some counts about desktops. It receives a parameter ( CUSTOMER identification ). This query is executed fast on my productionŽs DB, but slowly on my client DB. |
|
I could not find where is the problem, because the access plan are equals, except a NLJOIN ( production DB ) and a HJOIN ( client DB ) |
#3
| |||
| |||
|
|
Hello, My aplication has query that returns some counts about desktops. It receives a parameter ( CUSTOMER identification ). This query is executed fast on my production s DB, but slowly on my client DB. Ok, what do you mean by client DB? Are both statements executed locally or is the client DB a client connecting to a remote server DB? Are the registry variables the same? db2set -all I could not find where is the problem, because the access plan are equals, except a NLJOIN ( production DB ) and a HJOIN ( client DB ) Hmm, I have too less information. I could see that there are more rows in the production database. But this is assuming that the statistics are accurate. Are they? There are also a lot of overflow records. Maybe you should do a reorg and runstats on your tables. Furthermore the number of average applications is 50 on the client DB, which means that the bufferpool estimation for the plan could be wrong. But what puzzles me most is that one query is running with UR (client) and the other one with CS (production). Which is even more confusing, since UR should be better for perf because of less potential locks. The databases seem to be different in size and also with regard to several parameters. What else is different? -- Helmut K. C. Tessarek DB2 Performance and Development IBM Toronto Lab |
#4
| |||
| |||
|
|
Hi all, DB2 LUW v9.5 FP 7. My aplication has query that returns some counts about desktops. It receives a parameter ( CUSTOMER identification ). This query is executed fast on my productionŽs DB, but slowly on my client DB. I could not find where is the problem, because the access plan are equals, except a NLJOIN ( production DB ) and a HJOIN ( client DB ) [db2inst1@ client]$ time db2 -tf query_client.sql ... real * *1m30.964s user * *0m0.021s sys * * 0m0.025s [db2inst1@ production ]$ time db2 -tf query_production.sql ... real * *0m0.279s user * *0m0.008s sys * * 0m0.022s The access plan for each environment are here:http://tracker.automatos.com/cases/accessPlan.tgz Any ideas? Regards, Bruno Almeida |
#5
| |||
| |||
|
|
try the same sortheap size (16k) on your client db, runstats the tables, and see whether it helps. |
#6
| ||||
| ||||
|
|
1) Sorry about the expression "client db", I could say Customer DB, in other words, is a database installed on customer environment. |
|
2) The db2set parameters: |
|
3) Yes, the statistics are accurate. |
|
5) Both the databases has the SELF_TUNNING parameter set to AUTOMATIC. [db2inst1@customerEnv ~]$ db2 get db cfg | grep SELF Self tuning memory (SELF_TUNING_MEM) = ON [db2inst1@production ~]$ db2 get db cfg | grep SELF Self tuning memory (SELF_TUNING_MEM) = ON |
#7
| |||
| |||
|
|
On 19.07.11 12:18 , Bruno Almeida wrote: 1) Sorry about the expression "client db", I could say Customer DB, in other words, is a database installed on customer environment. Understood. 2) The db2set parameters: Ok, what about the dbm and db parameters? Any significant differences? 3) Yes, the statistics are accurate. Ok, then please do a reorg and then a runstats again. 5) Both the databases has the SELF_TUNNING parameter set to AUTOMATIC. [db2inst1@customerEnv ~]$ db2 get db cfg | grep SELF *Self tuning memory * * * * * * * * * *(SELF_TUNING_MEM) = ON [db2inst1@production ~]$ db2 get db cfg | grep SELF *Self tuning memory * * * * * * * * * *(SELF_TUNING_MEM) = ON Hmm, how many instances and how many databases per instance? Anyway, Yonghang suggested to increase the sortheap which is definitely agood idea. You could also try to use optimization guidelines to force a NLJOIN or a HJOIN (depending on which machine you want to try it). -- Helmut K. C. Tessarek DB2 Performance and Development IBM Toronto Lab |
#8
| |||
| |||
|
|
On 20 jul, 01:34, Helmut Tessarek <tessa... (AT) evermeet (DOT) cx> wrote: On 19.07.11 12:18 , Bruno Almeida wrote: 1) Sorry about the expression "client db", I could say Customer DB, in other words, is a database installed on customer environment. Understood. 2) The db2set parameters: Ok, what about the dbm and db parameters? Any significant differences? 3) Yes, the statistics are accurate. Ok, then please do a reorg and then a runstats again. 5) Both the databases has the SELF_TUNNING parameter set to AUTOMATIC.. [db2inst1@customerEnv ~]$ db2 get db cfg | grep SELF *Self tuning memory * * * * * * * * * *(SELF_TUNING_MEM) = ON [db2inst1@production ~]$ db2 get db cfg | grep SELF *Self tuning memory * * * * * * * * * *(SELF_TUNING_MEM) = ON Hmm, how many instances and how many databases per instance? Anyway, Yonghang suggested to increase the sortheap which is definitelya good idea. You could also try to use optimization guidelines to force a NLJOIN or a HJOIN (depending on which machine you want to try it). -- Helmut K. C. Tessarek DB2 Performance and Development IBM Toronto Lab Thanks Helmut / Yonghang. IŽll try the suggestions tonight and keep you informed. Regards Bruno . |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
How about to set DB2_REDUCED_OPTIMIZATION to 'YES'? It might suppress use of hash-join. |
![]() |
| Thread Tools | |
| Display Modes | |
| |