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

[Feedback] Page: /api/latest/continuous-aggregates/hypertable_detailed_size/ #2392

Closed
Solomon-Hill opened this issue May 19, 2023 · 4 comments
Labels
community Raised by a community member documentation Improvements or additions to documentation feedback Submissions from the docs site feedback form

Comments

@Solomon-Hill
Copy link

Is it easy to find the information you need?

None

Are the instructions clear?

None

How could we improve the Timescale documentation site?

incorrect info, the functions hypertable_size & hypertable_detailed_size return null when run against a CA. which is very annoying

@Solomon-Hill Solomon-Hill added community Raised by a community member documentation Improvements or additions to documentation feedback Submissions from the docs site feedback form labels May 19, 2023
@github-actions
Copy link

Thank you for the report. We welcome documentation contributions!

  • For information about how to propose a change, see the contributing guide in our GitHub repository.
  • For information on style and word usage, see the style guide

@Loquacity
Copy link
Contributor

@jonatas can you help here?

@jonatas
Copy link
Contributor

jonatas commented Jun 22, 2023

Hi @Solomon-Hill, I know what you mean.

@Loquacity I'll create a brief explanation of how to get it and let's move on to improve our docs based on this info.

The problem is that internally, we have different tables to store information about continuous aggregates and hypertables.

For some reason we have both api docs for continuous-aggregates/hypertable_detailed_size/ and hypertable/hypertable_detailed_size/ but we don't have too functions.

In the continuous_aggregates page we should show people how to create a function for it:

CREATE OR REPLACE FUNCTION caggs_detailed_size(p_view_name TEXT, p_view_schema TEXT default 'public')
RETURNS TABLE(table_bytes bigint, index_bytes bigint, toast_bytes bigint, total_bytes bigint, node_name name)
AS $$
DECLARE
  v_hypertable_name TEXT;
  v_schema_name TEXT;
BEGIN
  SELECT cagg.hypertable_name, cagg.hypertable_schema
  INTO v_hypertable_name, v_schema_name
  FROM timescaledb_information.continuous_aggregates cagg
  WHERE cagg.view_name = p_view_name
  AND   cagg.view_schema = p_view_schema;

  RETURN QUERY
  SELECT * FROM hypertable_detailed_size(v_schema_name || '.' || v_hypertable_name);
END;
$$ LANGUAGE plpgsql;

Maybe we should also make the official function works with both types of arguments ?

@jonatas
Copy link
Contributor

jonatas commented Jun 22, 2023

@noctarius solved the issue on 2.10 🎉

timescale/timescaledb#5159

@jonatas jonatas closed this as completed Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Raised by a community member documentation Improvements or additions to documentation feedback Submissions from the docs site feedback form
Projects
None yet
Development

No branches or pull requests

3 participants