Skip to content

Preload current records#8

Merged
ghukill merged 2 commits into
mainfrom
preload-current-records
Oct 20, 2025
Merged

Preload current records#8
ghukill merged 2 commits into
mainfrom
preload-current-records

Conversation

@ghukill

@ghukill ghukill commented Oct 20, 2025

Copy link
Copy Markdown
Contributor

Purpose and background context

In a recent TDA PR, it now requires "opting in" to materialize metadata for current records when instantiating TIMDEXDataset. Most operations do not require current records, but this notebook is an exception where each query does utilize the current records.

As such, it makes sense to pay a load time + memory hit in the beginning to speed up queries once the notebook is fully loaded.

How can a reviewer manually see the effects of these changes?

Not much to see! The primary change is TIMDEXDataset(<location>, preload_current_records=True) which is covered in the TDA PR.

Running locally, confirms that queries are generally 2-3x times faster by preloading the current records metadata.

Includes new or updated dependencies?

YES

Changes expectations for external applications?

NO

What are the relevant tickets?

  • None

Why these changes are being introduced:

This notebook makes heavy use of current records in the TIMDEX dataset,
specifically for alma.  TDA was updated to lazy load current records as
a view by default given the somewhat infrequent use, but does allow for
"preloading" the current records as a materialized table for repeated
queries, which is precisely what this notebook does.

How this addresses that need:
* Instantiates TIMDEXDataset with `preload_current_records=True` which
loads current records into memory to speed up queries thereafter.

Side effects of this change:
* None

Relevant ticket(s):
* None
@ghukill ghukill marked this pull request as ready for review October 20, 2025 14:28
@ghukill ghukill requested a review from a team as a code owner October 20, 2025 14:28
Comment thread tag_export.py
timdex_dataset = TIMDEXDataset(os.environ["TIMDEX_DATASET_LOCATION"])
timdex_dataset = TIMDEXDataset(
os.environ["TIMDEX_DATASET_LOCATION"],
preload_current_records=True,

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.

This is really the only meaningful change!

@ghukill ghukill merged commit 641dc2d into main Oct 20, 2025
2 checks passed
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.

2 participants