I'm beginning to work with Oracle and I've learn that in Oracle 9 statistics aren't collected for an index unless you use COMPUTE STATISTICS
, but you can't use that option when defining a primary key, so I would want to know if primary keys can use statistics in some way.
If not, is there a noticeable difference in performance? Are there any workarounds?
Thanks in advance.
First of all, you can define your index before you define the primary key constraint, hence you'll have full control over the index (you can add COMPUTE STATISTICS
as well) see this http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/indexes003.htm#i1006566
Second, unless you have a good reason for it, you should use the Automatic Statistics Gathering http://download.oracle.com/docs/cd/B12037_01/server.101/b10752/stats.htm#40674
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.