# Managing very large tables

**URL:** https://discuss.tryton.org/t/managing-very-large-tables/4407
**Category:** System Administrator
**Created:** [July 12, 2021, 3:16pm UTC](https://discuss.tryton.org/t/managing-very-large-tables/4407 "2021-07-12T15:16:15Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [July 12, 2021, 5:00pm UTC](https://discuss.tryton.org/t/managing-very-large-tables/4407/6 "2021-07-12T17:00:40Z")

</div>

> [@msabater](#):
>
> The entire system slows down or just freezes. The problem is usually solved by recreating the container.

Which container? Tryton’s one?

As Cédric suggests it’d be good to ensure the problem is at PostgreSQL side.

Some recommendations & ideas:

In order to see the activity that is going on in PostgreSQL server I’d recommend [pg\_activity](https://pypi.org/project/pg-activity/).

We also always enable log\_min\_duration\_statement in all production servers so that all queries that take longer than a certain threshold will be logged. See: [PostgreSQL: Documentation: 17: 19.8.&nbsp;Error Reporting and Logging](https://www.postgresql.org/docs/current/runtime-config-logging.html), then you can grep + count the number of queries above that threshold to keep an eye to understand if the situation is improving.

Maybe you’re reaching a limit on the number of connections on uwsgi or proxy you’re using? That may explain the freeze?

Depending on the Tryton version you’re using it’d recommend moving to v6. There you’ll find trytond-stat for better understanding what’s going on. Also SAO has several improvements that hopefully will minimize some performance issues present in previous versions (at least until 5.4).

In larger databases, counters can also be a problem, see [Counters & performance](https://discuss.tryton.org/t/counters-performance/1206).

---

_[View the full topic](https://discuss.tryton.org/t/managing-very-large-tables/4407)._
