Importing schema statistics
Posted by John Hallas on April 25, 2008
In a development environment we were generating a lot of schema builds and as more data was introduced the gather schema statistics job was taking longer
I decided to gather statistics against a sample schema, store them and import into each new schema at the end of the build.
As user devadmin
create a table to hold the statistics
gather schema statistics from a sample schema
export the statistics into the stats table owned by devadmin
As this is a test, ensure that no statistics are created for the new schema
Now apply the statistics from the stored table to the new schema
The gather schema statistics was taking at least 2 minutes and sometime more depending upon how busy the server was and this was for a small development schema (20Mb). Importing schema statistics took no longer than 10 seconds.