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

DM-48288: Do not enable caching context by default in queries #1138

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Jan 3, 2025

We no longer implicitly enable the caching context by default when entering the Butler.query() context manager. More often than not, the context manager is used to execute one query and then exited. The cache is often a pessimization in this common case -- notably the collection summary cache was often fetching tens of thousands of records when only a few were needed.

Added explicit caching context enables in a few places that were previously benefitting from caching being enabled by default.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes
  • (if changing dimensions.yaml) make a copy of dimensions.yaml in configs/old_dimensions

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 89.13043% with 5 lines in your changes missing coverage. Please review.

Project coverage is 89.50%. Comparing base (1ba37b0) to head (bc14e25).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
python/lsst/daf/butler/_query_all_datasets.py 85.71% 1 Missing and 1 partial ⚠️
...on/lsst/daf/butler/direct_butler/_direct_butler.py 80.00% 1 Missing and 1 partial ⚠️
python/lsst/daf/butler/script/removeRuns.py 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1138   +/-   ##
=======================================
  Coverage   89.50%   89.50%           
=======================================
  Files         366      366           
  Lines       48998    49000    +2     
  Branches     5943     5943           
=======================================
+ Hits        43855    43858    +3     
+ Misses       3729     3728    -1     
  Partials     1414     1414           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We no longer implicitly enable the caching context by default when entering the Butler.query() context manager.  More often than not, the context manager is used to execute one query and then exited.  The cache is often a pessimization in this common case -- notably the collection summary cache was often fetching tens of thousands of records when only a few were needed.

Added explicit caching context enables in a few places that were previously benefitting from caching being enabled by default.
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.

1 participant