Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-30 Thread Tom Lane
"Mark Dexter" <[EMAIL PROTECTED]> writes: > 1. Would it be difficult to add an option to ANALYZE to force it to > pretend that there are a minimum number of rows (e.g., ANALYZE MINIMUM > 1000 or something)? This would appear to be a simple-minded way to > solve the problem without any concerns abo

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-30 Thread Mark Dexter
Title: Re: [GENERAL] VACUUM and ANALYZE Follow-Up Tom, I did read through the links you provided.  Unfortunately, I don't feel qualified to judge the technical merits of the possible solutions.  Since you appear to be well informed on this issue, can I ask you a couple of quick question

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-30 Thread Pierre-Frédéric Caillaud
Hasn't anybody read the other threads I posted links to? (That's a rhetorical question, because the answer clearly is "no" :-() You mean this one : http://archives.postgresql.org/pgsql-hackers/2004-11/msg00985.php In which you write : rel->pages = RelationGetNumberOfBlocks(relation); if

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Tom Lane
>>> Every 5th page of the manual says that I should use vacuum analyze >>> frequently. There are two command line tools for this and another one in >>> the contrib. I think none of them cares of empty tables. >> >> This issue need to be fixed. > What issue? I don't see an issue in the least. H

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Joshua D. Drake
Uhmmm... analyze or vacuum on an empty table is fairly pointless. Those utilities are supposed to be used on tables that have data. So the answer is, use them on tables that have data. Every 5th page of the manual says that I should use vacuum analyze frequently. There are two command line tool

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Pierre-Frédéric Caillaud
4. Isn't ANALYZE on a totally empty table really a special case? The presumption should be that the table will not remain empty. To optimize the performance assuming that there will be zero (or close to zero) rows seems somewhat pointless. However, there are valid reasons why a table might be e

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Mage
Joshua D. Drake wrote: In any case, it is hard to see how the present behaviour can be seen as desirable. It obviously causes problems at least for new Postgres users, and we all hope there will be many more of these folks in the future. Thanks for considering this. Mark Uhmmm... analyze or vac

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Alvaro Herrera
On Mon, Nov 29, 2004 at 02:57:28PM -0800, Mark Dexter wrote: > 1. Why run VACUUM on an empty table? Another approach: you run VACUUM on an empty table to empty it. If you had a table with a lot of tuples, and ran DELETE on it, it will empty after that, but it will be full of dead tuples. So y

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Mark Dexter
Hmm... it seems that we're maybe not understanding one another here. I'm going to try to be more clear. Below are the questions that were raised and my attemp to answer them clearly. 1. Why run VACUUM on an empty table? This is a good question, but perhaps there is a valid answer. Our product

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Karsten Hilbert
> >In any case, it is hard to see how the present behaviour can be seen as > >desirable. It obviously causes problems at least for new Postgres > >users, and we > >all hope there will be many more of these folks in the future. Thanks > >for considering this. Mark > > Uhmmm... analyze or vacuum

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Martijn van Oosterhout
On Mon, Nov 29, 2004 at 11:48:37AM -0800, Mark Dexter wrote: > 1. Provide an option with ANALYZE to force it to work as if a table had > a minimum number of rows (e.g., ANALYZE MINIMUM 1000 would analyze > tables as if they all had at least 1000 rows). > 2. Provide an option during table creation

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Tom Lane
"Mark Dexter" <[EMAIL PROTECTED]> writes: > Several recent postings appear to confirm that there is an issue with > the use of VACUUM or ANALYZE on empty tables. Specifically, if you > VACUUM or ANALYZE a table that is empty and then insert a large number > of rows into this table, you will experi

Re: [GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Joshua D. Drake
In any case, it is hard to see how the present behaviour can be seen as desirable. It obviously causes problems at least for new Postgres users, and we all hope there will be many more of these folks in the future. Thanks for considering this. Mark Uhmmm... analyze or vacuum on an empty table is

[GENERAL] VACUUM and ANALYZE Follow-Up

2004-11-29 Thread Mark Dexter
Title: VACUUM and ANALYZE Follow-Up Several recent postings appear to confirm that there is an issue with the use of VACUUM or ANALYZE on empty tables.  Specifically, if you VACUUM or ANALYZE a table that is empty and then insert a large number of rows into this table, you will experience ve