Oracle generates different execution plans for test and prod environments [message #584063] |
Wed, 08 May 2013 06:40 |
|
httr
Messages: 2 Registered: May 2013
|
Junior Member |
|
|
Hi everybody,
This is my first post in this forum. I hope to post more topics in future.
I'm new in performance tuning also and confused very much because of wide scope of performance tuning.
I have a problem that i explained below and two questions:
There is a table with 50 million rows in both test and prod environments. I have created a bitmap index on a column ( FPOLK ) of this table in both environments. The column has 133 distinct values. Then I got statistics of table in both environments again. I wrote the query below and view the execution plan :
SELECT FPOLNO FROM PLM WHERE FPOLK = 374 GROUP BY FPOLNO
There is 313 rows in the table where fpolk = 374. So we expect execution plan use the bitmap index created. Test env. uses but prod env. does not use bitmap index. So my questions :
1. Why prod does not use index while test uses under same conditions?
2. In test env. cardinality does not change in execution plans that uses index even i change the value of fpolk in query.
SELECT FPOLNO FROM PLM WHERE FPOLK = 374 GROUP BY FPOLNO
SELECT FPOLNO FROM PLM WHERE FPOLK = 930 GROUP BY FPOLNO
Cardinality is the same for the queries above.
Thanks in advance
|
|
|
|
|
|
|
|
|
|
|
|
|
|