Route prepared statements to the slaves

372 views Asked by At

My setup is as the following: MaxScale 2.1.4 -> Master -> 2 slaves (both MariaDB 10.2). *CentOS 7

Most of my queries are prepared statements so the master basically handles 90% of the queries right now.

I've enabled the hintfilter and tried to add a hint to a query:

/* maxscale route to server server2 */

Unfortunately, it still ends up on the master.

I understood that MaxScale 2.2 should introduce some auto solution for prepared statements. However, I need some temp solution(I'll try to look into ProxySQL if none is found).

Any help would be highly appreciated.

1

There are 1 answers

0
markusjm On

If you used the mysql command line client to test it, remember to enable SQL comments by using the -c flag.

Since MaxScale 2.0.1, the hint mechanism will override any decisions taken by the router itself if the router supports hints. The readwritesplit and schemarouter routers are currently the only routers that support routing hints so make sure you are using one of these routers.