Re: [HACKERS] visibility map and reltuples

2008-12-17 Thread Heikki Linnakangas
Tom Lane wrote: I think your previous sketch is right: suppress update of reltuples (and relpages) from a partial vacuum scan, and ensure that the analyze phase is allowed to do it instead if it happens during VACUUM ANALYZE. We also mustn't reset n_live_tuples in pgstat in partial vacuum. Com

Re: [HACKERS] visibility map and reltuples

2008-12-15 Thread Greg Smith
On Mon, 15 Dec 2008, Greg Stark wrote: I wonder if we should switch to keeping reltuplesperpage instead. It would be preferrable to not touch the user side of reltuples if possible, since it's the only instant way to get a good estimate of the number of rows in a table right now. That's bee

Re: [HACKERS] visibility map and reltuples

2008-12-15 Thread Tom Lane
Heikki Linnakangas writes: > Greg Stark wrote: >> I wonder if we should switch to keeping reltuplesperpage instead. Then a >> partial vacuum could update it by taking the average number of tuples >> per page forbthe pages it saw. Perhaps adjusting it to the weights >> average between the old va

Re: [HACKERS] visibility map and reltuples

2008-12-15 Thread Heikki Linnakangas
Greg Stark wrote: I wonder if we should switch to keeping reltuplesperpage instead. Then a partial vacuum could update it by taking the average number of tuples per page forbthe pages it saw. Perhaps adjusting it to the weights average between the old value and the new value based on how many p

Re: [HACKERS] visibility map and reltuples

2008-12-15 Thread Greg Stark
I wonder if we should switch to keeping reltuplesperpage instead. Then a partial vacuum could update it by taking the average number of tuples per page forbthe pages it saw. Perhaps adjusting it to the weights average between the old value and the new value based on how many pages were seen

Re: [HACKERS] visibility map and reltuples

2008-12-15 Thread Heikki Linnakangas
Heikki Linnakangas wrote: Ned T. Crigler wrote: It appears that the visibility map patch is causing pg_class.reltuples to be set improperly after a vacuum. For example, it is set to 0 if the map indicated that no pages in the heap needed to be scanned. Perhaps reltuples should not be updated u

Re: [HACKERS] visibility map and reltuples

2008-12-14 Thread Heikki Linnakangas
Ned T. Crigler wrote: It appears that the visibility map patch is causing pg_class.reltuples to be set improperly after a vacuum. For example, it is set to 0 if the map indicated that no pages in the heap needed to be scanned. Perhaps reltuples should not be updated unless every page was scanned

[HACKERS] visibility map and reltuples

2008-12-13 Thread Ned T. Crigler
It appears that the visibility map patch is causing pg_class.reltuples to be set improperly after a vacuum. For example, it is set to 0 if the map indicated that no pages in the heap needed to be scanned. Perhaps reltuples should not be updated unless every page was scanned during the vacuum? --