# Performance\_schema needs maintenance?

**URL:** <https://forums.percona.com/t/performance-schema-needs-maintenance/20001>\
**Category:** MySQL & MariaDB\
**Created:** [February 9, 2023, 9:39pm UTC](https://forums.percona.com/t/performance-schema-needs-maintenance/20001 "2023-02-09T21:39:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkat](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/venkat/32/5328_2.png) [@Venkat](https://forums.percona.com/u/Venkat)\
**Post date:** [February 9, 2023, 9:39pm UTC](https://forums.percona.com/t/performance-schema-needs-maintenance/20001/1 "2023-02-09T21:39:32Z")

</div>

We are on Aurora MySQL. Interestingly the performance\_schema queries show high number of rows examined on this one. So the question is, is there any truncation that we need to do periodically? There is ps\_truncate\_all\_tables but it’s only to reset the values and not really reduce rows.This shows 22.540 rows examined and 22,409 rows sent with an average latency of 58ms. This is all managed via performance\_insight (system managed).

SELECT `performance_schema` . `events_statements_history` . `SQL_TEXT` , `performance_schema` . `events_statements_history` . `DIGEST` , `performance_schema` . `events_statements_history` . `CURRENT_SCHEMA` FROM `performance_schema` . `events_statements_history` WHERE `DIGEST` IS NOT NULL AND `SQL_TEXT` IS NOT NULL

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [February 10, 2023, 3:18am UTC](https://forums.percona.com/t/performance-schema-needs-maintenance/20001/2 "2023-02-10T03:18:47Z")

</div>

The performance\_schema does not need maintenance. The p\_s has built-in limits for memory and once those are crossed, older data will automatically be purged. This query comes from AWS itself in order to gather query examples.
