The initial problem is that we have a joins queries like this:
select a.SchemeId as Id, a.Enabled, a.SegmentId, b.CompanyName, shb.IsProfileEnabled from table1 as a join schemes as b on b.Id = a.SchemeId join table2 as shb on a.SchemeId = shb.SchemeId where a.SchemeId = 'xxx' and a.ConfigurationID = 'xxx';
This queries are creating a lot of scatter queries which we want to kill or prevent from running too long so we've tried with --query-timeout.
The query on our test environment was running for 12 seconds so we've set --query-timeout to 3000ms, restarted vtgate but and run the query again - it wasn't killed after 3 seconds, finished successfully after 12 seconds.
For the sake of the test we've changed --query-timeout to 500ms and here we had a result but it was killing 100% of the queries executed , no matter JOIN, SELECT or other.
Overview of the Issue
The initial problem is that we have a joins queries like this:
select a.SchemeId as Id, a.Enabled, a.SegmentId, b.CompanyName, shb.IsProfileEnabled from table1 as a join schemes as b on b.Id = a.SchemeId join table2 as shb on a.SchemeId = shb.SchemeId where a.SchemeId = 'xxx' and a.ConfigurationID = 'xxx';
This queries are creating a lot of scatter queries which we want to kill or prevent from running too long so we've tried with
--query-timeout
.The query on our test environment was running for 12 seconds so we've set
--query-timeout
to 3000ms, restarted vtgate but and run the query again - it wasn't killed after 3 seconds, finished successfully after 12 seconds.For the sake of the test we've changed
--query-timeout
to 500ms and here we had a result but it was killing 100% of the queries executed , no matter JOIN, SELECT or other.Reproduction Steps
The part of the vschema for these tables:
Binary Version
Operating System and Environment details
Log Fragments