8000 feat: view database size by williamrusdyputra · Pull Request #954 · trufnetwork/node · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: view database size #954

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

Merged
merged 2 commits into from
May 29, 2025
Merged

feat: view database size #954

merged 2 commits into from
May 29, 2025

Conversation

williamrusdyputra
Copy link
Contributor
@williamrusdyputra williamrusdyputra commented May 29, 2025

Related Problem

resolves: https://github.com/trufnetwork/truf-network/issues/515

How Has This Been Tested?

Screenshot 2025-05-29 at 20 18 15 Screenshot 2025-05-29 at 20 18 29

streams: 1 × (128 + 100) = 228
metadata: 5 × (230 + 48 + 100) = 5 × 378 = 1890
Total = 228 + 1890 = 2118 bytes


Screenshot 2025-05-29 at 21 26 10

@williamrusdyputra williamrusdyputra self-assigned this May 29, 2025
@williamrusdyputra williamrusdyputra requested a review from MicBun May 29, 2025 13:24
Copy link
pr-time-tracker bot commented May 29, 2025

Time Submission Status

Member Status Time Action Last Update
williamrusdyputra ✅ Submitted 1h Update time May 29, 2025, 2:32 PM
MicBun ✅ Submitted 30min Update time May 30, 2025, 3:08 AM

@MicBun MicBun requested a review from outerlook May 29, 2025 13:36
@MicBun
Copy link
Member
MicBun commented May 29, 2025

Looks good to me. Could you add test too?
@williamrusdyputra

cc @outerlook

@williamrusdyputra
Copy link
Contributor Author

@MicBun done
Screenshot 2025-05-29 at 21 26 10

@MicBun MicBun merged commit 7088475 into main May 29, 2025
7 of 8 checks passed
@MicBun MicBun deleted the feat/get-database-size branch May 29, 2025 14:32
@outerlook
Copy link
Contributor
outerlook commented May 29, 2025

Hey @MicBun @williamrusdyputra

I'll just leave a note about performance on this method;

I'll check if it's still true, but postgres does full table scans to yield count responses, so this means going through every row of our DB each time this is queried

Doesn't mean that this isn't the best for now, but it's good to ensure we don't query too much without good caches

It all depends on how much data we have, but recently is growing a lot

Please react if you read so I know it's ok

@williamrusdyputra
Copy link
Contributor Author

@outerlook

yes, this will be a temporary solution until we figure out how to extend 'pg' functions such as 'pg_database_size'.

for now, this query will run only once a day during midnight UTC, just to keep a record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0