-
Notifications
You must be signed in to change notification settings - Fork 411
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
Make fast scan code mode clean #6058
Changes from 4 commits
b2e7620
b0988f8
2be41bb
51ad9a3
a31ed93
b7a9a74
768f657
e360390
8a7274f
2afa87f
2a1be54
58ec367
4b2530e
0320e01
5898b5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,14 +100,35 @@ BlockInputStreamPtr SegmentReadTaskPool::buildInputStream(SegmentReadTaskPtr & t | |
MemoryTrackerSetter setter(true, mem_tracker.get()); | ||
auto seg = t->segment; | ||
BlockInputStreamPtr stream; | ||
if (is_raw) | ||
auto block_size = std::max(expected_block_size, static_cast<size_t>(dm_context->db_context.getSettingsRef().dt_segment_stable_pack_rows)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code in dbms/src/Storages/DeltaMerge/SegmentReadTaskPool.cpp L103-L131 is similar to dbms/src/Storages/DeltaMerge/DMSegmentThreadInputStream.h L103-L131. Maybe we can do some refactoring and make code reusable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I try to make a new function for L103-L131 to make code reusable, please take a look. |
||
switch (read_mode) | ||
{ | ||
stream = seg->getInputStreamRaw(*dm_context, columns_to_read, t->read_snapshot, t->ranges, filter, do_range_filter_for_raw); | ||
} | ||
else | ||
{ | ||
auto block_size = std::max(expected_block_size, static_cast<size_t>(dm_context->db_context.getSettingsRef().dt_segment_stable_pack_rows)); | ||
stream = seg->getInputStream(*dm_context, columns_to_read, t->read_snapshot, t->ranges, filter, max_version, block_size); | ||
case ReadMode::Normal: | ||
stream = seg->getInputStream( | ||
*dm_context, | ||
columns_to_read, | ||
t->read_snapshot, | ||
t->ranges, | ||
filter, | ||
max_version, | ||
block_size); | ||
break; | ||
case ReadMode::Fast: | ||
stream = seg->getInputStreamFast( | ||
*dm_context, | ||
columns_to_read, | ||
t->read_snapshot, | ||
t->ranges, | ||
filter, | ||
block_size); | ||
break; | ||
case ReadMode::Raw: | ||
stream = seg->getInputStreamRaw( | ||
*dm_context, | ||
columns_to_read, | ||
t->read_snapshot, | ||
t->ranges); | ||
break; | ||
} | ||
LOG_FMT_DEBUG(log, "getInputStream succ, pool_id={} segment_id={}", pool_id, seg->segmentId()); | ||
return stream; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very nice explanation!