MySQL Forums
Forum List  »  Optimizer & Parser

Re: Is Union Queries run in Parallel form or not.
Posted by: Øystein Grøvlen
Date: October 19, 2017 03:02AM

Hi,
> I wan to ask that these queries run in parallel
> form or in order one by one ?

They will be run one by one. MySQL does only use one thread per connection.

> What can I do to increase the performance of this
> query. Can I create thread for each query ?

Only way to get one thread per query is to run each query in a separate connection. Note that this implies that the queries will run in different transactions, and possibly see a different set of concurrent updates.

> If I create three thread for this query with
> single connection is it work in parallel or not ?

Traditionally, a connection can only have one outstanding request at a time, so the queries can not be run in parallel if using the standard MySQL Protocol. However, you can get asynchronous execution by using the X Plugin for MySQL. See https://www.percona.com/blog/2016/05/27/asynchronous-query-execution-mysql-5-7-x-plugin/ for an example.

> or I need to create three connection for each
> query to run parallel ?

Yes, unless you use the XPlugin.

Øystein Grøvlen,
Senior Principal Software Engineer,
MySQL Group, Oracle,
Trondheim, Norway

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Is Union Queries run in Parallel form or not.
812
October 19, 2017 03:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.