This commit is contained in:
kssenii 2023-04-21 12:26:28 +02:00
parent 88784568dc
commit 0ccc3afe74
2 changed files with 3 additions and 3 deletions

View File

@ -139,7 +139,7 @@ void AsynchronousReadIndirectBufferFromRemoteFS::prefetch(int64_t priority)
last_prefetch_info.priority = priority; last_prefetch_info.priority = priority;
/// Prefetch even in case hasPendingData() == true. /// Prefetch even in case hasPendingData() == true.
chassert(prefetch_buffer.size() == read_settings.prefetch_buffer_size); chassert(prefetch_buffer.size() == read_settings.prefetch_buffer_size || prefetch_buffer.size() == read_settings.remote_fs_buffer_size);
prefetch_future = asyncReadInto(prefetch_buffer.data(), prefetch_buffer.size(), priority); prefetch_future = asyncReadInto(prefetch_buffer.data(), prefetch_buffer.size(), priority);
ProfileEvents::increment(ProfileEvents::RemoteFSPrefetches); ProfileEvents::increment(ProfileEvents::RemoteFSPrefetches);
} }
@ -224,7 +224,7 @@ bool AsynchronousReadIndirectBufferFromRemoteFS::nextImpl()
{ {
ProfileEventTimeIncrement<Microseconds> watch(ProfileEvents::SynchronousRemoteReadWaitMicroseconds); ProfileEventTimeIncrement<Microseconds> watch(ProfileEvents::SynchronousRemoteReadWaitMicroseconds);
chassert(memory.size() == read_settings.remote_fs_buffer_size); chassert(memory.size() == read_settings.prefetch_buffer_size || memory.size() == read_settings.remote_fs_buffer_size);
std::tie(size, offset) = impl->readInto(memory.data(), memory.size(), file_offset_of_buffer_end, bytes_to_ignore); std::tie(size, offset) = impl->readInto(memory.data(), memory.size(), file_offset_of_buffer_end, bytes_to_ignore);
bytes_to_ignore = 0; bytes_to_ignore = 0;

View File

@ -350,7 +350,7 @@ MergeTreePrefetchedReadPool::PartsInfos MergeTreePrefetchedReadPool::getPartsInf
/// while in adjustBufferSize it will be presize. /// while in adjustBufferSize it will be presize.
for (const auto & col : task_columns.columns) for (const auto & col : task_columns.columns)
{ {
const auto col_size = part.data_part->getColumnSize(col.name).data_uncompressed; const auto col_size = part.data_part->getColumnSize(col.name).data_compressed;
part_info->estimated_memory_usage_for_single_prefetch += std::min<size_t>(col_size, settings.prefetch_buffer_size); part_info->estimated_memory_usage_for_single_prefetch += std::min<size_t>(col_size, settings.prefetch_buffer_size);
++part_info->required_readers_num; ++part_info->required_readers_num;
} }