databend icon indicating copy to clipboard operation
databend copied to clipboard

How did we implement parallel reading by threads in 0.8 new version?

Open jackjoesh opened this issue 3 years ago • 4 comments

Do we support parallel read by threads? I can't see the parallel_read_threads in the settings of new version. And I have found this issue: https://github.com/datafuselabs/databend/pull/4480 How did we implemented parallel reading by threads now?

jackjoesh avatar Sep 01 '22 08:09 jackjoesh

Forward @dantengsky to give more information about this question :)

bohutang avatar Sep 01 '22 08:09 bohutang

the setting of max_threads is used instead

https://github.com/datafuselabs/databend/blob/97c51b5ea3d1c1e49b154c8d80307e408bd4c12f/src/query/storages/fuse/src/operations/read.rs#L129-L148

we can tweak this setting at runtime, for example

set max_threads=1;
select ... from ...;

dantengsky avatar Sep 05 '22 11:09 dantengsky

the setting of max_threads is used instead

https://github.com/datafuselabs/databend/blob/97c51b5ea3d1c1e49b154c8d80307e408bd4c12f/src/query/storages/fuse/src/operations/read.rs#L129-L148

we can tweak this setting at runtime, for example

set max_threads=1;
select ... from ...;

Thank you for your reply. In addition, I would like to ask. It was originally supported to set more than the number of queries and then go to distributed query. Is this parameter still available? Where can it be set?

jackjoesh avatar Sep 07 '22 06:09 jackjoesh

we must set num_cpus in databend-query.toml not max_threads, this seems confusing for me.

        {
            // Set max threads.
            let cpus = if conf.query.num_cpus == 0 {
                num_cpus::get() as u64
            } else {
                conf.query.num_cpus
            };
            ret.set_max_threads(cpus)?;
        }

FANNG1 avatar Sep 07 '22 09:09 FANNG1