# لماذا حجم discourse postgres\_data كبير جدًا؟

**URL:** https://meta.discourse.org/t/why-my-discourse-postgres-data-is-too-big/91657
**Category:** Self-hosting
**Created:** [5 يوليو 2018، 8:54م UTC](https://meta.discourse.org/t/why-my-discourse-postgres-data-is-too-big/91657 "2018-07-05T20:54:31Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [6 يوليو 2018، 12:09ص UTC](https://meta.discourse.org/t/why-my-discourse-postgres-data-is-too-big/91657/5 "2018-07-06T00:09:11Z")

</div>

You can run the following commands to see which tables are taking up the most disk space

```plaintext
./launcher enter app
su - postgres
psql discourse

```

```plaintext
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;

```

---

_[View the full topic](https://meta.discourse.org/t/why-my-discourse-postgres-data-is-too-big/91657)._
