Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

perf: decrease the threshold in which we use the BQ Storage Read API - #1925

Merged
tswast merged 4 commits into
mainfrom
tswast-perf-bqstorage
May 21, 2024
Merged

perf: decrease the threshold in which we use the BQ Storage Read API#1925
tswast merged 4 commits into
mainfrom
tswast-perf-bqstorage

Conversation

@tswast

@tswast tswast commented May 21, 2024

Copy link
Copy Markdown
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> 🦕

@tswast
tswast requested review from a team and Neenu1995 May 21, 2024 16:28
@product-auto-label product-auto-label Bot added size: xs Pull request size is extra small. api: bigquery Issues related to the googleapis/python-bigquery API. labels May 21, 2024
@product-auto-label product-auto-label Bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels May 21, 2024
Comment thread google/cloud/bigquery/table.py Outdated
# In microbenchmarks, the first full page will be about 10 MB. If a page is
# about 2 MB, then it's the same speed or faster to download all the results
# using the BigQuery Storage Read API.
ALMOST_COMPLETELY_CACHED_RATIO = 10 / (10 + 2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure I'm following the comment. In usage this appears to be a row ratio, but the comment is about response wire sizes? Also, should the value just remain a float literal? There's no parameter plugging in here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment to explain more my methodology. Unfortunately, this heuristic isn't perfect, as it breaks down with large rows.

@shollyman shollyman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarifications

@tswast
tswast merged commit eaa1a52 into main May 21, 2024
@tswast
tswast deleted the tswast-perf-bqstorage branch May 21, 2024 20:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants