Skip to content

Commit

Permalink
Compact memory layout for DMFileReader; sizeof(DMFileReader) 432 -> 416
Browse files Browse the repository at this point in the history
  • Loading branch information
JaySon-Huang committed Mar 24, 2022
1 parent a734697 commit 814e955
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions dbms/src/Storages/DeltaMerge/File/DMFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,18 @@ DMFileReader::DMFileReader(
const DB::LoggerPtr & tracing_logger)
: dmfile(dmfile_)
, read_columns(read_columns_)
, is_common_handle(is_common_handle_)
, read_one_pack_every_time(read_one_pack_every_time_)
, single_file_mode(dmfile_->isSingleFileMode())
, enable_clean_read(enable_clean_read_)
, max_read_version(max_read_version_)
, pack_filter(std::move(pack_filter_))
, is_common_handle(is_common_handle_)
, skip_packs_by_column(read_columns.size(), 0)
, mark_cache(mark_cache_)
, enable_column_cache(enable_column_cache_ && column_cache_)
, column_cache(column_cache_)
, rows_threshold_per_read(rows_threshold_per_read_)
, file_provider(file_provider_)
, read_one_pack_every_time(read_one_pack_every_time_)
, single_file_mode(dmfile_->isSingleFileMode())
, log(tracing_logger ? tracing_logger : DB::Logger::get("DMFileReader"))
{
for (const auto & cd : read_columns)
Expand Down
14 changes: 7 additions & 7 deletions dbms/src/Storages/DeltaMerge/File/DMFileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ class DMFileReader
ColumnDefines read_columns;
ColumnStreams column_streams;

const bool is_common_handle;

// read_one_pack_every_time is used to create info for every pack
const bool read_one_pack_every_time;

const bool single_file_mode;

/// Clean read optimize
// If there is no delta for some packs in stable, we can try to do clean read.
const bool enable_clean_read;
Expand All @@ -122,8 +129,6 @@ class DMFileReader
/// Filters
DMFilePackFilter pack_filter;

const bool is_common_handle;

std::vector<size_t> skip_packs_by_column;

/// Caches
Expand All @@ -137,11 +142,6 @@ class DMFileReader

FileProviderPtr file_provider;

// read_one_pack_every_time is used to create info for every pack
const bool read_one_pack_every_time;

const bool single_file_mode;

DB::LoggerPtr log;
};

Expand Down

0 comments on commit 814e955

Please sign in to comment.