**Describe the situation**

```
SELECT * FROM test.hits INTO OUTFILE 'dump.csv' FORMAT CSV

8873898 rows in set. Elapsed: 32.487 sec. Processed 8.87 million rows, 8.46 GB (273.15 thousand rows/s., 260.42 MB/s.)
```

is bounded by single CPU core. Too slow :(
String pager = config().getString("pager", ""
        if (!pager.empty())
        {
            signal(SIGPIPE, SIG_IGN
            ShellCommand::Config config(pager
            config.pipe_stdin_only = true;
            pager_cmd = ShellCommand::execute(config
            out_buf = &pager_cmd->in;
        }
        else
        {
            out_buf = &std_out;
        }
        String current_format = format;
        /// The query can specify output format or output file.
        /// FIXME: try to prettify this cast using `as<>()`
        if (const auto * query_with_output = dynamic_cast<const ASTQueryWithOutput *>(parsed_query.get()))
        {
            if (query_with_output->out_file)
            {
                const auto & out_file_node = query_with_output->out_file->as<ASTLiteral &>(
                const auto & out_file = out_file_node.value.safeGet<std::string>(
                std::string compression_method;
                if (query_with_output->compression)
                {
                    const auto & compression_method_node = query_with_output->compression->as<ASTLiteral &>(
                    compression_method = compression_method_node.value.safeGet<std::string>(
                }
                out_file_buf = wrapWriteBufferWithCompressionMethod(
                    std::make_unique<WriteBufferFromFile>(out_file, DBMS_DEFAULT_BUFFER_SIZE, O_WRONLY | O_EXCL | O_CREAT),