|
原帖由 Yong Huang 于 2008-12-6 14:04 发表 ![]()
It depends on the application. It's OK if hard parsing doesn't cause too much library cache latch contention and shared pool memory pressure to the level that can't be tolerated.
If you search on the Internet, you'll find that many people don't like bind peeking. One reason is that users would rather have predictable performance than performance problems that can't be (easily) explained. In the particular case of 4 values of directions (东南西北), turning off bind peeking thus not using histograms probably causes the SQLs querying 南,西,北 to use an index, which is correct. So at least the users and DBAs know queries of these three values always run OK and the query of 东 always runs bad. With bind peeking, there's no telling when it's OK when it's not.
Many shops take the approach of writing two queries as beyond_sea mentioned. I think it's a good solution. Otherwise, use higher-than-default-level dynamic sampling. I think Tom Kyte shows an example of it to overcome this dilemma.
Yong Huang
调优真的是一门艺术,需要在各种方面之间权衡.谢谢版主. |
|