[Yandex Cloud documentation](../../../index.md) > [Yandex MPP Analytics for PostgreSQL](../../index.md) > [Step-by-step guides](../index.md) > Extensions > gp_relaccess_stats

# Using gp_relaccess_stats in Yandex MPP Analytics for PostgreSQL

{% note warning %}

Apache Cloudberry™ does not support this extension.

{% endnote %}

`gp_relaccess_stats` is a Yandex Cloud extension that collects the access statistics for tables and views. It registers the read, insert, update, and delete operations, as well as the timestamp of the user's last access to the object. The collected data helps find unused or improperly used objects.

## Extension settings {#extension-settings}

| Configuration | Type | Default value | Description |
|-----------|-----|-----------------------|----------|
| `gp_relaccess_stats.enabled` | `bool` | `false` | Turns on the collection of statistics. You can enable this setting at the cluster or database level. We recommend the database level option. |
| `gp_relaccess_stats.max_tables` | `integer` | `65536` | Maximum number of tables for caching statistics. |
| `gp_relaccess_stats.dump_on_overflow` | `bool` | `false` | Decides the behavior if `gp_relaccess_stats.max_tables` is exceeded. If `true`, the statistics cache is automatically cleared via `relaccess_stats_dump()`. If `false`, you get a low-space warning. |

For more on the extension, see the [gp_relaccess_stats guide](https://github.com/open-gpdb/gp_relaccess_stats).

## Installing gp_relaccess_stats in a Yandex MPP Analytics for PostgreSQL cluster {#extension-install}

1. [Connect](../connect/index.md) to the database as the owner or a user with the `CREATE` permission in the database and run this command:

    ```sql
    CREATE EXTENSION gp_relaccess_stats;
    ```

1. Make sure the extension has been installed:

    ```sql
    SELECT extname FROM pg_extension;
    ```

    This will bring up the list of extensions installed in the database.

## Use cases {#examples}

1. Create a statistics collection table:

    ```sql
    SELECT relaccess_stats_init();
    ```

    The `relaccess_stats` table will get new empty entries for each table and partition of the selected database.

1. Update the statistics:

    ```sql
    SELECT relaccess_stats_update();
    ```

    The `relaccess_stats` table will now be populated with statistics from the cache and the `pg_stat` folder.

1. Check the current usage of the statistics cache:

    ```sql
    SELECT relaccess.relaccess_stats_fillfactor();
    ```

    This will show the statistics cache fill percentage.

1. Query the `relaccess_stats` table for statistical data:

    ```sql
    SELECT * FROM relaccess_stats;
    ```

_Apache® and Apache Cloudberry™ are registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries._