Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve retention policy documentation #880

Open
daniel1302 opened this issue Jan 11, 2024 · 0 comments
Open

Improve retention policy documentation #880

daniel1302 opened this issue Jan 11, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@daniel1302
Copy link
Contributor

daniel1302 commented Jan 11, 2024

Issue

People do not understand how to use retention policies in the data-node.

Some comments I shared with node operators

SQLStore.RetentionPeriod is a base/predefined retention policy. There are 3 options:

  • forever
  • standard
  • lite

I would recommend setting it up forever or at least standard, then you can adjust specific tables retention period:

  [[SQLStore.RetentionPolicies]]
    HypertableOrCaggName = "orders"
    DataRetentionPeriod = "30 days"

The orders table is the biggest table so far. It takes 90% of space in postgresql. In our archival nodes, We have 2.5TB of the data there.

See the screen, When I was experimenting with it some time ago.

image

You can use the following queries to obtain table sizes:

    SELECT
    table_name,
    table_bytes,
    index_bytes,
    toast_bytes,
    total_bytes
    FROM (
        SELECT
          pg_catalog.pg_namespace.nspname           AS schema_name,
          relname                                   AS table_name,
          (hypertable_detailed_size(pg_catalog.pg_class.oid)).*
        FROM pg_catalog.pg_class
          JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid
      ) t
    WHERE schema_name = 'public';
    SELECT
    table_name,
    size_bytes
    FROM (
        SELECT
          pg_catalog.pg_namespace.nspname           AS schema_name,
          relname                                   AS table_name,
          pg_relation_size(pg_catalog.pg_class.oid) AS size_bytes
        FROM pg_catalog.pg_class
          JOIN pg_catalog.pg_namespace ON relnamespace = pg_catalog.pg_namespace.oid
      ) t
    WHERE schema_name = 'public';
@vega-issues vega-issues added the documentation Improvements or additions to documentation label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: New
Development

No branches or pull requests

2 participants