Re: Vacuum now uses AccessShareLock for analyze
От | Bruce Momjian |
---|---|
Тема | Re: Vacuum now uses AccessShareLock for analyze |
Дата | |
Msg-id | 200005291754.NAA17962@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: Vacuum now uses AccessShareLock for analyze (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Vacuum now uses AccessShareLock for analyze
|
Список | pgsql-hackers |
> > How separate do people want vacuum and analyze? Analyze currently does > > not record the number of tuples and pages, because vacuum does that. Do > > people want analyze as a separate command and in a separate file? > > We definitely want a separate command that can invoke just the analyze > part. I'd guess something like "ANALYZE [ VERBOSE ] optional-table-name > (optional-list-of-columns)" pretty much like VACUUM. OK. > > I would be inclined to move the code out to a new file, just because > vacuum.c is so darn big, but that's purely a code-beautification issue. Done. > > On the number of tuples/pages issue, I'd suggest removing that function > from plain vacuum and make the analyze part do it instead. It's always > made me uncomfortable that vacuum needs to update system relations while > it's holding an exclusive lock on the table-being-vacuumed (which might > be another system catalog, or even pg_class itself). It works, more or > less, but that update-tuple-in-place code is awfully ugly and > fragile-looking. I'm also worried that there could be deadlock > scenarios between concurrent vacuums (eg, one guy working on pg_class, > another on pg_statistic, both need to get in and update the other guy's > table. Oops. That particular problem should be gone with your changes, > but maybe there are still problems just from the need to update > pg_class). How do I find the number of pages from heapscan? Can that number just be computed from the file size. I can get the block number of the last entry in the scan, but that doesn't show me expired rows at the end. -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
В списке pgsql-hackers по дате отправления: