Share via

Azure Database Size Differs from pg_database_size

Eric 61 Reputation points
Feb 4, 2022, 1:21 PM

Hello, we are on Azure Hyperscale (Citus) or Azure for PostgreSQL.

In the Azure Portal, it says our database size is 8GB, while pg_database_size in postgresql shows a reading of 128MB. The latter seems far more correct as we hardly have any data in the database -- we just launched.

Why does the Azure Portal show 8GB (and quickly growing)? Is this due to backups? Will we need to upgrade the storage size when it reaches 128GB (our current limit)? (At this rate, it will in a month or two).

Thank you.

Azure Database for PostgreSQL
0 comments No comments
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 29,517 Reputation points Microsoft Employee
    Feb 23, 2022, 11:46 PM

    Hi, @Eric I see your issue is now resolved using support ticket: our internal product group analyze the issue, and this is partly because of an issue we had with our log rotate, recently. The server is fixed now, and the global fix is being deployed at the moment.

    Thank you for visiting Microsoft QA forums! Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    Regards
    Geetha

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,517 Reputation points Microsoft Employee
    Feb 4, 2022, 6:46 PM

    Hi, @Eric Welcome to Microsoft Q&A, Thanks for posting your query.
    As we understand the ask here is your DB size is 8GB and your Postgres database size is 128 MB and why the difference is. Please correct me if that's not accurate.

    If 8GB is the storage used on your Hyperscale (Citus), it’s how much total space is used on that node.
    Total used storage depends on a number of factors. How intense are writes in your workload and what is your data retention are among those factors

    We recommend setting alerts for storage on all nodes so that you’re notified when storage used % hits a certain threshold, e.g. 85%.

    What to do when storage is approaching 100% depends on their situation/workload. Generally speaking, there are a few options:

    1. Drop some data (one-time action) and/or review your data retention policy, i.e. how much data is ingested vs how much is dropped at what interval.
    2. Increase storage on the node.
    3. Add worker node(s) and rebalance shards to spread data on the new node(s).

    Regards
    Geetha


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.