**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 :(
/// Replace ASTQueryParameter with ASTLiteral for prepared statements.
        ReplaceQueryParameterVisitor visitor(query_parameters
        visitor.visit(parsed_query
        /// Get new query after substitutions. Note that it cannot be done for INSERT query with embedded data.
        query = serializeAST(*parsed_query
    }
    int retries_left = 10;
    while (retries_left)
    {
        try
        {
            connection->sendQuery(
                connection_parameters.timeouts,
                query,
                global_context->getCurrentQueryId(),
                query_processing_stage,
                &global_context->getSettingsRef(),
                &global_context->getClientInfo(),
                true
            if (send_external_tables)
                sendExternalTables(parsed_query
            receiveResult(parsed_query
            break;
        }
        catch (const Exception & e)
        {
            /// Retry when the server said "Client should retry" and no rows
            /// has been received yet.
             && e.code() == ErrorCodes::DEADLOCK_AVOIDED && --retries_left)
            {