Table of Contents

VPOP3 Database Size

The VPOP3 directory is stored in the VPOP3\pgsql\data folder and subfolders.

If you are concerned about the size of the VPOP3 database, there are several factors which may make the database larger than you would expect:

A better way of seeing how much space is REALLY used by the data is to look at the size of the daily backups. Usually these will be much more stable in size. The backups do not contain the 'free space' or the database indexes. Depending on your settings, the backups may still grow, even if the amount of messages stays the same. This is because the data for the spam filter statistical analyser, historical logging, archived messages etc may still be increasing. Note that the daily backups are usually compressed so will typically be about half the size of the uncompressed data.

Seeing where the data is being used

If you are still confused about why there is so much data, the first place to look is to see which database tables are using the most space.

To do this, go to the Settings -> DatabaseQuery tab in the VPOP3 settings, and put the following query in the Query box, and press Do Query. This will show the biggest 20 tables in the database, and how much space they are occupying.

SELECT nspname || '.' || relname AS "relation", pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
  AND C.relkind <> 'i' AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 20;

Some of the tables which are commonly large are:

(Also, see http://wiki.postgresql.org/wiki/Disk_Usage )

Diagnostics logs

The PostgreSQL database stores diagnostics logs in the VPOP3\pgsql\data\pg_log folder. VPOP3 v6+ manages these log files, but PostgreSQL does not, so in older versions of VPOP3, more and more logs will appear over time. Usually these logs are small, so do not take up much space (eg on one of our busy servers, a year's worth of logs takes up about 36MB). It is safe to delete the files from this folder, but not from any other folder in the VPOP3\pgsql\data folder tree.