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

Add function cbdb_relation_size #428

Merged
merged 4 commits into from
May 13, 2024
Merged

Conversation

fanfuxiaoran
Copy link
Contributor

It can be used to fetch the size of a batch
of relations as below

SELECT * FROM
cbdb_relation_size((SELECT array_agg(oid) FROM pg_class));

it has better perfomance than pg_relation_size
in such case, more details see the comment on
the function

fix #ISSUE_Number


Change logs

Describe your change clearly, including what problem is being solved or what feature is being added.

If it has some breaking backward or forward compatibility, please clary.

Why are the changes needed?

Describe why the changes are necessary.

Does this PR introduce any user-facing change?

If yes, please clarify the previous behavior and the change this PR proposes.

How was this patch tested?

Please detail how the changes were tested, including manual tests and any relevant unit or integration tests.

Contributor's Checklist

Here are some reminders and checklists before/when submitting your pull request, please check them:

  • Make sure your Pull Request has a clear title and commit message. You can take git-commit template as a reference.
  • Sign the Contributor License Agreement as prompted for your first-time contribution(One-time setup).
  • Learn the coding contribution guide, including our code conventions, workflow and more.
  • List your communication in the GitHub Issues or Discussions (if has or needed).
  • Document changes.
  • Add tests for the change
  • Pass make installcheck
  • Pass make -C src/test installcheck-cbdb-parallel
  • Feel free to request cloudberrydb/dev team for review and approval when your PR is ready🥳

It can be used to fetch the size of a batch
of relations as below

SELECT * FROM
cbdb_relation_size((SELECT array_agg(oid) FROM pg_class));

it has better perfomance than pg_relation_size
in such case, more details see the comment on
the function
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Xiaoran Wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hiiii, @fanfuxiaoran welcome!🎊 Thanks for taking the effort to make our project better! 🙌 Keep making such awesome contributions!

src/backend/utils/adt/dbsize.c Show resolved Hide resolved
src/backend/utils/adt/dbsize.c Show resolved Hide resolved
Xiaoran Wang added 3 commits May 10, 2024 10:21
And move getting forkNumber into SRF_IS_FIRSTCALL
to avoid warning.
@my-ship-it my-ship-it merged commit 27dc124 into apache:main May 13, 2024
9 of 10 checks passed
@fanfuxiaoran fanfuxiaoran deleted the dbsize branch May 13, 2024 02:50
foreyes pushed a commit to foreyes/cloudberrydb that referenced this pull request Jul 8, 2024
Add function cbdb_relation_size

It can be used to fetch the size of a batch of relations as below

SELECT * FROM
cbdb_relation_size((SELECT array_agg(oid) FROM pg_class));

It has better performance than pg_relation_size in such case, more details
see the comment on the function

Co-authored-by: Xiaoran Wang <wangxiaoran@hashdata.cn>
(cherry picked from commit 27dc124)
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