currently dbssetup and dbupgrade both hardcode the cache size to 10, e.g.:
CREATE SEQUENCE SEQ_FOO
START WITH 10001
We should make this a configurable option and increase the value for most of our tables.
For stuff that rarely changes (think e.g. resources / resource types / ..) 10 is probably good so that we don't have huge holes in sequences when RHQ is restarted inbetween; or perhaps 20 .. 50 for other things (call time data or events ?) where larger values would sure be beneficial.
When there is a mistake as in this:
You will get this sort of error:
/home/rbuck/dev/sandboxes/rhq/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml:27: Failed to upgrade - error in spec version [2.115]. Cause: Error executing the task [org.rhq.core.db.ant.dbupgrade.SST_CreateSequence] in schema spec version [2.115]. Cause: Database SEQID Cache Size is not an integer: WOOF
To specify NOCACHE:
N.B. that for some open-source databases NOCACHE means "1", which effectively means they really don't support NOCACHE in the true sense of the word.
If the CACHE size specified is identical to the factory defaults, no CACHE terms will be applied to the generated SQL.
All negative values are mapped to the mode of using factory defaults, whatever they may be.
We need to have someone test MS Sql Server; here are the steps to test:
1. Change db-upgrade.xml:
2. Change POM.xml:
Author: Robert Buck <firstname.lastname@example.org>
Date: 2011-10-24 11:00:54 -0400
[BZ 728547] Make SEQID cache sizes configurable; the new solution supports NOCACHE and CACHE semantics, it supports factory default sizes; for cases where factory default sizes are larger than the previous default value of 10, we opt for the factory default sizes.
This seems to be done, although I believe we use the default of 10 everywhere still. Moreover, we use increments of 1 for all entities. If we plan on making perf enhancements for sequence cache sizes it should likely also include changes to the sequence increments for the relevant entities, as that has even more effect on perf, I think. See Constants.ALLOCATION_SIZE for more.
Closing as CURRENTRELEASE