Tip: 看不到本站引用 Flickr 的图片? 下载 Firefox Access Flickr 插件 | AD: 订阅 DBA notes -- ![]()
2010-06-21 Mon
It’s one of those hints that you’ve heard about many times, but all the information is scattered, and finding what you need is really hard.
Many (including myself) have expressed the deepest desire to see it documented, but that never happened. I’ve just troubleshot a problem and used this hint a lot during my “what if” scenario testing, and found this hint to be quite useful. Thus, I decided to document it here on the blog.
I will come back and update this blog as I discover new parameters, and feel free to suggest what you’ve found in the comments. If you can, include an example to illustrate usage.
Note that this usage guide is not official, and is build by my best understanding on how this hint operates.
OPT_ESTIMATE
Purpose
To influence costing and cardinality estimates by the optimizer in the hope that a better execution path is selected. This hint supersedes the “CARDINALITY” hint.
Usage
Parameters separate by space (optionally by comma). “[]” means that “query block” is optional.
/*+ OPT_ESTIMATE( [query block] operation_type identifier adjustment ) */
-
query block
optional and in the format “@QB_NAME”. For example, in the lack of any QB_NAME hints, you could say: OPT_ESTIMATE(@SEL$1 TABLE….)
-
operation_type
QUERY_BLOCK
unknownTABLE
refers to tableExample:
select /*+OPT_ESTIMATE(TABLE DD ROWS=10)*/ count(*) from dual DD
INDEX_FILTER
adjusts index filtering – number of rows produced by the index lookup, does not affect the cost to scan the indexINDEX_SCAN / INDEX_SKIP_SCAN
For index range or skip scans – how many rows will be scanned in the index – affects the COST of the index access and the number of rows outputtedJOIN
the join result of 2 tables – oracle joins 2 tables at a time. Note that you can adjust join cardinalities between 2 tables in order to make that join not to be used. -
identifier
qry_block is always optional
TABLES: tab_alias@qry_block
INDEX: tab_alias@qry_block index_name
JOINS: JOIN(tab1_alias@qry_block tab2_alias@qry_block)
-
adjustment
ROWS=number
SCALE_ROWS=number – multiplier to be used. For example 0.1 is 10 times less rows than originally estimated
MIN=number – unknown
MAX=number – unknown
Dear Community,
Percona Server version 5.1.47-rel11.0 is available for download now.
The changes in this release include:
New features
- Percona Server is now based on MySQL 5.1.47, and XtraDB is now based on InnoDB plugin 1.0.8.
- XtraDB now uses the fast recovery code released in InnoDB Plugin version 1.0.8, instead of Percona's earlier fast-recovery code.
- Added the --percona_innodb_doublewrite_path option to place the double-write-buffer into its own file (issue #584299). The feature is sponsored by Large Social Network website.
- Added the --suppress_log_warning_1592 option to disable logging of error code 1592.
- Added the --microseconds_in_slow_query_log option to use microsecond precision for the slow query log's timestamps (issue #358412).
- Added the --use_global_log_slow_control option to control slow-query logging globally without restarting, similar to --use_global_long_query_time.
- Added the --query_cache_strip_comments option to strip comments from query before using it in query cache.
- Added a global Innodb_deadlocks counter to SHOW STATUS, based on a patch by Eric Bergen (issue #569288, issue #590624).
- Added more tests to the MySQL test framework.
Fixed bugs
- #573100 Can't compile 5.1.46
- #573104 separate name in INNODB_SYS_TABLES table
- #580324 Security bug in upstream
- #586579 Percona Server 11 fails to compile with CFLAGS=-DUNIV_DEBUG
- #569156 CentOS 5: mysql-server conflicts with MySQL-server
- #589639 Recovery process may hang when tablespaces are deleted during the recovery
- #570840 deb package conflicts with libdbd-mysql-perl
The binary packages are available on our website.
Starting from this release there is a uniform naming scheme for Percona binaries for 5.0 and 5.1 based packages. RPM are named as:
Percona-Server-<sub package>-<package suffix>-<mysql version>-<release number>.<revision number>.<os code>.<platform>.rpm
Examples:
-
Percona-Server-server-51-5.1.47-rel11.0.46.rhel5.x86_64.rpm
-
Percona-Server-client-51-5.1.47-rel11.0.46.rhel5.x86_64.rpm
Here:
- "Percona-Server" is a name of the product.
- "server" or "client" - sub-package
- 51 - suffix, which means the packages are based on 5.1.x versions
Together "Percona-Server-server-51" is the package name.
- 5.1.47 is the MySQL version the package is based on
- rel11.0 is release number
- 46 is BZR revision
- rhel5 is an operating system code
- x86_64 is a platform
Percona Server obsoletes Percona XtraDB both on rhel and debian paltform. To install RPM or DEB package from Percona repository you just have to do "yum install Percona-Server-server-51". If there is Percona-XtraDB installed it will be replaced by Percona Server. However Percona-Server doesn't obsolete MySQL, so you have to deinstall it first. Conflicts are inevitable otherwise.
If there are MySQL dependant applications already installed, you might want to install Percona Shared Compat package before installing Percona Server.
The latest source code of Percona Server, including development branch you can find on LaunchPAD.
Please report any bugs found on Bugs in Percona Server.
For general questions use our Pecona-discussions group, and for development question Percona-dev group.
For support, commercial and sponsorship inquiries contact Percona

Entry posted by Aleksandr Kuzminsky | 2 comments
Useful information for MongoDB users in the Ruby-land:
At first glance, Mongoid and MongoMapper seem to take similar approaches and have very similar APIs, […] it turns out they have different motivations, aims, and, underneath it all, they target different use cases pretty well.
那确实,技术的提高,还是需要多看书以及血的教训,很多东西,别人和我说100遍,可能都不以为然,自己经历过,记得最牢固。RT @hellodba: 不过,有句话是真的:从来就没有什么神话。
理由?哪天你不是在场么,你知道的。RT @NinGoo: 丫的何必打破很多人心中美好的幻想 RT @DavidGuo: 多谢大辉帮我推这个文章,哈哈哈哈 RT @Fenng: 从来就没什么神话 http://www.oracledba.com.cn/blog/?p=617
卖了吧,留着也没用,2w,可以给你未出世的宝宝买好多奶粉了,嘿嘿RT @niubro: 有人出2w买俺的qq号
多谢大辉帮我推这个文章,哈哈哈哈 RT @Fenng: 从来就没什么神话 http://www.oracledba.com.cn/blog/?p=617
After a short break, we are continuing our NoSQL week in review series.
What’s Hot in the NoSQL World
- When should I use MongoDB?
- Integrating Hive and HBase at Facebook
- Cassandra, HBase, and PNUTS Compared
- Tracking page views with MongoDB
- Video: 2 Hours Riak Tutorial
To these, I’ll add the two questions of the week:
and a useful tip for backing up MongoDB using Amazon S3
NoSQL Week in Review
-
Redis UDP Protocol
“Salvatore Sanfilippo reports on the advance of the Redis UDP protocol: …”
-
NoSQL Ecosystem News & Links 2010-06-14
“Some geeky stuff: …”
-
Details About Riak Innostore and Bitcask Backends
“With the recent release 0.11.0 Riak switched the default backend storage from using embedded Innostore to Bitcask. Learn about the new default storage backend…”
-
NoSQL Ecosystem News & Links 2010-06-15
“Chef cookbook for HBase, Redis for timeseries, Migrating to MongoDB in 3 days and an Introduction to CouchDB…”
-
Presentation: Project Voldemort at Gilt Groupe: When Failure Isn’t an Option
“InfoQ posted Geir Magnusson’s presentation on Project Voldermort recorded at QCon London. …”
-
Tracking page views with MongoDB
“After looking at 4 different alternatives — Google Analytics, sharding existing MySQL database, ETL process ( nb log processing) and MongoDB, Eventbrite decided to go the MongoDB way dismissing the other approaches: …”
-
Presentation: OrientDB introduction
“Not long ago I’ve written about a couple of new projects in the NoSQL space, listing OrientDB among them. See what is OrientDB…”
-
When should I use MongoDB?
“Brandon Keepers’ answer to the question when should I use MongoDB is: … Is it a valid answer?”
-
CouchDB Case Study: Web Based IRC
“Another CouchDB case study this time from Anologue: …”
-
Integrating Hive and HBase at Facebook
“While definitely interesting, something doesn’t seem to add up: …”
-
Is NoSQL Just for a Small Niche?
“NoSQL is not a bad idea, but it fills a pretty small niche. A much smaller niche than I thought before.… Is he right?”
-
Redis API Exposed as Web Services
“Redis API exposed as web services using Service Stack an open source .NET and Mono web services framework. Might give you an idea how to build your own Redis-as-a-Service. …”
-
Comparing Jackrabbit (JCR) and CouchDB
“During Berlin Buzzwords NoSQL event , I was asked to compare Jackrabbit and CouchDB, so I hope this will offer a more structured and complete comparison. …”
-
Release: AllegroGraph 4.0, 100% ACID
“AllegroGraph RDFStore, a solution at the crossing of RDF stores and graph databases , has released recently new major update featuring: …”
-
Video: 2 Hours Riak Tutorial
“A must see tutorial on Riak by Sean Cribbs. …”
-
Berlin Buzzwords Presentations
“What are your favorite presentations from the largest NoSQL event? …”
-
A NoRM-MongoDB Repository Base Class
“Always persisting object graphs using the embedded document strategy may not be such a good idea even if it sounds like a good strategy which even works well with MongoDB advanced filtering capabilities: …”
-
Cassandra, HBase, and PNUTS Compared
“A nice matrix comparing characteristics of Cassandra, HBase and PNUTS: …”
-
Compojure and MongoDB: Sample App
“My fascination for Clojure and a bit of NoSQL flavor made me mention this basic sample app: …”
-
A Cassandra Glossary
“If you are just starting to look into Cassandra or want to explain some Cassandra (and not only) terms to your friends or colleagues this might be a good resource defining over 50 terms. …”
-
NoSQL Graph Databases and the Future of GIS
“Coming from a GISer: …”
-
Question about Riak MapReduce
“There’s one aspect of Riak’s MapReduce that I’ve always wondered about…”
-
MongoDB Backups Using Amazon S3
“Good help for those looking to backup MongoDB installations: …”
-
All Erlang: Riak and Mnesia
“Rusty Klophaus reports from Erlang Factory London event and we take a look at Riak architecture and Mnesia. …”
-
Practical Tips for Optimizing SimpleDB Access
“A set of tips for optimizing access to SimpleDB based on extensive experience: …”
Have a great NoSQL week!
2010-06-20 Sun
2010-06-19 Sat
AnySQL.net
Oracle & Starcraft
Give you some color to see see!
Oracle Scratchpad
Oracle Life
Chanel [K]
Oracle Security Blog
MySQL Performance Blog
The Tom Kyte Blog
Delicious/Fenng/oracle
O'Reilly Databases
Red Hat Magazine
车东[Blog^2]
blue_prince
玉面飞龙的BLOG
木匠 Creative and Flexible
生活帮-LifeBang
Hey!! Sky!
dba on unix
Brotherxiao's Home
jametong's shared items in Google Reader
DBA Tools
Inside the Oracle Optimizer - Removing the black magic
DBA@Taobao
存储部落
OracleBlog.cn
知道分子
支付宝官方 Blog - 支付志
木匠的天空 Oracle Architect and Developer
Hello DBA
OS与Oracle
Cary Millsap
Guy Harrison's main page
eagle's home
dbthink
DBA Notes
OracleDBA Blog---三少个人涂鸦地!
The Pythian Blog
myNoSQL
OracleDBA Blog---三少个人涂鸦地!
DBA@SKY-MOBI




