This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
reference:reset_message_folder_counts [2014/11/19 12:53] – paul | reference:reset_message_folder_counts [2018/11/14 10:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
======Reset Message Folder Counts====== | ======Reset Message Folder Counts====== | ||
- | In extremely rare cases, the message | + | In extremely rare cases, the mail folder |
- | Before running the query below you will need to stop VPOP3. Note that running it will take some time, depending on the size of the database and the performance of the database | + | **Before running the query below you will need to stop VPOP3**. Note that running it will take some time, depending on the size of the database and the performance of the VPOP3 server, and there is no progress indicator for database queries. |
At a command prompt in the VPOP3 directory run | At a command prompt in the VPOP3 directory run | ||
Line 12: | Line 12: | ||
Then, type | Then, type | ||
- | with ff as (select folderid, | + | with ff as (select folderid, |
sum(case when newflag then 1 else 0 end) as newcnt, | sum(case when newflag then 1 else 0 end) as newcnt, | ||
- | | + | |
- | sum(case when hold then 1 else 0 end) as holdcnt from | + | sum(case when hold then 1 else 0 end) as holdcnt from messages.folders left join |
- | messages.foldermessages inner join messages.msgdata using(msgdataid) where deletedtime is null group by folderid) | + | |
- | update messages.folders f set msgcount=ff.cnt, | + | |
- | | + | update messages.folders f set msgcount=ff.cnt, |
+ | | ||
| | ||
(Copy and paste if possible!) | (Copy and paste if possible!) | ||
+ | |||
+ | N.B. VPOP3 **does** need to be stopped while you do this |