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

Reduce memory usage when indexing Hypercore TAM #7793

Merged

Conversation

erimatnor
Copy link
Contributor

@erimatnor erimatnor commented Mar 5, 2025

When building indexes over a table using Hypercore TAM, some memory for decompressing data wasn't released until the index build completes. This change optimizes the memory usage during index builds to release memory after every compressed batch has been processed.

Disable-check: force-changelog-file

When building indexes over a table using Hypercore TAM, some memory
for decompressing data wasn't released until the index build
completes. This change optimizes the memory usage during index builds
to release memory after every compressed batch has been processed.
Comment on lines -2914 to +2918
memset(slot->tts_isnull, true, sizeof(bool) * slot->tts_tupleDescriptor->natts);
MemSet(slot->tts_isnull, true, sizeof(bool) * slot->tts_tupleDescriptor->natts);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: PG uses memset as often as MemSet. I think you can stick to memset since most compilers recognize it and can optimize it.

@erimatnor erimatnor added this to the v2.19.0 milestone Mar 5, 2025
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 81.90%. Comparing base (59f50f2) to head (c16bd7e).
Report is 805 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/hypercore/hypercore_handler.c 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7793      +/-   ##
==========================================
+ Coverage   80.06%   81.90%   +1.83%     
==========================================
  Files         190      247      +57     
  Lines       37181    45459    +8278     
  Branches     9450    11368    +1918     
==========================================
+ Hits        29770    37233    +7463     
- Misses       2997     3749     +752     
- Partials     4414     4477      +63     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@erimatnor erimatnor marked this pull request as ready for review March 5, 2025 16:12
@github-actions github-actions bot requested review from antekresic and gayyappan March 5, 2025 16:13
Copy link

github-actions bot commented Mar 5, 2025

@gayyappan, @antekresic: please review this pull request.

Powered by pull-review

@erimatnor erimatnor enabled auto-merge (rebase) March 5, 2025 16:37
@erimatnor erimatnor merged commit b3ff0c5 into timescale:main Mar 5, 2025
58 of 60 checks passed
@mkindahl mkindahl added the bug label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants