Database size/maintenance

I’m trying to find out if database size used by Discourse is somehow reasonable and if there’s room for optimization. Space used on the disk is currently at 120GB and these are the biggest tables.

              relation              | total_size
------------------------------------+------------
 public.post_timings                | 64 GB
 public.posts                       | 8685 MB
 public.user_auth_token_logs        | 8664 MB
 public.topic_views                 | 8105 MB
 public.user_visits                 | 8027 MB
 public.post_search_data            | 3631 MB
 public.user_actions                | 2689 MB
 public.notifications               | 2355 MB
 public.topic_users                 | 2290 MB
 public.email_logs                  | 1524 MB
 public.incoming_links              | 1372 MB

I just wonder if this is a reasonable split of sizes. Not sure what post_timings does but I already read in some other threads that it’s taken up by far the most space.

Is there some kind of maintenance on the db that can and should be done manually?

1 Like

Timings is always the largest table, so that checks out.

If you are up to date on your updates, the last PostgreSQL version brings improvements to this area, but there is a small step you got to follow:

See “Re-creating the indexes” there.

2 Likes