From 833b859ce4ed635c3f9edf0d10157cb1573b6912 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Fri, 17 Jan 2025 11:26:30 +0100 Subject: [PATCH] add benchmark Signed-off-by: Andres Taylor --- go/vt/vtgate/planbuilder/plan_test.go | 38 + go/vt/vtgate/planbuilder/testdata/my.json | 740 ++++++++++++++++++ .../testdata/vschemas/my_schema.json | 110 +++ 3 files changed, 888 insertions(+) create mode 100644 go/vt/vtgate/planbuilder/testdata/my.json create mode 100644 go/vt/vtgate/planbuilder/testdata/vschemas/my_schema.json diff --git a/go/vt/vtgate/planbuilder/plan_test.go b/go/vt/vtgate/planbuilder/plan_test.go index 8a8d55279a6..de68a76f017 100644 --- a/go/vt/vtgate/planbuilder/plan_test.go +++ b/go/vt/vtgate/planbuilder/plan_test.go @@ -872,3 +872,41 @@ func benchmarkPlanner(b *testing.B, version plancontext.PlannerVersion, testCase } } } + +func (s *planTestSuite) TestMy() { + vschema, err := vschemawrapper.NewVschemaWrapper( + vtenv.NewTestEnv(), + loadSchema(s.T(), "vschemas/my_schema.json", true), + TestBuilder, + ) + require.NoError(s.T(), err) + // vschema := &vschemawrapper.VSchemaWrapper{ + // V: loadSchema(s.T(), "vschemas/my_schema.json", true), + // SysVarEnabled: true, + // Version: Gen4, + // Env: vtenv.NewTestEnv(), + // } + + s.testFile("my.json", vschema, false) +} + +func BenchmarkMine(b *testing.B) { + vschema, err := vschemawrapper.NewVschemaWrapper( + vtenv.NewTestEnv(), + loadSchema(b, "vschemas/my_schema.json", true), + TestBuilder, + ) + require.NoError(b, err) + testCases := readJSONTests("my.json") + + b.ReportAllocs() + b.ResetTimer() + for range b.N { + for _, tcase := range testCases { + plan, _ := TestBuilder(tcase.Query, vschema, vschema.CurrentDb()) + if plan == nil { + panic("") + } + } + } +} diff --git a/go/vt/vtgate/planbuilder/testdata/my.json b/go/vt/vtgate/planbuilder/testdata/my.json new file mode 100644 index 00000000000..ae8403be495 --- /dev/null +++ b/go/vt/vtgate/planbuilder/testdata/my.json @@ -0,0 +1,740 @@ +[ + { + "comment": "Add your test case here for debugging and run go test -run=One.", + "query": "select col04, col03, col01, col02 from my_table where id in ((select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '2XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'VXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '6XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'6FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'ZXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'GXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '8XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'FXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'0FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'FXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'YXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'YXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '1XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'WXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '2XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'HXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'QXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'0FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'ZXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'NXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'WXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'PXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'3FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'BXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'TXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '4XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'KXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '3XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'FFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '0XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '1XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'3FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'SXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '5XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'KXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'FFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'HXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '5XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'CXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'NXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'TXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'DXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'GXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000)) order by col01 desc, sdKey desc, col02 desc limit 0, 500000;", + "plan": { + "QueryType": "SELECT", + "Original": "select col04, col03, col01, col02 from my_table where id in ((select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '2XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'VXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '6XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'6FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'ZXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'GXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '8XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'FXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'0FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'FXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'YXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'YXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '1XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'WXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '2XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'HXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'QXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'0FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'ZXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'NXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'WXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'PXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'3FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'BXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'TXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '4XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'KXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '3XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'FFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '0XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '1XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'3FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'SXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '5XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'KXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'FFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'HXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '5XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'CXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'NXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'TXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'DXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'GXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000)) order by col01 desc, sdKey desc, col02 desc limit 0, 500000;", + "Instructions": { + "OperatorType": "Limit", + "Count": "500000", + "Offset": "0", + "Inputs": [ + { + "OperatorType": "UncorrelatedSubquery", + "Variant": "PulloutIn", + "PulloutVars": [ + "__sq_has_values", + "__sq1" + ], + "Inputs": [ + { + "InputName": "SubQuery", + "OperatorType": "Concatenate", + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '2XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'VXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '6XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'6FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'o\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'ZXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'_\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "(select id from my_table force index (MY_INDEX) where 1 != 1) union all (select id from my_table force index (MY_INDEX) where 1 != 1) union all (select id from my_table force index (MY_INDEX) where 1 != 1)", + "Query": "(select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'GXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '8XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000)", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'FXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'0FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\u000f\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'FXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'_\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'YXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'/\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'YXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '1XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "(select id from my_table force index (MY_INDEX) where 1 != 1) union all (select id from my_table force index (MY_INDEX) where 1 != 1)", + "Query": "(select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000)", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'WXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '2XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'O\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'HXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'QXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'0FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\u000f\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'ZXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "(select id from my_table force index (MY_INDEX) where 1 != 1) union all (select id from my_table force index (MY_INDEX) where 1 != 1)", + "Query": "(select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'NXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000) union all (select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000)", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'WXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'PXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'3FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'?\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'BXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'O\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'_\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'TXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'O\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '4XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'KXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'O\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '3XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'FFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '0XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'AFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '1XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'JXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'3FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'?\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'SXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '5XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'/\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'KXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'5FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'_\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'7FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'XXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'FFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'HXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'2FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'/\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = '5XxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'CXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'DFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'NXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'EFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'TXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'CFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'DXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'9FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'GXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'4FFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'O\ufffd'" + ], + "Vindex": "binary_vdx" + }, + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select id from my_table force index (MY_INDEX) where 1 != 1", + "Query": "select id from my_table force index (MY_INDEX) where col02 <= 1234567890000 and col10 = 1234567890000000000 and col06 = 0 and col02 >= 1000000000000 and col01 = 'RXxXxXxXxXxXxXxXxXxXxXx' and sdKey = X'BFFF' order by col02 desc limit 0, 10000", + "Table": "my_table", + "Values": [ + "_binary'\ufffd\ufffd'" + ], + "Vindex": "binary_vdx" + } + ] + }, + { + "InputName": "Outer", + "OperatorType": "Route", + "Variant": "Scatter", + "Keyspace": { + "Name": "main", + "Sharded": true + }, + "FieldQuery": "select col04, col03, col01, col02, sdKey from my_table where 1 != 1", + "OrderBy": "2 DESC COLLATE latin1_swedish_ci, 4 DESC, 3 DESC", + "Query": "select col04, col03, col01, col02, sdKey from my_table where :__sq_has_values and id in ::__sq1 order by my_table.col01 desc, sdKey desc, my_table.col02 desc", + "ResultColumns": 4, + "Table": "my_table" + } + ] + } + ] + }, + "TablesUsed": [ + "main.my_table" + ] + } + } +] diff --git a/go/vt/vtgate/planbuilder/testdata/vschemas/my_schema.json b/go/vt/vtgate/planbuilder/testdata/vschemas/my_schema.json new file mode 100644 index 00000000000..f87c0cd5b60 --- /dev/null +++ b/go/vt/vtgate/planbuilder/testdata/vschemas/my_schema.json @@ -0,0 +1,110 @@ +{ + "keyspaces": { + "unsharded_ns": { + "sharded": false, + "tables": { + "my_table_seq": { + "type": "sequence", + "columns": [ + { + "name": "next_id", + "type": "UINT64" + }, + { + "name": "cache", + "type": "UINT32" + }, + { + "name": "id", + "type": "UINT64" + } + ], + "column_list_authoritative": true + } + } + }, + "main": { + "sharded": true, + "vindexes": { + "binary_vdx": { + "type": "binary" + } + }, + "tables": { + "my_table": { + "column_vindexes": [ + { + "columns": [ + "sdKey" + ], + "name": "binary_vdx" + } + ], + "auto_increment": { + "column": "id", + "sequence": "my_table_seq" + }, + "columns": [ + { + "name": "col01", + "type": "VARCHAR" + }, + { + "name": "col02", + "type": "INT64" + }, + { + "name": "col03", + "type": "BLOB" + }, + { + "name": "col04", + "type": "VARCHAR" + }, + { + "name": "col05", + "type": "VARBINARY" + }, + { + "name": "col06", + "type": "INT8" + }, + { + "name": "col07", + "type": "INT64" + }, + { + "name": "col08", + "type": "VARBINARY" + }, + { + "name": "sdKey", + "type": "VARBINARY" + }, + { + "name": "col09", + "type": "INT64" + }, + { + "name": "col10", + "type": "INT64" + }, + { + "name": "col11", + "type": "INT64" + }, + { + "name": "col12", + "type": "INT64" + }, + { + "name": "id", + "type": "UINT64" + } + ], + "column_list_authoritative": true + } + } + } + } +}