**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 :(
global_context->setCurrentQueryId(""
        // Generate a new query_id
        fformat : query_id_formats)
        {
            writeString(query_id_format.first, std_out
            writeString(fmt::format(query_id_format.second, fmt::arg("query_id", global_context->getCurrentQueryId())), std_out
            writeChar('\n', std_out
            std_out.next(
        }
    }
    processed_rows = 0;
    written_first_block = false;
    progress_indication.resetProgress(
    profile_events.watch.restart(
    {
        /// Temporarily apply query settings to context.
        std::optional<Settings> old_settings;
        SCOPE_EXIT_SAFE({
            if (old_settings)
                global_context->setSettings(*old_settings
        }
        auto apply_query_settings = [&](const IAST & settings_ast)
        {
            if (!old_settings)
                old_settings.emplace(global_context->getSettingsRef()
            global_context->applySettingsChanges(settings_ast.as<ASTSetQuery>()->changes
        };
        const auto * insert = parsed_query->as<ASTInsertQuery>(
        if (insert && insert->settings_ast)
            apply_query_settings(*insert->settings_ast