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

Use data inheritance from VirtualTupleTableSlot in compressed batch #6615

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

akuzm
Copy link
Member

@akuzm akuzm commented Feb 7, 2024

This simplifies passing the columnar data out of the DecompressChunk to Vectorized Aggregation node which we plan to implement. Also this should improve memory locality and bring us closer to the architecture used in TAM for ArrowTupleSlot.

Disable-check: force-changelog-file

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (59f50f2) 80.06% compared to head (af72722) 81.47%.
Report is 15 commits behind head on main.

Files Patch % Lines
tsl/src/nodes/decompress_chunk/compressed_batch.c 79.36% 0 Missing and 13 partials ⚠️
tsl/src/nodes/decompress_chunk/batch_queue_heap.c 61.53% 0 Missing and 5 partials ⚠️
tsl/src/nodes/decompress_chunk/compressed_batch.h 57.14% 0 Missing and 3 partials ⚠️
tsl/src/nodes/decompress_chunk/batch_array.c 66.66% 0 Missing and 1 partial ⚠️
tsl/src/nodes/decompress_chunk/batch_queue_fifo.h 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6615      +/-   ##
==========================================
+ Coverage   80.06%   81.47%   +1.41%     
==========================================
  Files         190      191       +1     
  Lines       37181    36418     -763     
  Branches     9450     9464      +14     
==========================================
- Hits        29770    29673      -97     
+ Misses       2997     2979      -18     
+ Partials     4414     3766     -648     

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

@akuzm akuzm marked this pull request as ready for review February 12, 2024 14:20
Copy link

@mahipv, @jnidzwetzki: please review this pull request.

Powered by pull-review

@akuzm akuzm changed the title Reduce indirections in compressed batch Use data inheritance from VirtualTupleTableSlot in compressed batch Feb 12, 2024
Copy link
Contributor

@jnidzwetzki jnidzwetzki left a comment

Choose a reason for hiding this comment

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

Overall it looks good. Could you add some comments to the used functions (e.g., compressed_batch_lazy_init, compressed_batch_current_tuple) before merging?

In addition, it might be good to add a comment and document how the base pointer of the VirtualTupleTableSlot is used to make this understandable without knowing this PR.

batch_state->compressed_slot =
MakeSingleTupleTableSlot(dcontext->compressed_slot_tdesc, compressed_slot->tts_ops);

/* Get a reference the the output TupleTableSlot */
Copy link
Contributor

Choose a reason for hiding this comment

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

typo "the the"

@@ -700,7 +750,7 @@ compressed_batch_set_compressed_tuple(DecompressContext *dcontext,
* columns. This can be improved by only decompressing the columns
* needed for sorting.
*/
batch_state->next_batch_row = batch_state->total_batch_rows;
compressed_batch_discard_tuples(batch_state);
Copy link
Contributor

Choose a reason for hiding this comment

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

does this mean that earlier there was a memory leak here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think no, the memory context and tuple slots would be reset when the next compressed tuple arrived.

Copy link
Contributor

@nikkhils nikkhils left a comment

Choose a reason for hiding this comment

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

LGTM.

This simplifies passing the columnar data out of the DecompressChunk to
Vectorized Aggregation node which we plan to implement. Also this should
improve memory locality and bring us closer to the architecture used in
TAM for ArrowTupleSlot.
@akuzm akuzm enabled auto-merge (squash) February 19, 2024 16:04
@akuzm akuzm merged commit e978619 into timescale:main Feb 19, 2024
42 of 43 checks passed
@akuzm akuzm deleted the batch-layout branch February 19, 2024 16:18
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.

None yet

3 participants