|
goobaile,
Always tell us Oracle version!
Your first query has recursive calls in the trace. So it's an unfair comparison. Run the first query one more time, or run the two queries in reverse order (second one first).
I'm sure setting _b_tree_bitmap_plans to false can improve the plan for your first query. But before we do that, can you make sure the table and index stats are close to actual values? That is, num_rows, num_distinct, etc are what you expect.
It's semantically confusing to say whether a "histogram" with only two buckets is a histogram or not. I think most people say it is not. So go with that convention and forget about it. Your problem doesn't look like histogram-related anyway.
I've noticed that sometimes the same where condition appears as both filter and access items under predicate information. I can never understand that. It could be a bug. If anybody has an idea, please tell us.
Yong Huang |
|