Re: Update Statistics
Posted in 1993
} Jim Gordon writes: } { I said that update stats does not lock the table, but rather the syscat } entry -davek} } |> JG: I said why hold the lock for the whole time of running update } |> stats on a table. } } You are correct, the row is retrieved with a lock placed, and this lock } endures until the update is complete. I do not know for sure why this } is done, but I will speculate the following: } } If you have been accessing the table, you will have a current version of the } pertinant system catalog info already in your local memory, so you will not } have to read the catalog info and thus should be able to continue accessing } the data. A new user of the table will not have this data, and will be forced } to wait, which, at some level, is desirable as they should receive the *new* } picture of the table, which includes the new stats, i.e. they *should* be } forced to wait. } } Note: I do not endorse this speculative reason (and, again, I am not saying } that this *is* why it is done, only a possible reason - I will attempt to } get a definitive answer if one exists). I think it would be better to } lock only for the update. } } Dave Thanks Dave, that will be great. It would be nice if this small fix could be included in V6.0 if there isn't a definite reason why the lock has to be held. If no one out there has a problem I will raise it as a enhancement request with our support people. This small change would make Update Stats something we could and would do on a regular basis rather than when we can in our 24*7 sites. Cheers - Jim -------------------------------------------------------------------- Name: Jim Gordon Internet: jgordon@ssf-sys.DHL.COM Company: DHL Systems Inc Phone: (415) 358-5911 (Work) Address: 1700 S. Amphlett Blvd. (415) 882-9728 (Home) San Mateo, CA 94402 Fax: (415) 571-6429 --------------------------------------------------------------------