1

I was wondering if it is possible to issue (multiplex) multiple queries via one connection (TCP) and then identify (demultiplex) the results as they arrive back from MySQL?

[Edit] Yes, I'm asking if the MySQL ABI supports this.

alfred
  • 639
  • 1
  • 6
  • 11
  • Thus might be a better fit for the [DB Admins](http://dba.stackexchange.com) site. – Giacomo1968 May 30 '14 at 00:54
  • I don't think so. But you can open multiple connections from the same client, and issue queries concurrently on the connections. – Barmar May 30 '14 at 00:54
  • As long as you don't need to share temporary tables or user-defined variables between the queries, multiple connections should work just as well. – Barmar May 30 '14 at 00:55
  • 1
    @JakeGould This seems more like an API issue than a DBA issue, I think SO is the right place. – Barmar May 30 '14 at 00:56
  • To add to Barmar's comment, there is a `multi-query` option available. Examples @ 1.[*Java Solution*](http://stackoverflow.com/questions/10797794/multiple-queries-executed-in-java-in-single-statement/10804730#10804730), 1.[*PHP: mysqli_multi_query*](http://www.php.net/manual/en/mysqli.multi-query.php) – Ravinder Reddy May 30 '14 at 01:23
  • I think `multi_query` runs them sequentially, not concurrently. So it's not much different from calling `mysqli_query` multiple times. – Barmar May 30 '14 at 14:07

0 Answers0