Skip to content

perf: Add warning when using synthetic ordering on large table. #1524

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TrevorBergeron
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@TrevorBergeron TrevorBergeron added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 21, 2025
@TrevorBergeron TrevorBergeron requested a review from tswast March 21, 2025 19:57
@TrevorBergeron TrevorBergeron requested review from a team as code owners March 21, 2025 19:57
@@ -449,6 +450,20 @@ def read_gbq_table(
# if we don't have a unique index, we order by row hash if we are in strict mode
if self._force_total_order:
if not primary_key:
# 5gb chosen rather arbitrarily, mostly want to avoid warning for very small tables, for which the
# price is trivial
if (table.num_bytes or 0) > 5000000000:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Might be good to do a constant here or at least use _ as a 0 separator.

Suggested change
if (table.num_bytes or 0) > 5000000000:
if (table.num_bytes or 0) > 5_000_000_000:

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Mar 21, 2025
@GarrettWu GarrettWu removed their assignment Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants