Niblett, David A wrote:
> Well I completed my delete and all went well, though I'm
> expecting a call about users who lost all their Email.
> 
> I had some differences from your code Paul.  I had to use:
> 
> INSERT INTO tmp (id, physmessage_id)
> SELECT p.id, m.physmessage_id
> FROM dbmail_physmessage p
> LEFT JOIN dbmail_messages m
> ON p.id = m.physmessage_id
> WHERE m.physmessage_id IS NULL;
> 
> The difference being that my left join found EVERY message
> if I didn't include the physmessage_id as part of the
> output.  Not really sure why, but I just made the table
> with 2 columns and dropped all the records in there.
> 
> Am I right in my understanding that because of the ON
> CASCADE DELETE relation between dbmail_physmessage and
> dbmail_messageblks, that I can't have inconsistency between
> those two tables?  What might be a good way to check?  Does
> dbmail-util check that?
> 
> Can someone explain why my row count in dbmail_messages
> and dbmail_physmessage might be off a bit?  I'm guessing that
> I could have a single physmessage that is referenced by multiple
> message entries.  I thought from past reading that dbmail made
> a copy of each message for each recipient.  If not, then that's
> great.
> 
> Last question, I would have to do a vacuum full (postgres) to
> reclaim the disk space of all those messages correct?  I'm still
> trying to really understand the vacuum process in postgres.  It
> seems so odd.
> 

>From the PostgreSQL side, yes, to reclaim fully the space, VACUUM FULL would
be necessary.

If you think you'll get back up to that size, and you can afford the memory,
bump of the FSM parameters, 
and run a lazy vacuum, (VACUUM), and the space will be reused eventually. 


> Thanks for the help as always Paul.

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 512-248-2683                 E-Mail: [email protected]
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893

Reply via email to