Re: [PERFORM] serious problems with vacuuming databases

2006-04-24 Thread Tomas Vondra
> Hi Tomas, > > Tomas wrote: > We've decided to remove unneeded 'old' data, which means removing about > 99.999% of rows from tables A, C and D (about 2 GB of data). At the > beginning, the B table (containing aggregated from A, C and D) was emptied > (dropped and created) and filled in with curre

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Ahmad Fajar
Hi Tomas, Tomas wrote: We've decided to remove unneeded 'old' data, which means removing about 99.999% of rows from tables A, C and D (about 2 GB of data). At the beginning, the B table (containing aggregated from A, C and D) was emptied (dropped and created) and filled in with current data. Then,

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Alvaro Herrera
Tomas Vondra wrote: > > Huh, I didn't suggest to dump/reload. I suggested CLUSTER. You need to > > apply it only to tables where you have lots of dead tuples, which IIRC > > are A, C and D. > > Sorry, I should read more carefully. Will clustering a table according > to one index solve problems w

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Tomas Vondra
> Huh, I didn't suggest to dump/reload. I suggested CLUSTER. You need to > apply it only to tables where you have lots of dead tuples, which IIRC > are A, C and D. Sorry, I should read more carefully. Will clustering a table according to one index solve problems with all the indexes on the table

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Tomas Vondra
> I guess you're right. I forgot to mention there are 12 composed indexes > on the largest (and not deleted) table B, having about 14.000.000 rows > and 1 GB of data. I'll try to dump/reload the database ... Aaargh, the problem probably is not caused by the largest table, as it was dropped, filled

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Alvaro Herrera
Tomas Vondra wrote: > > Probably the indexes are bloated after the vacuum full. I think the > > best way to get rid of the "fat" is to recreate both tables and indexes > > anew. For this the best tool would be to CLUSTER the tables on some > > index, probably the primary key. This will be much f

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Tomas Vondra
> Probably the indexes are bloated after the vacuum full. I think the > best way to get rid of the "fat" is to recreate both tables and indexes > anew. For this the best tool would be to CLUSTER the tables on some > index, probably the primary key. This will be much faster than > VACUUMing the t

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Tomas Vondra
Tom Lane wrote: > Tomas Vondra <[EMAIL PROTECTED]> writes: >> 1) drop, create and fill table B (aggregated data from A, C, D) >> 2) copy 'old' data from A, C and D to A_old, C_old a D_old >> 3) delete old data from A, C, D >> 4) dump data from A_old, C_old and D_old >> 5) truncate tables A, C, D >>

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Tom Lane
Tomas Vondra <[EMAIL PROTECTED]> writes: > 1) drop, create and fill table B (aggregated data from A, C, D) > 2) copy 'old' data from A, C and D to A_old, C_old a D_old > 3) delete old data from A, C, D > 4) dump data from A_old, C_old and D_old > 5) truncate tables A, C, D > 6) vacuum full analyze

Re: [PERFORM] serious problems with vacuuming databases

2006-04-09 Thread Alvaro Herrera
Tomas Vondra wrote: Hi, > Then > these data were deleted from A, C, D and tables A_old, C_old and D_old > were dumped, truncated and all the tables were vacuumed (with FULL > ANALYZE options). So the procedure was this > > 1) drop, create and fill table B (aggregated data from A, C, D) > 2) copy