If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

(Keeping it simple)
Analyze calculates statistics that the Cost Based Optimizer (CBO) uses to chose how to run your query efficiently. The effect you see has nothing to do with the quality of your query. Analyze needs to be rerun when the statistics of your tables change siginificantly - maybe daily for a system starting up (big % changes in volumes), maybe monthly for a mature system. Of course it all depends . . . Try searching on those buzz-words.

"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

(was interrupted - she is very pretty!)
In development - new tables should start to be Analyzed when they get a "moderate" amount of data in them (perhaps in the 100 to 1000 row range - no need when they have only 10 rows). Old tables should be re-Analyzed whenever an Index is added.

"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman