Greetings.
I am responsible for optimizing our queries which require reasonable sources on the system.
I have a problem about running runstats.
According the usage of the tables I have indexes on various tables.Those indexes work very well and we are able to able significant performance.
However we have to modify the tables frequently so we export our data,drop the table,import,apply the constraints such as foreign keys etc. (or perfom the load action).
Also we take care that while exporting we sort the records
according to the index that we most use.
After that I recreate my indexes and perform these steps.
1. Reorgchk update statistics...
2. Reorg table index <the most important index>
3. Runstats on table ... with distribution and detailed indexes all
After step 2 , I also hit SQL Explain with heavy SQLs and the methodology usually is exactly what I desire.
But sometimes after step 3, (runstats)
visual explain never uses my index again.Also after that,the problem never solves.I recreate my indexes,doing reorg,runstats,... no...The oprimizer refuses to use my query.Subsequently we we run our query,the result is chaos.
I had this problem today and had to give up my process and dropped my db and restored it from back up and made the first 2 steps only.Now it works fast as expected.
Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
I am responsible for optimizing our queries which require reasonable sources on the system.
I have a problem about running runstats.
According the usage of the tables I have indexes on various tables.Those indexes work very well and we are able to able significant performance.
However we have to modify the tables frequently so we export our data,drop the table,import,apply the constraints such as foreign keys etc. (or perfom the load action).
Also we take care that while exporting we sort the records
according to the index that we most use.
After that I recreate my indexes and perform these steps.
1. Reorgchk update statistics...
2. Reorg table index <the most important index>
3. Runstats on table ... with distribution and detailed indexes all
After step 2 , I also hit SQL Explain with heavy SQLs and the methodology usually is exactly what I desire.
But sometimes after step 3, (runstats)
visual explain never uses my index again.Also after that,the problem never solves.I recreate my indexes,doing reorg,runstats,... no...The oprimizer refuses to use my query.Subsequently we we run our query,the result is chaos.
I had this problem today and had to give up my process and dropped my db and restored it from back up and made the first 2 steps only.Now it works fast as expected.
Thanks...Why does runstats crash our job?
Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr