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

fix: adjust the max io requests with block number not segment number #8367

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions src/query/storages/fuse/src/operations/read_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,6 @@ impl FuseTable {
})
}

// Adjust the max io request.
fn adjust_max_io_requests(
ctx: Arc<dyn TableContext>,
plan: &ReadDataSourcePlan,
) -> Result<usize> {
let parts_len = plan.parts.len();
let max_storage_io = ctx.get_settings().get_max_storage_io_requests()? as usize;
let max_io_requests = if parts_len > max_storage_io {
max_storage_io
} else {
parts_len
};

Ok(std::cmp::max(1, max_io_requests))
}

#[inline]
pub fn do_read_data(
&self,
Expand Down Expand Up @@ -204,7 +188,7 @@ impl FuseTable {
let prewhere_filter = self.build_prewhere_filter_executor(ctx.clone(), plan)?;
let remain_reader = self.build_remain_reader(plan)?;

let max_io_requests = Self::adjust_max_io_requests(ctx.clone(), plan)?;
let max_io_requests = ctx.get_settings().get_max_storage_io_requests()? as usize;
info!("read block data adjust max io requests:{}", max_io_requests);

// Add source pipe.
Expand Down