github.com/dolthub/go-mysql-server@v0.18.0/enginetest/queries/imdb_plans.go (about)

     1  // Code generated by plangen.
     2  
     3  // Copyright 2024 Dolthub, Inc.
     4  //
     5  // Licensed under the Apache License, Version 2.0 (the "License");
     6  // you may not use this file except in compliance with the License.
     7  // You may obtain a copy of the License at
     8  //
     9  //     http://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  
    17  package queries
    18  
    19  var ImdbPlanTests = []QueryPlanTest{
    20  	{
    21  		Query: `
    22  SELECT MIN(chn.name) AS uncredited_voiced_character,
    23         MIN(t.title) AS russian_movie
    24  FROM char_name AS chn,
    25       cast_info AS ci,
    26       company_name AS cn,
    27       company_type AS ct,
    28       movie_companies AS mc,
    29       role_type AS rt,
    30       title AS t
    31  WHERE ci.note LIKE '%(voice)%'
    32    AND ci.note LIKE '%(uncredited)%'
    33    AND cn.country_code = '[ru]'
    34    AND rt.role = 'actor'
    35    AND t.production_year > 2005
    36    AND t.id = mc.movie_id
    37    AND t.id = ci.movie_id
    38    AND ci.movie_id = mc.movie_id
    39    AND chn.id = ci.person_role_id
    40    AND rt.id = ci.role_id
    41    AND cn.id = mc.company_id
    42    AND ct.id = mc.company_type_id;
    43  
    44  `,
    45  		ExpectedPlan: "Project\n" +
    46  			" ├─ columns: [min(chn.name):0!null as uncredited_voiced_character, min(t.title):1!null as russian_movie]\n" +
    47  			" └─ GroupBy\n" +
    48  			"     ├─ select: MIN(chn.name:16!null), MIN(t.title:1!null)\n" +
    49  			"     ├─ group: \n" +
    50  			"     └─ InnerJoin\n" +
    51  			"         ├─ AND\n" +
    52  			"         │   ├─ Eq\n" +
    53  			"         │   │   ├─ ci.movie_id:11!null\n" +
    54  			"         │   │   └─ mc.movie_id:3!null\n" +
    55  			"         │   └─ Eq\n" +
    56  			"         │       ├─ t.id:0!null\n" +
    57  			"         │       └─ ci.movie_id:11!null\n" +
    58  			"         ├─ InnerJoin\n" +
    59  			"         │   ├─ Eq\n" +
    60  			"         │   │   ├─ t.id:0!null\n" +
    61  			"         │   │   └─ mc.movie_id:3!null\n" +
    62  			"         │   ├─ Filter\n" +
    63  			"         │   │   ├─ GreaterThan\n" +
    64  			"         │   │   │   ├─ t.production_year:2\n" +
    65  			"         │   │   │   └─ 2005 (smallint)\n" +
    66  			"         │   │   └─ TableAlias(t)\n" +
    67  			"         │   │       └─ ProcessTable\n" +
    68  			"         │   │           └─ Table\n" +
    69  			"         │   │               ├─ name: title\n" +
    70  			"         │   │               └─ columns: [id title production_year]\n" +
    71  			"         │   └─ InnerJoin\n" +
    72  			"         │       ├─ Eq\n" +
    73  			"         │       │   ├─ ct.id:8!null\n" +
    74  			"         │       │   └─ mc.company_type_id:5!null\n" +
    75  			"         │       ├─ InnerJoin\n" +
    76  			"         │       │   ├─ Eq\n" +
    77  			"         │       │   │   ├─ cn.id:6!null\n" +
    78  			"         │       │   │   └─ mc.company_id:4!null\n" +
    79  			"         │       │   ├─ TableAlias(mc)\n" +
    80  			"         │       │   │   └─ ProcessTable\n" +
    81  			"         │       │   │       └─ Table\n" +
    82  			"         │       │   │           ├─ name: movie_companies\n" +
    83  			"         │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
    84  			"         │       │   └─ Filter\n" +
    85  			"         │       │       ├─ Eq\n" +
    86  			"         │       │       │   ├─ cn.country_code:1\n" +
    87  			"         │       │       │   └─ [ru] (longtext)\n" +
    88  			"         │       │       └─ TableAlias(cn)\n" +
    89  			"         │       │           └─ ProcessTable\n" +
    90  			"         │       │               └─ Table\n" +
    91  			"         │       │                   ├─ name: company_name\n" +
    92  			"         │       │                   └─ columns: [id country_code]\n" +
    93  			"         │       └─ TableAlias(ct)\n" +
    94  			"         │           └─ ProcessTable\n" +
    95  			"         │               └─ Table\n" +
    96  			"         │                   ├─ name: company_type\n" +
    97  			"         │                   └─ columns: [id]\n" +
    98  			"         └─ InnerJoin\n" +
    99  			"             ├─ Eq\n" +
   100  			"             │   ├─ rt.id:9!null\n" +
   101  			"             │   └─ ci.role_id:14!null\n" +
   102  			"             ├─ Filter\n" +
   103  			"             │   ├─ Eq\n" +
   104  			"             │   │   ├─ rt.role:1!null\n" +
   105  			"             │   │   └─ actor (longtext)\n" +
   106  			"             │   └─ TableAlias(rt)\n" +
   107  			"             │       └─ ProcessTable\n" +
   108  			"             │           └─ Table\n" +
   109  			"             │               ├─ name: role_type\n" +
   110  			"             │               └─ columns: [id role]\n" +
   111  			"             └─ InnerJoin\n" +
   112  			"                 ├─ Eq\n" +
   113  			"                 │   ├─ chn.id:15!null\n" +
   114  			"                 │   └─ ci.person_role_id:12\n" +
   115  			"                 ├─ Filter\n" +
   116  			"                 │   ├─ AND\n" +
   117  			"                 │   │   ├─ ci.note LIKE '%(voice)%'\n" +
   118  			"                 │   │   └─ ci.note LIKE '%(uncredited)%'\n" +
   119  			"                 │   └─ TableAlias(ci)\n" +
   120  			"                 │       └─ ProcessTable\n" +
   121  			"                 │           └─ Table\n" +
   122  			"                 │               ├─ name: cast_info\n" +
   123  			"                 │               └─ columns: [movie_id person_role_id note role_id]\n" +
   124  			"                 └─ TableAlias(chn)\n" +
   125  			"                     └─ ProcessTable\n" +
   126  			"                         └─ Table\n" +
   127  			"                             ├─ name: char_name\n" +
   128  			"                             └─ columns: [id name]\n" +
   129  			"",
   130  		ExpectedEstimates: "Project\n" +
   131  			" ├─ columns: [min(chn.name) as uncredited_voiced_character, min(t.title) as russian_movie]\n" +
   132  			" └─ GroupBy\n" +
   133  			"     ├─ SelectedExprs(MIN(chn.name), MIN(t.title))\n" +
   134  			"     ├─ Grouping()\n" +
   135  			"     └─ InnerJoin\n" +
   136  			"         ├─ ((ci.movie_id = mc.movie_id) AND (t.id = ci.movie_id))\n" +
   137  			"         ├─ InnerJoin\n" +
   138  			"         │   ├─ (t.id = mc.movie_id)\n" +
   139  			"         │   ├─ Filter\n" +
   140  			"         │   │   ├─ (t.production_year > 2005)\n" +
   141  			"         │   │   └─ TableAlias(t)\n" +
   142  			"         │   │       └─ Table\n" +
   143  			"         │   │           ├─ name: title\n" +
   144  			"         │   │           └─ columns: [id title production_year]\n" +
   145  			"         │   └─ InnerJoin\n" +
   146  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
   147  			"         │       ├─ InnerJoin\n" +
   148  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
   149  			"         │       │   ├─ TableAlias(mc)\n" +
   150  			"         │       │   │   └─ Table\n" +
   151  			"         │       │   │       ├─ name: movie_companies\n" +
   152  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
   153  			"         │       │   └─ Filter\n" +
   154  			"         │       │       ├─ (cn.country_code = '[ru]')\n" +
   155  			"         │       │       └─ TableAlias(cn)\n" +
   156  			"         │       │           └─ Table\n" +
   157  			"         │       │               ├─ name: company_name\n" +
   158  			"         │       │               └─ columns: [id country_code]\n" +
   159  			"         │       └─ TableAlias(ct)\n" +
   160  			"         │           └─ Table\n" +
   161  			"         │               ├─ name: company_type\n" +
   162  			"         │               └─ columns: [id]\n" +
   163  			"         └─ InnerJoin\n" +
   164  			"             ├─ (rt.id = ci.role_id)\n" +
   165  			"             ├─ Filter\n" +
   166  			"             │   ├─ (rt.role = 'actor')\n" +
   167  			"             │   └─ TableAlias(rt)\n" +
   168  			"             │       └─ Table\n" +
   169  			"             │           ├─ name: role_type\n" +
   170  			"             │           └─ columns: [id role]\n" +
   171  			"             └─ InnerJoin\n" +
   172  			"                 ├─ (chn.id = ci.person_role_id)\n" +
   173  			"                 ├─ Filter\n" +
   174  			"                 │   ├─ (ci.note LIKE '%(voice)%' AND ci.note LIKE '%(uncredited)%')\n" +
   175  			"                 │   └─ TableAlias(ci)\n" +
   176  			"                 │       └─ Table\n" +
   177  			"                 │           ├─ name: cast_info\n" +
   178  			"                 │           └─ columns: [movie_id person_role_id note role_id]\n" +
   179  			"                 └─ TableAlias(chn)\n" +
   180  			"                     └─ Table\n" +
   181  			"                         ├─ name: char_name\n" +
   182  			"                         └─ columns: [id name]\n" +
   183  			"",
   184  		ExpectedAnalysis: "Project\n" +
   185  			" ├─ columns: [min(chn.name) as uncredited_voiced_character, min(t.title) as russian_movie]\n" +
   186  			" └─ GroupBy\n" +
   187  			"     ├─ SelectedExprs(MIN(chn.name), MIN(t.title))\n" +
   188  			"     ├─ Grouping()\n" +
   189  			"     └─ InnerJoin\n" +
   190  			"         ├─ ((ci.movie_id = mc.movie_id) AND (t.id = ci.movie_id))\n" +
   191  			"         ├─ InnerJoin\n" +
   192  			"         │   ├─ (t.id = mc.movie_id)\n" +
   193  			"         │   ├─ Filter\n" +
   194  			"         │   │   ├─ (t.production_year > 2005)\n" +
   195  			"         │   │   └─ TableAlias(t)\n" +
   196  			"         │   │       └─ Table\n" +
   197  			"         │   │           ├─ name: title\n" +
   198  			"         │   │           └─ columns: [id title production_year]\n" +
   199  			"         │   └─ InnerJoin\n" +
   200  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
   201  			"         │       ├─ InnerJoin\n" +
   202  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
   203  			"         │       │   ├─ TableAlias(mc)\n" +
   204  			"         │       │   │   └─ Table\n" +
   205  			"         │       │   │       ├─ name: movie_companies\n" +
   206  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
   207  			"         │       │   └─ Filter\n" +
   208  			"         │       │       ├─ (cn.country_code = '[ru]')\n" +
   209  			"         │       │       └─ TableAlias(cn)\n" +
   210  			"         │       │           └─ Table\n" +
   211  			"         │       │               ├─ name: company_name\n" +
   212  			"         │       │               └─ columns: [id country_code]\n" +
   213  			"         │       └─ TableAlias(ct)\n" +
   214  			"         │           └─ Table\n" +
   215  			"         │               ├─ name: company_type\n" +
   216  			"         │               └─ columns: [id]\n" +
   217  			"         └─ InnerJoin\n" +
   218  			"             ├─ (rt.id = ci.role_id)\n" +
   219  			"             ├─ Filter\n" +
   220  			"             │   ├─ (rt.role = 'actor')\n" +
   221  			"             │   └─ TableAlias(rt)\n" +
   222  			"             │       └─ Table\n" +
   223  			"             │           ├─ name: role_type\n" +
   224  			"             │           └─ columns: [id role]\n" +
   225  			"             └─ InnerJoin\n" +
   226  			"                 ├─ (chn.id = ci.person_role_id)\n" +
   227  			"                 ├─ Filter\n" +
   228  			"                 │   ├─ (ci.note LIKE '%(voice)%' AND ci.note LIKE '%(uncredited)%')\n" +
   229  			"                 │   └─ TableAlias(ci)\n" +
   230  			"                 │       └─ Table\n" +
   231  			"                 │           ├─ name: cast_info\n" +
   232  			"                 │           └─ columns: [movie_id person_role_id note role_id]\n" +
   233  			"                 └─ TableAlias(chn)\n" +
   234  			"                     └─ Table\n" +
   235  			"                         ├─ name: char_name\n" +
   236  			"                         └─ columns: [id name]\n" +
   237  			"",
   238  	},
   239  	{
   240  		Query: "SELECT MIN(chn.name) AS `character`,\n" +
   241  			"       MIN(t.title) AS russian_mov_with_actor_producer\n" +
   242  			"FROM char_name AS chn,\n" +
   243  			"     cast_info AS ci,\n" +
   244  			"     company_name AS cn,\n" +
   245  			"     company_type AS ct,\n" +
   246  			"     movie_companies AS mc,\n" +
   247  			"     role_type AS rt,\n" +
   248  			"     title AS t\n" +
   249  			"WHERE ci.note LIKE '%(producer)%'\n" +
   250  			"  AND cn.country_code = '[ru]'\n" +
   251  			"  AND rt.role = 'actor'\n" +
   252  			"  AND t.production_year > 2010\n" +
   253  			"  AND t.id = mc.movie_id\n" +
   254  			"  AND t.id = ci.movie_id\n" +
   255  			"  AND ci.movie_id = mc.movie_id\n" +
   256  			"  AND chn.id = ci.person_role_id\n" +
   257  			"  AND rt.id = ci.role_id\n" +
   258  			"  AND cn.id = mc.company_id\n" +
   259  			"  AND ct.id = mc.company_type_id;\n" +
   260  			"",
   261  
   262  		ExpectedPlan: "Project\n" +
   263  			" ├─ columns: [min(chn.name):0!null as character, min(t.title):1!null as russian_mov_with_actor_producer]\n" +
   264  			" └─ GroupBy\n" +
   265  			"     ├─ select: MIN(chn.name:16!null), MIN(t.title:1!null)\n" +
   266  			"     ├─ group: \n" +
   267  			"     └─ InnerJoin\n" +
   268  			"         ├─ AND\n" +
   269  			"         │   ├─ Eq\n" +
   270  			"         │   │   ├─ ci.movie_id:11!null\n" +
   271  			"         │   │   └─ mc.movie_id:3!null\n" +
   272  			"         │   └─ Eq\n" +
   273  			"         │       ├─ t.id:0!null\n" +
   274  			"         │       └─ ci.movie_id:11!null\n" +
   275  			"         ├─ InnerJoin\n" +
   276  			"         │   ├─ Eq\n" +
   277  			"         │   │   ├─ t.id:0!null\n" +
   278  			"         │   │   └─ mc.movie_id:3!null\n" +
   279  			"         │   ├─ Filter\n" +
   280  			"         │   │   ├─ GreaterThan\n" +
   281  			"         │   │   │   ├─ t.production_year:2\n" +
   282  			"         │   │   │   └─ 2010 (smallint)\n" +
   283  			"         │   │   └─ TableAlias(t)\n" +
   284  			"         │   │       └─ ProcessTable\n" +
   285  			"         │   │           └─ Table\n" +
   286  			"         │   │               ├─ name: title\n" +
   287  			"         │   │               └─ columns: [id title production_year]\n" +
   288  			"         │   └─ InnerJoin\n" +
   289  			"         │       ├─ Eq\n" +
   290  			"         │       │   ├─ ct.id:8!null\n" +
   291  			"         │       │   └─ mc.company_type_id:5!null\n" +
   292  			"         │       ├─ InnerJoin\n" +
   293  			"         │       │   ├─ Eq\n" +
   294  			"         │       │   │   ├─ cn.id:6!null\n" +
   295  			"         │       │   │   └─ mc.company_id:4!null\n" +
   296  			"         │       │   ├─ TableAlias(mc)\n" +
   297  			"         │       │   │   └─ ProcessTable\n" +
   298  			"         │       │   │       └─ Table\n" +
   299  			"         │       │   │           ├─ name: movie_companies\n" +
   300  			"         │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
   301  			"         │       │   └─ Filter\n" +
   302  			"         │       │       ├─ Eq\n" +
   303  			"         │       │       │   ├─ cn.country_code:1\n" +
   304  			"         │       │       │   └─ [ru] (longtext)\n" +
   305  			"         │       │       └─ TableAlias(cn)\n" +
   306  			"         │       │           └─ ProcessTable\n" +
   307  			"         │       │               └─ Table\n" +
   308  			"         │       │                   ├─ name: company_name\n" +
   309  			"         │       │                   └─ columns: [id country_code]\n" +
   310  			"         │       └─ TableAlias(ct)\n" +
   311  			"         │           └─ ProcessTable\n" +
   312  			"         │               └─ Table\n" +
   313  			"         │                   ├─ name: company_type\n" +
   314  			"         │                   └─ columns: [id]\n" +
   315  			"         └─ InnerJoin\n" +
   316  			"             ├─ Eq\n" +
   317  			"             │   ├─ rt.id:9!null\n" +
   318  			"             │   └─ ci.role_id:14!null\n" +
   319  			"             ├─ Filter\n" +
   320  			"             │   ├─ Eq\n" +
   321  			"             │   │   ├─ rt.role:1!null\n" +
   322  			"             │   │   └─ actor (longtext)\n" +
   323  			"             │   └─ TableAlias(rt)\n" +
   324  			"             │       └─ ProcessTable\n" +
   325  			"             │           └─ Table\n" +
   326  			"             │               ├─ name: role_type\n" +
   327  			"             │               └─ columns: [id role]\n" +
   328  			"             └─ InnerJoin\n" +
   329  			"                 ├─ Eq\n" +
   330  			"                 │   ├─ chn.id:15!null\n" +
   331  			"                 │   └─ ci.person_role_id:12\n" +
   332  			"                 ├─ Filter\n" +
   333  			"                 │   ├─ ci.note LIKE '%(producer)%'\n" +
   334  			"                 │   └─ TableAlias(ci)\n" +
   335  			"                 │       └─ ProcessTable\n" +
   336  			"                 │           └─ Table\n" +
   337  			"                 │               ├─ name: cast_info\n" +
   338  			"                 │               └─ columns: [movie_id person_role_id note role_id]\n" +
   339  			"                 └─ TableAlias(chn)\n" +
   340  			"                     └─ ProcessTable\n" +
   341  			"                         └─ Table\n" +
   342  			"                             ├─ name: char_name\n" +
   343  			"                             └─ columns: [id name]\n" +
   344  			"",
   345  		ExpectedEstimates: "Project\n" +
   346  			" ├─ columns: [min(chn.name) as character, min(t.title) as russian_mov_with_actor_producer]\n" +
   347  			" └─ GroupBy\n" +
   348  			"     ├─ SelectedExprs(MIN(chn.name), MIN(t.title))\n" +
   349  			"     ├─ Grouping()\n" +
   350  			"     └─ InnerJoin\n" +
   351  			"         ├─ ((ci.movie_id = mc.movie_id) AND (t.id = ci.movie_id))\n" +
   352  			"         ├─ InnerJoin\n" +
   353  			"         │   ├─ (t.id = mc.movie_id)\n" +
   354  			"         │   ├─ Filter\n" +
   355  			"         │   │   ├─ (t.production_year > 2010)\n" +
   356  			"         │   │   └─ TableAlias(t)\n" +
   357  			"         │   │       └─ Table\n" +
   358  			"         │   │           ├─ name: title\n" +
   359  			"         │   │           └─ columns: [id title production_year]\n" +
   360  			"         │   └─ InnerJoin\n" +
   361  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
   362  			"         │       ├─ InnerJoin\n" +
   363  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
   364  			"         │       │   ├─ TableAlias(mc)\n" +
   365  			"         │       │   │   └─ Table\n" +
   366  			"         │       │   │       ├─ name: movie_companies\n" +
   367  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
   368  			"         │       │   └─ Filter\n" +
   369  			"         │       │       ├─ (cn.country_code = '[ru]')\n" +
   370  			"         │       │       └─ TableAlias(cn)\n" +
   371  			"         │       │           └─ Table\n" +
   372  			"         │       │               ├─ name: company_name\n" +
   373  			"         │       │               └─ columns: [id country_code]\n" +
   374  			"         │       └─ TableAlias(ct)\n" +
   375  			"         │           └─ Table\n" +
   376  			"         │               ├─ name: company_type\n" +
   377  			"         │               └─ columns: [id]\n" +
   378  			"         └─ InnerJoin\n" +
   379  			"             ├─ (rt.id = ci.role_id)\n" +
   380  			"             ├─ Filter\n" +
   381  			"             │   ├─ (rt.role = 'actor')\n" +
   382  			"             │   └─ TableAlias(rt)\n" +
   383  			"             │       └─ Table\n" +
   384  			"             │           ├─ name: role_type\n" +
   385  			"             │           └─ columns: [id role]\n" +
   386  			"             └─ InnerJoin\n" +
   387  			"                 ├─ (chn.id = ci.person_role_id)\n" +
   388  			"                 ├─ Filter\n" +
   389  			"                 │   ├─ ci.note LIKE '%(producer)%'\n" +
   390  			"                 │   └─ TableAlias(ci)\n" +
   391  			"                 │       └─ Table\n" +
   392  			"                 │           ├─ name: cast_info\n" +
   393  			"                 │           └─ columns: [movie_id person_role_id note role_id]\n" +
   394  			"                 └─ TableAlias(chn)\n" +
   395  			"                     └─ Table\n" +
   396  			"                         ├─ name: char_name\n" +
   397  			"                         └─ columns: [id name]\n" +
   398  			"",
   399  		ExpectedAnalysis: "Project\n" +
   400  			" ├─ columns: [min(chn.name) as character, min(t.title) as russian_mov_with_actor_producer]\n" +
   401  			" └─ GroupBy\n" +
   402  			"     ├─ SelectedExprs(MIN(chn.name), MIN(t.title))\n" +
   403  			"     ├─ Grouping()\n" +
   404  			"     └─ InnerJoin\n" +
   405  			"         ├─ ((ci.movie_id = mc.movie_id) AND (t.id = ci.movie_id))\n" +
   406  			"         ├─ InnerJoin\n" +
   407  			"         │   ├─ (t.id = mc.movie_id)\n" +
   408  			"         │   ├─ Filter\n" +
   409  			"         │   │   ├─ (t.production_year > 2010)\n" +
   410  			"         │   │   └─ TableAlias(t)\n" +
   411  			"         │   │       └─ Table\n" +
   412  			"         │   │           ├─ name: title\n" +
   413  			"         │   │           └─ columns: [id title production_year]\n" +
   414  			"         │   └─ InnerJoin\n" +
   415  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
   416  			"         │       ├─ InnerJoin\n" +
   417  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
   418  			"         │       │   ├─ TableAlias(mc)\n" +
   419  			"         │       │   │   └─ Table\n" +
   420  			"         │       │   │       ├─ name: movie_companies\n" +
   421  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
   422  			"         │       │   └─ Filter\n" +
   423  			"         │       │       ├─ (cn.country_code = '[ru]')\n" +
   424  			"         │       │       └─ TableAlias(cn)\n" +
   425  			"         │       │           └─ Table\n" +
   426  			"         │       │               ├─ name: company_name\n" +
   427  			"         │       │               └─ columns: [id country_code]\n" +
   428  			"         │       └─ TableAlias(ct)\n" +
   429  			"         │           └─ Table\n" +
   430  			"         │               ├─ name: company_type\n" +
   431  			"         │               └─ columns: [id]\n" +
   432  			"         └─ InnerJoin\n" +
   433  			"             ├─ (rt.id = ci.role_id)\n" +
   434  			"             ├─ Filter\n" +
   435  			"             │   ├─ (rt.role = 'actor')\n" +
   436  			"             │   └─ TableAlias(rt)\n" +
   437  			"             │       └─ Table\n" +
   438  			"             │           ├─ name: role_type\n" +
   439  			"             │           └─ columns: [id role]\n" +
   440  			"             └─ InnerJoin\n" +
   441  			"                 ├─ (chn.id = ci.person_role_id)\n" +
   442  			"                 ├─ Filter\n" +
   443  			"                 │   ├─ ci.note LIKE '%(producer)%'\n" +
   444  			"                 │   └─ TableAlias(ci)\n" +
   445  			"                 │       └─ Table\n" +
   446  			"                 │           ├─ name: cast_info\n" +
   447  			"                 │           └─ columns: [movie_id person_role_id note role_id]\n" +
   448  			"                 └─ TableAlias(chn)\n" +
   449  			"                     └─ Table\n" +
   450  			"                         ├─ name: char_name\n" +
   451  			"                         └─ columns: [id name]\n" +
   452  			"",
   453  	},
   454  	{
   455  		Query: "SELECT MIN(chn.name) AS `character`,\n" +
   456  			"       MIN(t.title) AS movie_with_american_producer\n" +
   457  			"FROM char_name AS chn,\n" +
   458  			"     cast_info AS ci,\n" +
   459  			"     company_name AS cn,\n" +
   460  			"     company_type AS ct,\n" +
   461  			"     movie_companies AS mc,\n" +
   462  			"     role_type AS rt,\n" +
   463  			"     title AS t\n" +
   464  			"WHERE ci.note LIKE '%(producer)%'\n" +
   465  			"  AND cn.country_code = '[us]'\n" +
   466  			"  AND t.production_year > 1990\n" +
   467  			"  AND t.id = mc.movie_id\n" +
   468  			"  AND t.id = ci.movie_id\n" +
   469  			"  AND ci.movie_id = mc.movie_id\n" +
   470  			"  AND chn.id = ci.person_role_id\n" +
   471  			"  AND rt.id = ci.role_id\n" +
   472  			"  AND cn.id = mc.company_id\n" +
   473  			"  AND ct.id = mc.company_type_id;\n" +
   474  			"",
   475  
   476  		ExpectedPlan: "Project\n" +
   477  			" ├─ columns: [min(chn.name):0!null as character, min(t.title):1!null as movie_with_american_producer]\n" +
   478  			" └─ GroupBy\n" +
   479  			"     ├─ select: MIN(chn.name:15!null), MIN(t.title:1!null)\n" +
   480  			"     ├─ group: \n" +
   481  			"     └─ InnerJoin\n" +
   482  			"         ├─ AND\n" +
   483  			"         │   ├─ Eq\n" +
   484  			"         │   │   ├─ ci.movie_id:10!null\n" +
   485  			"         │   │   └─ mc.movie_id:3!null\n" +
   486  			"         │   └─ Eq\n" +
   487  			"         │       ├─ t.id:0!null\n" +
   488  			"         │       └─ ci.movie_id:10!null\n" +
   489  			"         ├─ InnerJoin\n" +
   490  			"         │   ├─ Eq\n" +
   491  			"         │   │   ├─ t.id:0!null\n" +
   492  			"         │   │   └─ mc.movie_id:3!null\n" +
   493  			"         │   ├─ Filter\n" +
   494  			"         │   │   ├─ GreaterThan\n" +
   495  			"         │   │   │   ├─ t.production_year:2\n" +
   496  			"         │   │   │   └─ 1990 (smallint)\n" +
   497  			"         │   │   └─ TableAlias(t)\n" +
   498  			"         │   │       └─ ProcessTable\n" +
   499  			"         │   │           └─ Table\n" +
   500  			"         │   │               ├─ name: title\n" +
   501  			"         │   │               └─ columns: [id title production_year]\n" +
   502  			"         │   └─ InnerJoin\n" +
   503  			"         │       ├─ Eq\n" +
   504  			"         │       │   ├─ ct.id:8!null\n" +
   505  			"         │       │   └─ mc.company_type_id:5!null\n" +
   506  			"         │       ├─ InnerJoin\n" +
   507  			"         │       │   ├─ Eq\n" +
   508  			"         │       │   │   ├─ cn.id:6!null\n" +
   509  			"         │       │   │   └─ mc.company_id:4!null\n" +
   510  			"         │       │   ├─ TableAlias(mc)\n" +
   511  			"         │       │   │   └─ ProcessTable\n" +
   512  			"         │       │   │       └─ Table\n" +
   513  			"         │       │   │           ├─ name: movie_companies\n" +
   514  			"         │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
   515  			"         │       │   └─ Filter\n" +
   516  			"         │       │       ├─ Eq\n" +
   517  			"         │       │       │   ├─ cn.country_code:1\n" +
   518  			"         │       │       │   └─ [us] (longtext)\n" +
   519  			"         │       │       └─ TableAlias(cn)\n" +
   520  			"         │       │           └─ ProcessTable\n" +
   521  			"         │       │               └─ Table\n" +
   522  			"         │       │                   ├─ name: company_name\n" +
   523  			"         │       │                   └─ columns: [id country_code]\n" +
   524  			"         │       └─ TableAlias(ct)\n" +
   525  			"         │           └─ ProcessTable\n" +
   526  			"         │               └─ Table\n" +
   527  			"         │                   ├─ name: company_type\n" +
   528  			"         │                   └─ columns: [id]\n" +
   529  			"         └─ InnerJoin\n" +
   530  			"             ├─ Eq\n" +
   531  			"             │   ├─ rt.id:9!null\n" +
   532  			"             │   └─ ci.role_id:13!null\n" +
   533  			"             ├─ TableAlias(rt)\n" +
   534  			"             │   └─ ProcessTable\n" +
   535  			"             │       └─ Table\n" +
   536  			"             │           ├─ name: role_type\n" +
   537  			"             │           └─ columns: [id]\n" +
   538  			"             └─ InnerJoin\n" +
   539  			"                 ├─ Eq\n" +
   540  			"                 │   ├─ chn.id:14!null\n" +
   541  			"                 │   └─ ci.person_role_id:11\n" +
   542  			"                 ├─ Filter\n" +
   543  			"                 │   ├─ ci.note LIKE '%(producer)%'\n" +
   544  			"                 │   └─ TableAlias(ci)\n" +
   545  			"                 │       └─ ProcessTable\n" +
   546  			"                 │           └─ Table\n" +
   547  			"                 │               ├─ name: cast_info\n" +
   548  			"                 │               └─ columns: [movie_id person_role_id note role_id]\n" +
   549  			"                 └─ TableAlias(chn)\n" +
   550  			"                     └─ ProcessTable\n" +
   551  			"                         └─ Table\n" +
   552  			"                             ├─ name: char_name\n" +
   553  			"                             └─ columns: [id name]\n" +
   554  			"",
   555  		ExpectedEstimates: "Project\n" +
   556  			" ├─ columns: [min(chn.name) as character, min(t.title) as movie_with_american_producer]\n" +
   557  			" └─ GroupBy\n" +
   558  			"     ├─ SelectedExprs(MIN(chn.name), MIN(t.title))\n" +
   559  			"     ├─ Grouping()\n" +
   560  			"     └─ InnerJoin\n" +
   561  			"         ├─ ((ci.movie_id = mc.movie_id) AND (t.id = ci.movie_id))\n" +
   562  			"         ├─ InnerJoin\n" +
   563  			"         │   ├─ (t.id = mc.movie_id)\n" +
   564  			"         │   ├─ Filter\n" +
   565  			"         │   │   ├─ (t.production_year > 1990)\n" +
   566  			"         │   │   └─ TableAlias(t)\n" +
   567  			"         │   │       └─ Table\n" +
   568  			"         │   │           ├─ name: title\n" +
   569  			"         │   │           └─ columns: [id title production_year]\n" +
   570  			"         │   └─ InnerJoin\n" +
   571  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
   572  			"         │       ├─ InnerJoin\n" +
   573  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
   574  			"         │       │   ├─ TableAlias(mc)\n" +
   575  			"         │       │   │   └─ Table\n" +
   576  			"         │       │   │       ├─ name: movie_companies\n" +
   577  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
   578  			"         │       │   └─ Filter\n" +
   579  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
   580  			"         │       │       └─ TableAlias(cn)\n" +
   581  			"         │       │           └─ Table\n" +
   582  			"         │       │               ├─ name: company_name\n" +
   583  			"         │       │               └─ columns: [id country_code]\n" +
   584  			"         │       └─ TableAlias(ct)\n" +
   585  			"         │           └─ Table\n" +
   586  			"         │               ├─ name: company_type\n" +
   587  			"         │               └─ columns: [id]\n" +
   588  			"         └─ InnerJoin\n" +
   589  			"             ├─ (rt.id = ci.role_id)\n" +
   590  			"             ├─ TableAlias(rt)\n" +
   591  			"             │   └─ Table\n" +
   592  			"             │       ├─ name: role_type\n" +
   593  			"             │       └─ columns: [id]\n" +
   594  			"             └─ InnerJoin\n" +
   595  			"                 ├─ (chn.id = ci.person_role_id)\n" +
   596  			"                 ├─ Filter\n" +
   597  			"                 │   ├─ ci.note LIKE '%(producer)%'\n" +
   598  			"                 │   └─ TableAlias(ci)\n" +
   599  			"                 │       └─ Table\n" +
   600  			"                 │           ├─ name: cast_info\n" +
   601  			"                 │           └─ columns: [movie_id person_role_id note role_id]\n" +
   602  			"                 └─ TableAlias(chn)\n" +
   603  			"                     └─ Table\n" +
   604  			"                         ├─ name: char_name\n" +
   605  			"                         └─ columns: [id name]\n" +
   606  			"",
   607  		ExpectedAnalysis: "Project\n" +
   608  			" ├─ columns: [min(chn.name) as character, min(t.title) as movie_with_american_producer]\n" +
   609  			" └─ GroupBy\n" +
   610  			"     ├─ SelectedExprs(MIN(chn.name), MIN(t.title))\n" +
   611  			"     ├─ Grouping()\n" +
   612  			"     └─ InnerJoin\n" +
   613  			"         ├─ ((ci.movie_id = mc.movie_id) AND (t.id = ci.movie_id))\n" +
   614  			"         ├─ InnerJoin\n" +
   615  			"         │   ├─ (t.id = mc.movie_id)\n" +
   616  			"         │   ├─ Filter\n" +
   617  			"         │   │   ├─ (t.production_year > 1990)\n" +
   618  			"         │   │   └─ TableAlias(t)\n" +
   619  			"         │   │       └─ Table\n" +
   620  			"         │   │           ├─ name: title\n" +
   621  			"         │   │           └─ columns: [id title production_year]\n" +
   622  			"         │   └─ InnerJoin\n" +
   623  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
   624  			"         │       ├─ InnerJoin\n" +
   625  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
   626  			"         │       │   ├─ TableAlias(mc)\n" +
   627  			"         │       │   │   └─ Table\n" +
   628  			"         │       │   │       ├─ name: movie_companies\n" +
   629  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
   630  			"         │       │   └─ Filter\n" +
   631  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
   632  			"         │       │       └─ TableAlias(cn)\n" +
   633  			"         │       │           └─ Table\n" +
   634  			"         │       │               ├─ name: company_name\n" +
   635  			"         │       │               └─ columns: [id country_code]\n" +
   636  			"         │       └─ TableAlias(ct)\n" +
   637  			"         │           └─ Table\n" +
   638  			"         │               ├─ name: company_type\n" +
   639  			"         │               └─ columns: [id]\n" +
   640  			"         └─ InnerJoin\n" +
   641  			"             ├─ (rt.id = ci.role_id)\n" +
   642  			"             ├─ TableAlias(rt)\n" +
   643  			"             │   └─ Table\n" +
   644  			"             │       ├─ name: role_type\n" +
   645  			"             │       └─ columns: [id]\n" +
   646  			"             └─ InnerJoin\n" +
   647  			"                 ├─ (chn.id = ci.person_role_id)\n" +
   648  			"                 ├─ Filter\n" +
   649  			"                 │   ├─ ci.note LIKE '%(producer)%'\n" +
   650  			"                 │   └─ TableAlias(ci)\n" +
   651  			"                 │       └─ Table\n" +
   652  			"                 │           ├─ name: cast_info\n" +
   653  			"                 │           └─ columns: [movie_id person_role_id note role_id]\n" +
   654  			"                 └─ TableAlias(chn)\n" +
   655  			"                     └─ Table\n" +
   656  			"                         ├─ name: char_name\n" +
   657  			"                         └─ columns: [id name]\n" +
   658  			"",
   659  	},
   660  	{
   661  		Query: `
   662  SELECT MIN(cn.name) AS from_company,
   663         MIN(lt.link) AS movie_link_type,
   664         MIN(t.title) AS non_polish_sequel_movie
   665  FROM company_name AS cn,
   666       company_type AS ct,
   667       keyword AS k,
   668       link_type AS lt,
   669       movie_companies AS mc,
   670       movie_keyword AS mk,
   671       movie_link AS ml,
   672       title AS t
   673  WHERE cn.country_code !='[pl]'
   674    AND (cn.name LIKE '%Film%'
   675         OR cn.name LIKE '%Warner%')
   676    AND ct.kind ='production companies'
   677    AND k.keyword ='sequel'
   678    AND lt.link LIKE '%follow%'
   679    AND mc.note IS NULL
   680    AND t.production_year BETWEEN 1950 AND 2000
   681    AND lt.id = ml.link_type_id
   682    AND ml.movie_id = t.id
   683    AND t.id = mk.movie_id
   684    AND mk.keyword_id = k.id
   685    AND t.id = mc.movie_id
   686    AND mc.company_type_id = ct.id
   687    AND mc.company_id = cn.id
   688    AND ml.movie_id = mk.movie_id
   689    AND ml.movie_id = mc.movie_id
   690    AND mk.movie_id = mc.movie_id;
   691  
   692  `,
   693  		ExpectedPlan: "Project\n" +
   694  			" ├─ columns: [min(cn.name):0!null as from_company, min(lt.link):1!null as movie_link_type, min(t.title):2!null as non_polish_sequel_movie]\n" +
   695  			" └─ GroupBy\n" +
   696  			"     ├─ select: MIN(cn.name:11!null), MIN(lt.link:5!null), MIN(t.title:18!null)\n" +
   697  			"     ├─ group: \n" +
   698  			"     └─ HashJoin\n" +
   699  			"         ├─ AND\n" +
   700  			"         │   ├─ AND\n" +
   701  			"         │   │   ├─ Eq\n" +
   702  			"         │   │   │   ├─ ml.movie_id:2!null\n" +
   703  			"         │   │   │   └─ t.id:17!null\n" +
   704  			"         │   │   └─ Eq\n" +
   705  			"         │   │       ├─ t.id:17!null\n" +
   706  			"         │   │       └─ mk.movie_id:15!null\n" +
   707  			"         │   └─ Eq\n" +
   708  			"         │       ├─ t.id:17!null\n" +
   709  			"         │       └─ mc.movie_id:6!null\n" +
   710  			"         ├─ HashJoin\n" +
   711  			"         │   ├─ Eq\n" +
   712  			"         │   │   ├─ mk.keyword_id:16!null\n" +
   713  			"         │   │   └─ k.id:0!null\n" +
   714  			"         │   ├─ Filter\n" +
   715  			"         │   │   ├─ Eq\n" +
   716  			"         │   │   │   ├─ k.keyword:1!null\n" +
   717  			"         │   │   │   └─ sequel (longtext)\n" +
   718  			"         │   │   └─ TableAlias(k)\n" +
   719  			"         │   │       └─ ProcessTable\n" +
   720  			"         │   │           └─ Table\n" +
   721  			"         │   │               ├─ name: keyword\n" +
   722  			"         │   │               └─ columns: [id keyword]\n" +
   723  			"         │   └─ HashLookup\n" +
   724  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
   725  			"         │       ├─ right-key: TUPLE(mk.keyword_id:14!null)\n" +
   726  			"         │       └─ LookupJoin\n" +
   727  			"         │           ├─ Eq\n" +
   728  			"         │           │   ├─ ml.movie_id:2!null\n" +
   729  			"         │           │   └─ mk.movie_id:15!null\n" +
   730  			"         │           ├─ InnerJoin\n" +
   731  			"         │           │   ├─ Eq\n" +
   732  			"         │           │   │   ├─ ml.movie_id:2!null\n" +
   733  			"         │           │   │   └─ mc.movie_id:6!null\n" +
   734  			"         │           │   ├─ InnerJoin\n" +
   735  			"         │           │   │   ├─ Eq\n" +
   736  			"         │           │   │   │   ├─ lt.id:4!null\n" +
   737  			"         │           │   │   │   └─ ml.link_type_id:3!null\n" +
   738  			"         │           │   │   ├─ TableAlias(ml)\n" +
   739  			"         │           │   │   │   └─ ProcessTable\n" +
   740  			"         │           │   │   │       └─ Table\n" +
   741  			"         │           │   │   │           ├─ name: movie_link\n" +
   742  			"         │           │   │   │           └─ columns: [movie_id link_type_id]\n" +
   743  			"         │           │   │   └─ Filter\n" +
   744  			"         │           │   │       ├─ lt.link LIKE '%follow%'\n" +
   745  			"         │           │   │       └─ TableAlias(lt)\n" +
   746  			"         │           │   │           └─ ProcessTable\n" +
   747  			"         │           │   │               └─ Table\n" +
   748  			"         │           │   │                   ├─ name: link_type\n" +
   749  			"         │           │   │                   └─ columns: [id link]\n" +
   750  			"         │           │   └─ InnerJoin\n" +
   751  			"         │           │       ├─ Eq\n" +
   752  			"         │           │       │   ├─ mc.company_type_id:8!null\n" +
   753  			"         │           │       │   └─ ct.id:13!null\n" +
   754  			"         │           │       ├─ InnerJoin\n" +
   755  			"         │           │       │   ├─ Eq\n" +
   756  			"         │           │       │   │   ├─ mc.company_id:7!null\n" +
   757  			"         │           │       │   │   └─ cn.id:10!null\n" +
   758  			"         │           │       │   ├─ Filter\n" +
   759  			"         │           │       │   │   ├─ mc.note:3 IS NULL\n" +
   760  			"         │           │       │   │   └─ TableAlias(mc)\n" +
   761  			"         │           │       │   │       └─ ProcessTable\n" +
   762  			"         │           │       │   │           └─ Table\n" +
   763  			"         │           │       │   │               ├─ name: movie_companies\n" +
   764  			"         │           │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
   765  			"         │           │       │   └─ Filter\n" +
   766  			"         │           │       │       ├─ AND\n" +
   767  			"         │           │       │       │   ├─ NOT\n" +
   768  			"         │           │       │       │   │   └─ Eq\n" +
   769  			"         │           │       │       │   │       ├─ cn.country_code:2\n" +
   770  			"         │           │       │       │   │       └─ [pl] (longtext)\n" +
   771  			"         │           │       │       │   └─ Or\n" +
   772  			"         │           │       │       │       ├─ cn.name LIKE '%Film%'\n" +
   773  			"         │           │       │       │       └─ cn.name LIKE '%Warner%'\n" +
   774  			"         │           │       │       └─ TableAlias(cn)\n" +
   775  			"         │           │       │           └─ ProcessTable\n" +
   776  			"         │           │       │               └─ Table\n" +
   777  			"         │           │       │                   ├─ name: company_name\n" +
   778  			"         │           │       │                   └─ columns: [id name country_code]\n" +
   779  			"         │           │       └─ Filter\n" +
   780  			"         │           │           ├─ Eq\n" +
   781  			"         │           │           │   ├─ ct.kind:1!null\n" +
   782  			"         │           │           │   └─ production companies (longtext)\n" +
   783  			"         │           │           └─ TableAlias(ct)\n" +
   784  			"         │           │               └─ ProcessTable\n" +
   785  			"         │           │                   └─ Table\n" +
   786  			"         │           │                       ├─ name: company_type\n" +
   787  			"         │           │                       └─ columns: [id kind]\n" +
   788  			"         │           └─ TableAlias(mk)\n" +
   789  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
   790  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
   791  			"         │                   ├─ keys: [mc.movie_id:6!null]\n" +
   792  			"         │                   ├─ colSet: (20-22)\n" +
   793  			"         │                   ├─ tableId: 6\n" +
   794  			"         │                   └─ Table\n" +
   795  			"         │                       ├─ name: movie_keyword\n" +
   796  			"         │                       └─ columns: [movie_id keyword_id]\n" +
   797  			"         └─ HashLookup\n" +
   798  			"             ├─ left-key: TUPLE(ml.movie_id:2!null, mk.movie_id:15!null, mc.movie_id:6!null)\n" +
   799  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
   800  			"             └─ Filter\n" +
   801  			"                 ├─ AND\n" +
   802  			"                 │   ├─ GreaterThanOrEqual\n" +
   803  			"                 │   │   ├─ t.production_year:2\n" +
   804  			"                 │   │   └─ 1950 (smallint)\n" +
   805  			"                 │   └─ LessThanOrEqual\n" +
   806  			"                 │       ├─ t.production_year:2\n" +
   807  			"                 │       └─ 2000 (smallint)\n" +
   808  			"                 └─ TableAlias(t)\n" +
   809  			"                     └─ ProcessTable\n" +
   810  			"                         └─ Table\n" +
   811  			"                             ├─ name: title\n" +
   812  			"                             └─ columns: [id title production_year]\n" +
   813  			"",
   814  		ExpectedEstimates: "Project\n" +
   815  			" ├─ columns: [min(cn.name) as from_company, min(lt.link) as movie_link_type, min(t.title) as non_polish_sequel_movie]\n" +
   816  			" └─ GroupBy\n" +
   817  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
   818  			"     ├─ Grouping()\n" +
   819  			"     └─ HashJoin\n" +
   820  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
   821  			"         ├─ HashJoin\n" +
   822  			"         │   ├─ (mk.keyword_id = k.id)\n" +
   823  			"         │   ├─ Filter\n" +
   824  			"         │   │   ├─ (k.keyword = 'sequel')\n" +
   825  			"         │   │   └─ TableAlias(k)\n" +
   826  			"         │   │       └─ Table\n" +
   827  			"         │   │           ├─ name: keyword\n" +
   828  			"         │   │           └─ columns: [id keyword]\n" +
   829  			"         │   └─ HashLookup\n" +
   830  			"         │       ├─ left-key: (k.id)\n" +
   831  			"         │       ├─ right-key: (mk.keyword_id)\n" +
   832  			"         │       └─ LookupJoin\n" +
   833  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
   834  			"         │           ├─ InnerJoin\n" +
   835  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
   836  			"         │           │   ├─ InnerJoin\n" +
   837  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
   838  			"         │           │   │   ├─ TableAlias(ml)\n" +
   839  			"         │           │   │   │   └─ Table\n" +
   840  			"         │           │   │   │       ├─ name: movie_link\n" +
   841  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
   842  			"         │           │   │   └─ Filter\n" +
   843  			"         │           │   │       ├─ lt.link LIKE '%follow%'\n" +
   844  			"         │           │   │       └─ TableAlias(lt)\n" +
   845  			"         │           │   │           └─ Table\n" +
   846  			"         │           │   │               ├─ name: link_type\n" +
   847  			"         │           │   │               └─ columns: [id link]\n" +
   848  			"         │           │   └─ InnerJoin\n" +
   849  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
   850  			"         │           │       ├─ InnerJoin\n" +
   851  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
   852  			"         │           │       │   ├─ Filter\n" +
   853  			"         │           │       │   │   ├─ mc.note IS NULL\n" +
   854  			"         │           │       │   │   └─ TableAlias(mc)\n" +
   855  			"         │           │       │   │       └─ Table\n" +
   856  			"         │           │       │   │           ├─ name: movie_companies\n" +
   857  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
   858  			"         │           │       │   └─ Filter\n" +
   859  			"         │           │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
   860  			"         │           │       │       └─ TableAlias(cn)\n" +
   861  			"         │           │       │           └─ Table\n" +
   862  			"         │           │       │               ├─ name: company_name\n" +
   863  			"         │           │       │               └─ columns: [id name country_code]\n" +
   864  			"         │           │       └─ Filter\n" +
   865  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
   866  			"         │           │           └─ TableAlias(ct)\n" +
   867  			"         │           │               └─ Table\n" +
   868  			"         │           │                   ├─ name: company_type\n" +
   869  			"         │           │                   └─ columns: [id kind]\n" +
   870  			"         │           └─ TableAlias(mk)\n" +
   871  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
   872  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
   873  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
   874  			"         │                   └─ keys: mc.movie_id\n" +
   875  			"         └─ HashLookup\n" +
   876  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
   877  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
   878  			"             └─ Filter\n" +
   879  			"                 ├─ ((t.production_year >= 1950) AND (t.production_year <= 2000))\n" +
   880  			"                 └─ TableAlias(t)\n" +
   881  			"                     └─ Table\n" +
   882  			"                         ├─ name: title\n" +
   883  			"                         └─ columns: [id title production_year]\n" +
   884  			"",
   885  		ExpectedAnalysis: "Project\n" +
   886  			" ├─ columns: [min(cn.name) as from_company, min(lt.link) as movie_link_type, min(t.title) as non_polish_sequel_movie]\n" +
   887  			" └─ GroupBy\n" +
   888  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
   889  			"     ├─ Grouping()\n" +
   890  			"     └─ HashJoin\n" +
   891  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
   892  			"         ├─ HashJoin\n" +
   893  			"         │   ├─ (mk.keyword_id = k.id)\n" +
   894  			"         │   ├─ Filter\n" +
   895  			"         │   │   ├─ (k.keyword = 'sequel')\n" +
   896  			"         │   │   └─ TableAlias(k)\n" +
   897  			"         │   │       └─ Table\n" +
   898  			"         │   │           ├─ name: keyword\n" +
   899  			"         │   │           └─ columns: [id keyword]\n" +
   900  			"         │   └─ HashLookup\n" +
   901  			"         │       ├─ left-key: (k.id)\n" +
   902  			"         │       ├─ right-key: (mk.keyword_id)\n" +
   903  			"         │       └─ LookupJoin\n" +
   904  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
   905  			"         │           ├─ InnerJoin\n" +
   906  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
   907  			"         │           │   ├─ InnerJoin\n" +
   908  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
   909  			"         │           │   │   ├─ TableAlias(ml)\n" +
   910  			"         │           │   │   │   └─ Table\n" +
   911  			"         │           │   │   │       ├─ name: movie_link\n" +
   912  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
   913  			"         │           │   │   └─ Filter\n" +
   914  			"         │           │   │       ├─ lt.link LIKE '%follow%'\n" +
   915  			"         │           │   │       └─ TableAlias(lt)\n" +
   916  			"         │           │   │           └─ Table\n" +
   917  			"         │           │   │               ├─ name: link_type\n" +
   918  			"         │           │   │               └─ columns: [id link]\n" +
   919  			"         │           │   └─ InnerJoin\n" +
   920  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
   921  			"         │           │       ├─ InnerJoin\n" +
   922  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
   923  			"         │           │       │   ├─ Filter\n" +
   924  			"         │           │       │   │   ├─ mc.note IS NULL\n" +
   925  			"         │           │       │   │   └─ TableAlias(mc)\n" +
   926  			"         │           │       │   │       └─ Table\n" +
   927  			"         │           │       │   │           ├─ name: movie_companies\n" +
   928  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
   929  			"         │           │       │   └─ Filter\n" +
   930  			"         │           │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
   931  			"         │           │       │       └─ TableAlias(cn)\n" +
   932  			"         │           │       │           └─ Table\n" +
   933  			"         │           │       │               ├─ name: company_name\n" +
   934  			"         │           │       │               └─ columns: [id name country_code]\n" +
   935  			"         │           │       └─ Filter\n" +
   936  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
   937  			"         │           │           └─ TableAlias(ct)\n" +
   938  			"         │           │               └─ Table\n" +
   939  			"         │           │                   ├─ name: company_type\n" +
   940  			"         │           │                   └─ columns: [id kind]\n" +
   941  			"         │           └─ TableAlias(mk)\n" +
   942  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
   943  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
   944  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
   945  			"         │                   └─ keys: mc.movie_id\n" +
   946  			"         └─ HashLookup\n" +
   947  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
   948  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
   949  			"             └─ Filter\n" +
   950  			"                 ├─ ((t.production_year >= 1950) AND (t.production_year <= 2000))\n" +
   951  			"                 └─ TableAlias(t)\n" +
   952  			"                     └─ Table\n" +
   953  			"                         ├─ name: title\n" +
   954  			"                         └─ columns: [id title production_year]\n" +
   955  			"",
   956  	},
   957  	{
   958  		Query: `
   959  SELECT MIN(cn.name) AS from_company,
   960         MIN(lt.link) AS movie_link_type,
   961         MIN(t.title) AS sequel_movie
   962  FROM company_name AS cn,
   963       company_type AS ct,
   964       keyword AS k,
   965       link_type AS lt,
   966       movie_companies AS mc,
   967       movie_keyword AS mk,
   968       movie_link AS ml,
   969       title AS t
   970  WHERE cn.country_code !='[pl]'
   971    AND (cn.name LIKE '%Film%'
   972         OR cn.name LIKE '%Warner%')
   973    AND ct.kind ='production companies'
   974    AND k.keyword ='sequel'
   975    AND lt.link LIKE '%follows%'
   976    AND mc.note IS NULL
   977    AND t.production_year = 1998
   978    AND t.title LIKE '%Money%'
   979    AND lt.id = ml.link_type_id
   980    AND ml.movie_id = t.id
   981    AND t.id = mk.movie_id
   982    AND mk.keyword_id = k.id
   983    AND t.id = mc.movie_id
   984    AND mc.company_type_id = ct.id
   985    AND mc.company_id = cn.id
   986    AND ml.movie_id = mk.movie_id
   987    AND ml.movie_id = mc.movie_id
   988    AND mk.movie_id = mc.movie_id;
   989  
   990  `,
   991  		ExpectedPlan: "Project\n" +
   992  			" ├─ columns: [min(cn.name):0!null as from_company, min(lt.link):1!null as movie_link_type, min(t.title):2!null as sequel_movie]\n" +
   993  			" └─ GroupBy\n" +
   994  			"     ├─ select: MIN(cn.name:11!null), MIN(lt.link:5!null), MIN(t.title:18!null)\n" +
   995  			"     ├─ group: \n" +
   996  			"     └─ HashJoin\n" +
   997  			"         ├─ AND\n" +
   998  			"         │   ├─ AND\n" +
   999  			"         │   │   ├─ Eq\n" +
  1000  			"         │   │   │   ├─ ml.movie_id:2!null\n" +
  1001  			"         │   │   │   └─ t.id:17!null\n" +
  1002  			"         │   │   └─ Eq\n" +
  1003  			"         │   │       ├─ t.id:17!null\n" +
  1004  			"         │   │       └─ mk.movie_id:15!null\n" +
  1005  			"         │   └─ Eq\n" +
  1006  			"         │       ├─ t.id:17!null\n" +
  1007  			"         │       └─ mc.movie_id:6!null\n" +
  1008  			"         ├─ HashJoin\n" +
  1009  			"         │   ├─ Eq\n" +
  1010  			"         │   │   ├─ mk.keyword_id:16!null\n" +
  1011  			"         │   │   └─ k.id:0!null\n" +
  1012  			"         │   ├─ Filter\n" +
  1013  			"         │   │   ├─ Eq\n" +
  1014  			"         │   │   │   ├─ k.keyword:1!null\n" +
  1015  			"         │   │   │   └─ sequel (longtext)\n" +
  1016  			"         │   │   └─ TableAlias(k)\n" +
  1017  			"         │   │       └─ ProcessTable\n" +
  1018  			"         │   │           └─ Table\n" +
  1019  			"         │   │               ├─ name: keyword\n" +
  1020  			"         │   │               └─ columns: [id keyword]\n" +
  1021  			"         │   └─ HashLookup\n" +
  1022  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  1023  			"         │       ├─ right-key: TUPLE(mk.keyword_id:14!null)\n" +
  1024  			"         │       └─ LookupJoin\n" +
  1025  			"         │           ├─ Eq\n" +
  1026  			"         │           │   ├─ ml.movie_id:2!null\n" +
  1027  			"         │           │   └─ mk.movie_id:15!null\n" +
  1028  			"         │           ├─ InnerJoin\n" +
  1029  			"         │           │   ├─ Eq\n" +
  1030  			"         │           │   │   ├─ ml.movie_id:2!null\n" +
  1031  			"         │           │   │   └─ mc.movie_id:6!null\n" +
  1032  			"         │           │   ├─ InnerJoin\n" +
  1033  			"         │           │   │   ├─ Eq\n" +
  1034  			"         │           │   │   │   ├─ lt.id:4!null\n" +
  1035  			"         │           │   │   │   └─ ml.link_type_id:3!null\n" +
  1036  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1037  			"         │           │   │   │   └─ ProcessTable\n" +
  1038  			"         │           │   │   │       └─ Table\n" +
  1039  			"         │           │   │   │           ├─ name: movie_link\n" +
  1040  			"         │           │   │   │           └─ columns: [movie_id link_type_id]\n" +
  1041  			"         │           │   │   └─ Filter\n" +
  1042  			"         │           │   │       ├─ lt.link LIKE '%follows%'\n" +
  1043  			"         │           │   │       └─ TableAlias(lt)\n" +
  1044  			"         │           │   │           └─ ProcessTable\n" +
  1045  			"         │           │   │               └─ Table\n" +
  1046  			"         │           │   │                   ├─ name: link_type\n" +
  1047  			"         │           │   │                   └─ columns: [id link]\n" +
  1048  			"         │           │   └─ InnerJoin\n" +
  1049  			"         │           │       ├─ Eq\n" +
  1050  			"         │           │       │   ├─ mc.company_type_id:8!null\n" +
  1051  			"         │           │       │   └─ ct.id:13!null\n" +
  1052  			"         │           │       ├─ InnerJoin\n" +
  1053  			"         │           │       │   ├─ Eq\n" +
  1054  			"         │           │       │   │   ├─ mc.company_id:7!null\n" +
  1055  			"         │           │       │   │   └─ cn.id:10!null\n" +
  1056  			"         │           │       │   ├─ Filter\n" +
  1057  			"         │           │       │   │   ├─ mc.note:3 IS NULL\n" +
  1058  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1059  			"         │           │       │   │       └─ ProcessTable\n" +
  1060  			"         │           │       │   │           └─ Table\n" +
  1061  			"         │           │       │   │               ├─ name: movie_companies\n" +
  1062  			"         │           │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
  1063  			"         │           │       │   └─ Filter\n" +
  1064  			"         │           │       │       ├─ AND\n" +
  1065  			"         │           │       │       │   ├─ NOT\n" +
  1066  			"         │           │       │       │   │   └─ Eq\n" +
  1067  			"         │           │       │       │   │       ├─ cn.country_code:2\n" +
  1068  			"         │           │       │       │   │       └─ [pl] (longtext)\n" +
  1069  			"         │           │       │       │   └─ Or\n" +
  1070  			"         │           │       │       │       ├─ cn.name LIKE '%Film%'\n" +
  1071  			"         │           │       │       │       └─ cn.name LIKE '%Warner%'\n" +
  1072  			"         │           │       │       └─ TableAlias(cn)\n" +
  1073  			"         │           │       │           └─ ProcessTable\n" +
  1074  			"         │           │       │               └─ Table\n" +
  1075  			"         │           │       │                   ├─ name: company_name\n" +
  1076  			"         │           │       │                   └─ columns: [id name country_code]\n" +
  1077  			"         │           │       └─ Filter\n" +
  1078  			"         │           │           ├─ Eq\n" +
  1079  			"         │           │           │   ├─ ct.kind:1!null\n" +
  1080  			"         │           │           │   └─ production companies (longtext)\n" +
  1081  			"         │           │           └─ TableAlias(ct)\n" +
  1082  			"         │           │               └─ ProcessTable\n" +
  1083  			"         │           │                   └─ Table\n" +
  1084  			"         │           │                       ├─ name: company_type\n" +
  1085  			"         │           │                       └─ columns: [id kind]\n" +
  1086  			"         │           └─ TableAlias(mk)\n" +
  1087  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1088  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1089  			"         │                   ├─ keys: [mc.movie_id:6!null]\n" +
  1090  			"         │                   ├─ colSet: (20-22)\n" +
  1091  			"         │                   ├─ tableId: 6\n" +
  1092  			"         │                   └─ Table\n" +
  1093  			"         │                       ├─ name: movie_keyword\n" +
  1094  			"         │                       └─ columns: [movie_id keyword_id]\n" +
  1095  			"         └─ HashLookup\n" +
  1096  			"             ├─ left-key: TUPLE(ml.movie_id:2!null, mk.movie_id:15!null, mc.movie_id:6!null)\n" +
  1097  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  1098  			"             └─ Filter\n" +
  1099  			"                 ├─ AND\n" +
  1100  			"                 │   ├─ Eq\n" +
  1101  			"                 │   │   ├─ t.production_year:2\n" +
  1102  			"                 │   │   └─ 1998 (smallint)\n" +
  1103  			"                 │   └─ t.title LIKE '%Money%'\n" +
  1104  			"                 └─ TableAlias(t)\n" +
  1105  			"                     └─ ProcessTable\n" +
  1106  			"                         └─ Table\n" +
  1107  			"                             ├─ name: title\n" +
  1108  			"                             └─ columns: [id title production_year]\n" +
  1109  			"",
  1110  		ExpectedEstimates: "Project\n" +
  1111  			" ├─ columns: [min(cn.name) as from_company, min(lt.link) as movie_link_type, min(t.title) as sequel_movie]\n" +
  1112  			" └─ GroupBy\n" +
  1113  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
  1114  			"     ├─ Grouping()\n" +
  1115  			"     └─ HashJoin\n" +
  1116  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  1117  			"         ├─ HashJoin\n" +
  1118  			"         │   ├─ (mk.keyword_id = k.id)\n" +
  1119  			"         │   ├─ Filter\n" +
  1120  			"         │   │   ├─ (k.keyword = 'sequel')\n" +
  1121  			"         │   │   └─ TableAlias(k)\n" +
  1122  			"         │   │       └─ Table\n" +
  1123  			"         │   │           ├─ name: keyword\n" +
  1124  			"         │   │           └─ columns: [id keyword]\n" +
  1125  			"         │   └─ HashLookup\n" +
  1126  			"         │       ├─ left-key: (k.id)\n" +
  1127  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  1128  			"         │       └─ LookupJoin\n" +
  1129  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
  1130  			"         │           ├─ InnerJoin\n" +
  1131  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
  1132  			"         │           │   ├─ InnerJoin\n" +
  1133  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
  1134  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1135  			"         │           │   │   │   └─ Table\n" +
  1136  			"         │           │   │   │       ├─ name: movie_link\n" +
  1137  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
  1138  			"         │           │   │   └─ Filter\n" +
  1139  			"         │           │   │       ├─ lt.link LIKE '%follows%'\n" +
  1140  			"         │           │   │       └─ TableAlias(lt)\n" +
  1141  			"         │           │   │           └─ Table\n" +
  1142  			"         │           │   │               ├─ name: link_type\n" +
  1143  			"         │           │   │               └─ columns: [id link]\n" +
  1144  			"         │           │   └─ InnerJoin\n" +
  1145  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
  1146  			"         │           │       ├─ InnerJoin\n" +
  1147  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
  1148  			"         │           │       │   ├─ Filter\n" +
  1149  			"         │           │       │   │   ├─ mc.note IS NULL\n" +
  1150  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1151  			"         │           │       │   │       └─ Table\n" +
  1152  			"         │           │       │   │           ├─ name: movie_companies\n" +
  1153  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  1154  			"         │           │       │   └─ Filter\n" +
  1155  			"         │           │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
  1156  			"         │           │       │       └─ TableAlias(cn)\n" +
  1157  			"         │           │       │           └─ Table\n" +
  1158  			"         │           │       │               ├─ name: company_name\n" +
  1159  			"         │           │       │               └─ columns: [id name country_code]\n" +
  1160  			"         │           │       └─ Filter\n" +
  1161  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
  1162  			"         │           │           └─ TableAlias(ct)\n" +
  1163  			"         │           │               └─ Table\n" +
  1164  			"         │           │                   ├─ name: company_type\n" +
  1165  			"         │           │                   └─ columns: [id kind]\n" +
  1166  			"         │           └─ TableAlias(mk)\n" +
  1167  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1168  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1169  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
  1170  			"         │                   └─ keys: mc.movie_id\n" +
  1171  			"         └─ HashLookup\n" +
  1172  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
  1173  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  1174  			"             └─ Filter\n" +
  1175  			"                 ├─ ((t.production_year = 1998) AND t.title LIKE '%Money%')\n" +
  1176  			"                 └─ TableAlias(t)\n" +
  1177  			"                     └─ Table\n" +
  1178  			"                         ├─ name: title\n" +
  1179  			"                         └─ columns: [id title production_year]\n" +
  1180  			"",
  1181  		ExpectedAnalysis: "Project\n" +
  1182  			" ├─ columns: [min(cn.name) as from_company, min(lt.link) as movie_link_type, min(t.title) as sequel_movie]\n" +
  1183  			" └─ GroupBy\n" +
  1184  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
  1185  			"     ├─ Grouping()\n" +
  1186  			"     └─ HashJoin\n" +
  1187  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  1188  			"         ├─ HashJoin\n" +
  1189  			"         │   ├─ (mk.keyword_id = k.id)\n" +
  1190  			"         │   ├─ Filter\n" +
  1191  			"         │   │   ├─ (k.keyword = 'sequel')\n" +
  1192  			"         │   │   └─ TableAlias(k)\n" +
  1193  			"         │   │       └─ Table\n" +
  1194  			"         │   │           ├─ name: keyword\n" +
  1195  			"         │   │           └─ columns: [id keyword]\n" +
  1196  			"         │   └─ HashLookup\n" +
  1197  			"         │       ├─ left-key: (k.id)\n" +
  1198  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  1199  			"         │       └─ LookupJoin\n" +
  1200  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
  1201  			"         │           ├─ InnerJoin\n" +
  1202  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
  1203  			"         │           │   ├─ InnerJoin\n" +
  1204  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
  1205  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1206  			"         │           │   │   │   └─ Table\n" +
  1207  			"         │           │   │   │       ├─ name: movie_link\n" +
  1208  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
  1209  			"         │           │   │   └─ Filter\n" +
  1210  			"         │           │   │       ├─ lt.link LIKE '%follows%'\n" +
  1211  			"         │           │   │       └─ TableAlias(lt)\n" +
  1212  			"         │           │   │           └─ Table\n" +
  1213  			"         │           │   │               ├─ name: link_type\n" +
  1214  			"         │           │   │               └─ columns: [id link]\n" +
  1215  			"         │           │   └─ InnerJoin\n" +
  1216  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
  1217  			"         │           │       ├─ InnerJoin\n" +
  1218  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
  1219  			"         │           │       │   ├─ Filter\n" +
  1220  			"         │           │       │   │   ├─ mc.note IS NULL\n" +
  1221  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1222  			"         │           │       │   │       └─ Table\n" +
  1223  			"         │           │       │   │           ├─ name: movie_companies\n" +
  1224  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  1225  			"         │           │       │   └─ Filter\n" +
  1226  			"         │           │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
  1227  			"         │           │       │       └─ TableAlias(cn)\n" +
  1228  			"         │           │       │           └─ Table\n" +
  1229  			"         │           │       │               ├─ name: company_name\n" +
  1230  			"         │           │       │               └─ columns: [id name country_code]\n" +
  1231  			"         │           │       └─ Filter\n" +
  1232  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
  1233  			"         │           │           └─ TableAlias(ct)\n" +
  1234  			"         │           │               └─ Table\n" +
  1235  			"         │           │                   ├─ name: company_type\n" +
  1236  			"         │           │                   └─ columns: [id kind]\n" +
  1237  			"         │           └─ TableAlias(mk)\n" +
  1238  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1239  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1240  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
  1241  			"         │                   └─ keys: mc.movie_id\n" +
  1242  			"         └─ HashLookup\n" +
  1243  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
  1244  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  1245  			"             └─ Filter\n" +
  1246  			"                 ├─ ((t.production_year = 1998) AND t.title LIKE '%Money%')\n" +
  1247  			"                 └─ TableAlias(t)\n" +
  1248  			"                     └─ Table\n" +
  1249  			"                         ├─ name: title\n" +
  1250  			"                         └─ columns: [id title production_year]\n" +
  1251  			"",
  1252  	},
  1253  	{
  1254  		Query: `
  1255  SELECT MIN(cn.name) AS from_company,
  1256         MIN(mc.note) AS production_note,
  1257         MIN(t.title) AS movie_based_on_book
  1258  FROM company_name AS cn,
  1259       company_type AS ct,
  1260       keyword AS k,
  1261       link_type AS lt,
  1262       movie_companies AS mc,
  1263       movie_keyword AS mk,
  1264       movie_link AS ml,
  1265       title AS t
  1266  WHERE cn.country_code !='[pl]'
  1267    AND (cn.name LIKE '20th Century Fox%'
  1268         OR cn.name LIKE 'Twentieth Century Fox%')
  1269    AND ct.kind != 'production companies'
  1270    AND ct.kind IS NOT NULL
  1271    AND k.keyword IN ('sequel',
  1272                      'revenge',
  1273                      'based-on-novel')
  1274    AND mc.note IS NOT NULL
  1275    AND t.production_year > 1950
  1276    AND lt.id = ml.link_type_id
  1277    AND ml.movie_id = t.id
  1278    AND t.id = mk.movie_id
  1279    AND mk.keyword_id = k.id
  1280    AND t.id = mc.movie_id
  1281    AND mc.company_type_id = ct.id
  1282    AND mc.company_id = cn.id
  1283    AND ml.movie_id = mk.movie_id
  1284    AND ml.movie_id = mc.movie_id
  1285    AND mk.movie_id = mc.movie_id;
  1286  
  1287  `,
  1288  		ExpectedPlan: "Project\n" +
  1289  			" ├─ columns: [min(cn.name):0!null as from_company, min(mc.note):1!null as production_note, min(t.title):2!null as movie_based_on_book]\n" +
  1290  			" └─ GroupBy\n" +
  1291  			"     ├─ select: MIN(cn.name:10!null), MIN(mc.note:8), MIN(t.title:17!null)\n" +
  1292  			"     ├─ group: \n" +
  1293  			"     └─ HashJoin\n" +
  1294  			"         ├─ AND\n" +
  1295  			"         │   ├─ AND\n" +
  1296  			"         │   │   ├─ Eq\n" +
  1297  			"         │   │   │   ├─ ml.movie_id:2!null\n" +
  1298  			"         │   │   │   └─ t.id:16!null\n" +
  1299  			"         │   │   └─ Eq\n" +
  1300  			"         │   │       ├─ t.id:16!null\n" +
  1301  			"         │   │       └─ mk.movie_id:14!null\n" +
  1302  			"         │   └─ Eq\n" +
  1303  			"         │       ├─ t.id:16!null\n" +
  1304  			"         │       └─ mc.movie_id:5!null\n" +
  1305  			"         ├─ HashJoin\n" +
  1306  			"         │   ├─ Eq\n" +
  1307  			"         │   │   ├─ mk.keyword_id:15!null\n" +
  1308  			"         │   │   └─ k.id:0!null\n" +
  1309  			"         │   ├─ Filter\n" +
  1310  			"         │   │   ├─ HashIn\n" +
  1311  			"         │   │   │   ├─ k.keyword:1!null\n" +
  1312  			"         │   │   │   └─ TUPLE(sequel (longtext), revenge (longtext), based-on-novel (longtext))\n" +
  1313  			"         │   │   └─ TableAlias(k)\n" +
  1314  			"         │   │       └─ ProcessTable\n" +
  1315  			"         │   │           └─ Table\n" +
  1316  			"         │   │               ├─ name: keyword\n" +
  1317  			"         │   │               └─ columns: [id keyword]\n" +
  1318  			"         │   └─ HashLookup\n" +
  1319  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  1320  			"         │       ├─ right-key: TUPLE(mk.keyword_id:13!null)\n" +
  1321  			"         │       └─ LookupJoin\n" +
  1322  			"         │           ├─ Eq\n" +
  1323  			"         │           │   ├─ ml.movie_id:2!null\n" +
  1324  			"         │           │   └─ mk.movie_id:14!null\n" +
  1325  			"         │           ├─ InnerJoin\n" +
  1326  			"         │           │   ├─ Eq\n" +
  1327  			"         │           │   │   ├─ ml.movie_id:2!null\n" +
  1328  			"         │           │   │   └─ mc.movie_id:5!null\n" +
  1329  			"         │           │   ├─ InnerJoin\n" +
  1330  			"         │           │   │   ├─ Eq\n" +
  1331  			"         │           │   │   │   ├─ lt.id:4!null\n" +
  1332  			"         │           │   │   │   └─ ml.link_type_id:3!null\n" +
  1333  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1334  			"         │           │   │   │   └─ ProcessTable\n" +
  1335  			"         │           │   │   │       └─ Table\n" +
  1336  			"         │           │   │   │           ├─ name: movie_link\n" +
  1337  			"         │           │   │   │           └─ columns: [movie_id link_type_id]\n" +
  1338  			"         │           │   │   └─ TableAlias(lt)\n" +
  1339  			"         │           │   │       └─ ProcessTable\n" +
  1340  			"         │           │   │           └─ Table\n" +
  1341  			"         │           │   │               ├─ name: link_type\n" +
  1342  			"         │           │   │               └─ columns: [id]\n" +
  1343  			"         │           │   └─ InnerJoin\n" +
  1344  			"         │           │       ├─ Eq\n" +
  1345  			"         │           │       │   ├─ mc.company_type_id:7!null\n" +
  1346  			"         │           │       │   └─ ct.id:12!null\n" +
  1347  			"         │           │       ├─ InnerJoin\n" +
  1348  			"         │           │       │   ├─ Eq\n" +
  1349  			"         │           │       │   │   ├─ mc.company_id:6!null\n" +
  1350  			"         │           │       │   │   └─ cn.id:9!null\n" +
  1351  			"         │           │       │   ├─ Filter\n" +
  1352  			"         │           │       │   │   ├─ NOT\n" +
  1353  			"         │           │       │   │   │   └─ mc.note:3 IS NULL\n" +
  1354  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1355  			"         │           │       │   │       └─ ProcessTable\n" +
  1356  			"         │           │       │   │           └─ Table\n" +
  1357  			"         │           │       │   │               ├─ name: movie_companies\n" +
  1358  			"         │           │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
  1359  			"         │           │       │   └─ Filter\n" +
  1360  			"         │           │       │       ├─ AND\n" +
  1361  			"         │           │       │       │   ├─ NOT\n" +
  1362  			"         │           │       │       │   │   └─ Eq\n" +
  1363  			"         │           │       │       │   │       ├─ cn.country_code:2\n" +
  1364  			"         │           │       │       │   │       └─ [pl] (longtext)\n" +
  1365  			"         │           │       │       │   └─ Or\n" +
  1366  			"         │           │       │       │       ├─ AND\n" +
  1367  			"         │           │       │       │       │   ├─ GreaterThanOrEqual\n" +
  1368  			"         │           │       │       │       │   │   ├─ cn.name:1!null\n" +
  1369  			"         │           │       │       │       │   │   └─ 20th Century Fox (longtext)\n" +
  1370  			"         │           │       │       │       │   └─ LessThanOrEqual\n" +
  1371  			"         │           │       │       │       │       ├─ cn.name:1!null\n" +
  1372  			"         │           │       │       │       │       └─ 20th Century Foxÿ (longtext)\n" +
  1373  			"         │           │       │       │       └─ AND\n" +
  1374  			"         │           │       │       │           ├─ GreaterThanOrEqual\n" +
  1375  			"         │           │       │       │           │   ├─ cn.name:1!null\n" +
  1376  			"         │           │       │       │           │   └─ Twentieth Century Fox (longtext)\n" +
  1377  			"         │           │       │       │           └─ LessThanOrEqual\n" +
  1378  			"         │           │       │       │               ├─ cn.name:1!null\n" +
  1379  			"         │           │       │       │               └─ Twentieth Century Foxÿ (longtext)\n" +
  1380  			"         │           │       │       └─ TableAlias(cn)\n" +
  1381  			"         │           │       │           └─ ProcessTable\n" +
  1382  			"         │           │       │               └─ Table\n" +
  1383  			"         │           │       │                   ├─ name: company_name\n" +
  1384  			"         │           │       │                   └─ columns: [id name country_code]\n" +
  1385  			"         │           │       └─ Filter\n" +
  1386  			"         │           │           ├─ AND\n" +
  1387  			"         │           │           │   ├─ NOT\n" +
  1388  			"         │           │           │   │   └─ Eq\n" +
  1389  			"         │           │           │   │       ├─ ct.kind:1!null\n" +
  1390  			"         │           │           │   │       └─ production companies (longtext)\n" +
  1391  			"         │           │           │   └─ NOT\n" +
  1392  			"         │           │           │       └─ ct.kind:1!null IS NULL\n" +
  1393  			"         │           │           └─ TableAlias(ct)\n" +
  1394  			"         │           │               └─ ProcessTable\n" +
  1395  			"         │           │                   └─ Table\n" +
  1396  			"         │           │                       ├─ name: company_type\n" +
  1397  			"         │           │                       └─ columns: [id kind]\n" +
  1398  			"         │           └─ TableAlias(mk)\n" +
  1399  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1400  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1401  			"         │                   ├─ keys: [mc.movie_id:5!null]\n" +
  1402  			"         │                   ├─ colSet: (20-22)\n" +
  1403  			"         │                   ├─ tableId: 6\n" +
  1404  			"         │                   └─ Table\n" +
  1405  			"         │                       ├─ name: movie_keyword\n" +
  1406  			"         │                       └─ columns: [movie_id keyword_id]\n" +
  1407  			"         └─ HashLookup\n" +
  1408  			"             ├─ left-key: TUPLE(ml.movie_id:2!null, mk.movie_id:14!null, mc.movie_id:5!null)\n" +
  1409  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  1410  			"             └─ Filter\n" +
  1411  			"                 ├─ GreaterThan\n" +
  1412  			"                 │   ├─ t.production_year:2\n" +
  1413  			"                 │   └─ 1950 (smallint)\n" +
  1414  			"                 └─ TableAlias(t)\n" +
  1415  			"                     └─ ProcessTable\n" +
  1416  			"                         └─ Table\n" +
  1417  			"                             ├─ name: title\n" +
  1418  			"                             └─ columns: [id title production_year]\n" +
  1419  			"",
  1420  		ExpectedEstimates: "Project\n" +
  1421  			" ├─ columns: [min(cn.name) as from_company, min(mc.note) as production_note, min(t.title) as movie_based_on_book]\n" +
  1422  			" └─ GroupBy\n" +
  1423  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mc.note), MIN(t.title))\n" +
  1424  			"     ├─ Grouping()\n" +
  1425  			"     └─ HashJoin\n" +
  1426  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  1427  			"         ├─ HashJoin\n" +
  1428  			"         │   ├─ (mk.keyword_id = k.id)\n" +
  1429  			"         │   ├─ Filter\n" +
  1430  			"         │   │   ├─ (k.keyword HASH IN ('sequel', 'revenge', 'based-on-novel'))\n" +
  1431  			"         │   │   └─ TableAlias(k)\n" +
  1432  			"         │   │       └─ Table\n" +
  1433  			"         │   │           ├─ name: keyword\n" +
  1434  			"         │   │           └─ columns: [id keyword]\n" +
  1435  			"         │   └─ HashLookup\n" +
  1436  			"         │       ├─ left-key: (k.id)\n" +
  1437  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  1438  			"         │       └─ LookupJoin\n" +
  1439  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
  1440  			"         │           ├─ InnerJoin\n" +
  1441  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
  1442  			"         │           │   ├─ InnerJoin\n" +
  1443  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
  1444  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1445  			"         │           │   │   │   └─ Table\n" +
  1446  			"         │           │   │   │       ├─ name: movie_link\n" +
  1447  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
  1448  			"         │           │   │   └─ TableAlias(lt)\n" +
  1449  			"         │           │   │       └─ Table\n" +
  1450  			"         │           │   │           ├─ name: link_type\n" +
  1451  			"         │           │   │           └─ columns: [id]\n" +
  1452  			"         │           │   └─ InnerJoin\n" +
  1453  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
  1454  			"         │           │       ├─ InnerJoin\n" +
  1455  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
  1456  			"         │           │       │   ├─ Filter\n" +
  1457  			"         │           │       │   │   ├─ (NOT(mc.note IS NULL))\n" +
  1458  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1459  			"         │           │       │   │       └─ Table\n" +
  1460  			"         │           │       │   │           ├─ name: movie_companies\n" +
  1461  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  1462  			"         │           │       │   └─ Filter\n" +
  1463  			"         │           │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (((cn.name >= '20th Century Fox') AND (cn.name <= '20th Century Foxÿ')) OR ((cn.name >= 'Twentieth Century Fox') AND (cn.name <= 'Twentieth Century Foxÿ'))))\n" +
  1464  			"         │           │       │       └─ TableAlias(cn)\n" +
  1465  			"         │           │       │           └─ Table\n" +
  1466  			"         │           │       │               ├─ name: company_name\n" +
  1467  			"         │           │       │               └─ columns: [id name country_code]\n" +
  1468  			"         │           │       └─ Filter\n" +
  1469  			"         │           │           ├─ ((NOT((ct.kind = 'production companies'))) AND (NOT(ct.kind IS NULL)))\n" +
  1470  			"         │           │           └─ TableAlias(ct)\n" +
  1471  			"         │           │               └─ Table\n" +
  1472  			"         │           │                   ├─ name: company_type\n" +
  1473  			"         │           │                   └─ columns: [id kind]\n" +
  1474  			"         │           └─ TableAlias(mk)\n" +
  1475  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1476  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1477  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
  1478  			"         │                   └─ keys: mc.movie_id\n" +
  1479  			"         └─ HashLookup\n" +
  1480  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
  1481  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  1482  			"             └─ Filter\n" +
  1483  			"                 ├─ (t.production_year > 1950)\n" +
  1484  			"                 └─ TableAlias(t)\n" +
  1485  			"                     └─ Table\n" +
  1486  			"                         ├─ name: title\n" +
  1487  			"                         └─ columns: [id title production_year]\n" +
  1488  			"",
  1489  		ExpectedAnalysis: "Project\n" +
  1490  			" ├─ columns: [min(cn.name) as from_company, min(mc.note) as production_note, min(t.title) as movie_based_on_book]\n" +
  1491  			" └─ GroupBy\n" +
  1492  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mc.note), MIN(t.title))\n" +
  1493  			"     ├─ Grouping()\n" +
  1494  			"     └─ HashJoin\n" +
  1495  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  1496  			"         ├─ HashJoin\n" +
  1497  			"         │   ├─ (mk.keyword_id = k.id)\n" +
  1498  			"         │   ├─ Filter\n" +
  1499  			"         │   │   ├─ (k.keyword HASH IN ('sequel', 'revenge', 'based-on-novel'))\n" +
  1500  			"         │   │   └─ TableAlias(k)\n" +
  1501  			"         │   │       └─ Table\n" +
  1502  			"         │   │           ├─ name: keyword\n" +
  1503  			"         │   │           └─ columns: [id keyword]\n" +
  1504  			"         │   └─ HashLookup\n" +
  1505  			"         │       ├─ left-key: (k.id)\n" +
  1506  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  1507  			"         │       └─ LookupJoin\n" +
  1508  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
  1509  			"         │           ├─ InnerJoin\n" +
  1510  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
  1511  			"         │           │   ├─ InnerJoin\n" +
  1512  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
  1513  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1514  			"         │           │   │   │   └─ Table\n" +
  1515  			"         │           │   │   │       ├─ name: movie_link\n" +
  1516  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
  1517  			"         │           │   │   └─ TableAlias(lt)\n" +
  1518  			"         │           │   │       └─ Table\n" +
  1519  			"         │           │   │           ├─ name: link_type\n" +
  1520  			"         │           │   │           └─ columns: [id]\n" +
  1521  			"         │           │   └─ InnerJoin\n" +
  1522  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
  1523  			"         │           │       ├─ InnerJoin\n" +
  1524  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
  1525  			"         │           │       │   ├─ Filter\n" +
  1526  			"         │           │       │   │   ├─ (NOT(mc.note IS NULL))\n" +
  1527  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1528  			"         │           │       │   │       └─ Table\n" +
  1529  			"         │           │       │   │           ├─ name: movie_companies\n" +
  1530  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  1531  			"         │           │       │   └─ Filter\n" +
  1532  			"         │           │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (((cn.name >= '20th Century Fox') AND (cn.name <= '20th Century Foxÿ')) OR ((cn.name >= 'Twentieth Century Fox') AND (cn.name <= 'Twentieth Century Foxÿ'))))\n" +
  1533  			"         │           │       │       └─ TableAlias(cn)\n" +
  1534  			"         │           │       │           └─ Table\n" +
  1535  			"         │           │       │               ├─ name: company_name\n" +
  1536  			"         │           │       │               └─ columns: [id name country_code]\n" +
  1537  			"         │           │       └─ Filter\n" +
  1538  			"         │           │           ├─ ((NOT((ct.kind = 'production companies'))) AND (NOT(ct.kind IS NULL)))\n" +
  1539  			"         │           │           └─ TableAlias(ct)\n" +
  1540  			"         │           │               └─ Table\n" +
  1541  			"         │           │                   ├─ name: company_type\n" +
  1542  			"         │           │                   └─ columns: [id kind]\n" +
  1543  			"         │           └─ TableAlias(mk)\n" +
  1544  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1545  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1546  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
  1547  			"         │                   └─ keys: mc.movie_id\n" +
  1548  			"         └─ HashLookup\n" +
  1549  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
  1550  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  1551  			"             └─ Filter\n" +
  1552  			"                 ├─ (t.production_year > 1950)\n" +
  1553  			"                 └─ TableAlias(t)\n" +
  1554  			"                     └─ Table\n" +
  1555  			"                         ├─ name: title\n" +
  1556  			"                         └─ columns: [id title production_year]\n" +
  1557  			"",
  1558  	},
  1559  	{
  1560  		Query: `
  1561  SELECT MIN(cn.name) AS from_company,
  1562         MIN(mc.note) AS production_note,
  1563         MIN(t.title) AS movie_based_on_book
  1564  FROM company_name AS cn,
  1565       company_type AS ct,
  1566       keyword AS k,
  1567       link_type AS lt,
  1568       movie_companies AS mc,
  1569       movie_keyword AS mk,
  1570       movie_link AS ml,
  1571       title AS t
  1572  WHERE cn.country_code !='[pl]'
  1573    AND ct.kind != 'production companies'
  1574    AND ct.kind IS NOT NULL
  1575    AND k.keyword IN ('sequel',
  1576                      'revenge',
  1577                      'based-on-novel')
  1578    AND mc.note IS NOT NULL
  1579    AND t.production_year > 1950
  1580    AND lt.id = ml.link_type_id
  1581    AND ml.movie_id = t.id
  1582    AND t.id = mk.movie_id
  1583    AND mk.keyword_id = k.id
  1584    AND t.id = mc.movie_id
  1585    AND mc.company_type_id = ct.id
  1586    AND mc.company_id = cn.id
  1587    AND ml.movie_id = mk.movie_id
  1588    AND ml.movie_id = mc.movie_id
  1589    AND mk.movie_id = mc.movie_id;
  1590  
  1591  `,
  1592  		ExpectedPlan: "Project\n" +
  1593  			" ├─ columns: [min(cn.name):0!null as from_company, min(mc.note):1!null as production_note, min(t.title):2!null as movie_based_on_book]\n" +
  1594  			" └─ GroupBy\n" +
  1595  			"     ├─ select: MIN(cn.name:10!null), MIN(mc.note:8), MIN(t.title:17!null)\n" +
  1596  			"     ├─ group: \n" +
  1597  			"     └─ HashJoin\n" +
  1598  			"         ├─ AND\n" +
  1599  			"         │   ├─ AND\n" +
  1600  			"         │   │   ├─ Eq\n" +
  1601  			"         │   │   │   ├─ ml.movie_id:2!null\n" +
  1602  			"         │   │   │   └─ t.id:16!null\n" +
  1603  			"         │   │   └─ Eq\n" +
  1604  			"         │   │       ├─ t.id:16!null\n" +
  1605  			"         │   │       └─ mk.movie_id:14!null\n" +
  1606  			"         │   └─ Eq\n" +
  1607  			"         │       ├─ t.id:16!null\n" +
  1608  			"         │       └─ mc.movie_id:5!null\n" +
  1609  			"         ├─ HashJoin\n" +
  1610  			"         │   ├─ Eq\n" +
  1611  			"         │   │   ├─ mk.keyword_id:15!null\n" +
  1612  			"         │   │   └─ k.id:0!null\n" +
  1613  			"         │   ├─ Filter\n" +
  1614  			"         │   │   ├─ HashIn\n" +
  1615  			"         │   │   │   ├─ k.keyword:1!null\n" +
  1616  			"         │   │   │   └─ TUPLE(sequel (longtext), revenge (longtext), based-on-novel (longtext))\n" +
  1617  			"         │   │   └─ TableAlias(k)\n" +
  1618  			"         │   │       └─ ProcessTable\n" +
  1619  			"         │   │           └─ Table\n" +
  1620  			"         │   │               ├─ name: keyword\n" +
  1621  			"         │   │               └─ columns: [id keyword]\n" +
  1622  			"         │   └─ HashLookup\n" +
  1623  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  1624  			"         │       ├─ right-key: TUPLE(mk.keyword_id:13!null)\n" +
  1625  			"         │       └─ LookupJoin\n" +
  1626  			"         │           ├─ Eq\n" +
  1627  			"         │           │   ├─ ml.movie_id:2!null\n" +
  1628  			"         │           │   └─ mk.movie_id:14!null\n" +
  1629  			"         │           ├─ InnerJoin\n" +
  1630  			"         │           │   ├─ Eq\n" +
  1631  			"         │           │   │   ├─ ml.movie_id:2!null\n" +
  1632  			"         │           │   │   └─ mc.movie_id:5!null\n" +
  1633  			"         │           │   ├─ InnerJoin\n" +
  1634  			"         │           │   │   ├─ Eq\n" +
  1635  			"         │           │   │   │   ├─ lt.id:4!null\n" +
  1636  			"         │           │   │   │   └─ ml.link_type_id:3!null\n" +
  1637  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1638  			"         │           │   │   │   └─ ProcessTable\n" +
  1639  			"         │           │   │   │       └─ Table\n" +
  1640  			"         │           │   │   │           ├─ name: movie_link\n" +
  1641  			"         │           │   │   │           └─ columns: [movie_id link_type_id]\n" +
  1642  			"         │           │   │   └─ TableAlias(lt)\n" +
  1643  			"         │           │   │       └─ ProcessTable\n" +
  1644  			"         │           │   │           └─ Table\n" +
  1645  			"         │           │   │               ├─ name: link_type\n" +
  1646  			"         │           │   │               └─ columns: [id]\n" +
  1647  			"         │           │   └─ InnerJoin\n" +
  1648  			"         │           │       ├─ Eq\n" +
  1649  			"         │           │       │   ├─ mc.company_type_id:7!null\n" +
  1650  			"         │           │       │   └─ ct.id:12!null\n" +
  1651  			"         │           │       ├─ InnerJoin\n" +
  1652  			"         │           │       │   ├─ Eq\n" +
  1653  			"         │           │       │   │   ├─ mc.company_id:6!null\n" +
  1654  			"         │           │       │   │   └─ cn.id:9!null\n" +
  1655  			"         │           │       │   ├─ Filter\n" +
  1656  			"         │           │       │   │   ├─ NOT\n" +
  1657  			"         │           │       │   │   │   └─ mc.note:3 IS NULL\n" +
  1658  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1659  			"         │           │       │   │       └─ ProcessTable\n" +
  1660  			"         │           │       │   │           └─ Table\n" +
  1661  			"         │           │       │   │               ├─ name: movie_companies\n" +
  1662  			"         │           │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
  1663  			"         │           │       │   └─ Filter\n" +
  1664  			"         │           │       │       ├─ NOT\n" +
  1665  			"         │           │       │       │   └─ Eq\n" +
  1666  			"         │           │       │       │       ├─ cn.country_code:2\n" +
  1667  			"         │           │       │       │       └─ [pl] (longtext)\n" +
  1668  			"         │           │       │       └─ TableAlias(cn)\n" +
  1669  			"         │           │       │           └─ ProcessTable\n" +
  1670  			"         │           │       │               └─ Table\n" +
  1671  			"         │           │       │                   ├─ name: company_name\n" +
  1672  			"         │           │       │                   └─ columns: [id name country_code]\n" +
  1673  			"         │           │       └─ Filter\n" +
  1674  			"         │           │           ├─ AND\n" +
  1675  			"         │           │           │   ├─ NOT\n" +
  1676  			"         │           │           │   │   └─ Eq\n" +
  1677  			"         │           │           │   │       ├─ ct.kind:1!null\n" +
  1678  			"         │           │           │   │       └─ production companies (longtext)\n" +
  1679  			"         │           │           │   └─ NOT\n" +
  1680  			"         │           │           │       └─ ct.kind:1!null IS NULL\n" +
  1681  			"         │           │           └─ TableAlias(ct)\n" +
  1682  			"         │           │               └─ ProcessTable\n" +
  1683  			"         │           │                   └─ Table\n" +
  1684  			"         │           │                       ├─ name: company_type\n" +
  1685  			"         │           │                       └─ columns: [id kind]\n" +
  1686  			"         │           └─ TableAlias(mk)\n" +
  1687  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1688  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1689  			"         │                   ├─ keys: [mc.movie_id:5!null]\n" +
  1690  			"         │                   ├─ colSet: (20-22)\n" +
  1691  			"         │                   ├─ tableId: 6\n" +
  1692  			"         │                   └─ Table\n" +
  1693  			"         │                       ├─ name: movie_keyword\n" +
  1694  			"         │                       └─ columns: [movie_id keyword_id]\n" +
  1695  			"         └─ HashLookup\n" +
  1696  			"             ├─ left-key: TUPLE(ml.movie_id:2!null, mk.movie_id:14!null, mc.movie_id:5!null)\n" +
  1697  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  1698  			"             └─ Filter\n" +
  1699  			"                 ├─ GreaterThan\n" +
  1700  			"                 │   ├─ t.production_year:2\n" +
  1701  			"                 │   └─ 1950 (smallint)\n" +
  1702  			"                 └─ TableAlias(t)\n" +
  1703  			"                     └─ ProcessTable\n" +
  1704  			"                         └─ Table\n" +
  1705  			"                             ├─ name: title\n" +
  1706  			"                             └─ columns: [id title production_year]\n" +
  1707  			"",
  1708  		ExpectedEstimates: "Project\n" +
  1709  			" ├─ columns: [min(cn.name) as from_company, min(mc.note) as production_note, min(t.title) as movie_based_on_book]\n" +
  1710  			" └─ GroupBy\n" +
  1711  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mc.note), MIN(t.title))\n" +
  1712  			"     ├─ Grouping()\n" +
  1713  			"     └─ HashJoin\n" +
  1714  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  1715  			"         ├─ HashJoin\n" +
  1716  			"         │   ├─ (mk.keyword_id = k.id)\n" +
  1717  			"         │   ├─ Filter\n" +
  1718  			"         │   │   ├─ (k.keyword HASH IN ('sequel', 'revenge', 'based-on-novel'))\n" +
  1719  			"         │   │   └─ TableAlias(k)\n" +
  1720  			"         │   │       └─ Table\n" +
  1721  			"         │   │           ├─ name: keyword\n" +
  1722  			"         │   │           └─ columns: [id keyword]\n" +
  1723  			"         │   └─ HashLookup\n" +
  1724  			"         │       ├─ left-key: (k.id)\n" +
  1725  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  1726  			"         │       └─ LookupJoin\n" +
  1727  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
  1728  			"         │           ├─ InnerJoin\n" +
  1729  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
  1730  			"         │           │   ├─ InnerJoin\n" +
  1731  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
  1732  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1733  			"         │           │   │   │   └─ Table\n" +
  1734  			"         │           │   │   │       ├─ name: movie_link\n" +
  1735  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
  1736  			"         │           │   │   └─ TableAlias(lt)\n" +
  1737  			"         │           │   │       └─ Table\n" +
  1738  			"         │           │   │           ├─ name: link_type\n" +
  1739  			"         │           │   │           └─ columns: [id]\n" +
  1740  			"         │           │   └─ InnerJoin\n" +
  1741  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
  1742  			"         │           │       ├─ InnerJoin\n" +
  1743  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
  1744  			"         │           │       │   ├─ Filter\n" +
  1745  			"         │           │       │   │   ├─ (NOT(mc.note IS NULL))\n" +
  1746  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1747  			"         │           │       │   │       └─ Table\n" +
  1748  			"         │           │       │   │           ├─ name: movie_companies\n" +
  1749  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  1750  			"         │           │       │   └─ Filter\n" +
  1751  			"         │           │       │       ├─ (NOT((cn.country_code = '[pl]')))\n" +
  1752  			"         │           │       │       └─ TableAlias(cn)\n" +
  1753  			"         │           │       │           └─ Table\n" +
  1754  			"         │           │       │               ├─ name: company_name\n" +
  1755  			"         │           │       │               └─ columns: [id name country_code]\n" +
  1756  			"         │           │       └─ Filter\n" +
  1757  			"         │           │           ├─ ((NOT((ct.kind = 'production companies'))) AND (NOT(ct.kind IS NULL)))\n" +
  1758  			"         │           │           └─ TableAlias(ct)\n" +
  1759  			"         │           │               └─ Table\n" +
  1760  			"         │           │                   ├─ name: company_type\n" +
  1761  			"         │           │                   └─ columns: [id kind]\n" +
  1762  			"         │           └─ TableAlias(mk)\n" +
  1763  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1764  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1765  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
  1766  			"         │                   └─ keys: mc.movie_id\n" +
  1767  			"         └─ HashLookup\n" +
  1768  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
  1769  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  1770  			"             └─ Filter\n" +
  1771  			"                 ├─ (t.production_year > 1950)\n" +
  1772  			"                 └─ TableAlias(t)\n" +
  1773  			"                     └─ Table\n" +
  1774  			"                         ├─ name: title\n" +
  1775  			"                         └─ columns: [id title production_year]\n" +
  1776  			"",
  1777  		ExpectedAnalysis: "Project\n" +
  1778  			" ├─ columns: [min(cn.name) as from_company, min(mc.note) as production_note, min(t.title) as movie_based_on_book]\n" +
  1779  			" └─ GroupBy\n" +
  1780  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mc.note), MIN(t.title))\n" +
  1781  			"     ├─ Grouping()\n" +
  1782  			"     └─ HashJoin\n" +
  1783  			"         ├─ (((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  1784  			"         ├─ HashJoin\n" +
  1785  			"         │   ├─ (mk.keyword_id = k.id)\n" +
  1786  			"         │   ├─ Filter\n" +
  1787  			"         │   │   ├─ (k.keyword HASH IN ('sequel', 'revenge', 'based-on-novel'))\n" +
  1788  			"         │   │   └─ TableAlias(k)\n" +
  1789  			"         │   │       └─ Table\n" +
  1790  			"         │   │           ├─ name: keyword\n" +
  1791  			"         │   │           └─ columns: [id keyword]\n" +
  1792  			"         │   └─ HashLookup\n" +
  1793  			"         │       ├─ left-key: (k.id)\n" +
  1794  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  1795  			"         │       └─ LookupJoin\n" +
  1796  			"         │           ├─ (ml.movie_id = mk.movie_id)\n" +
  1797  			"         │           ├─ InnerJoin\n" +
  1798  			"         │           │   ├─ (ml.movie_id = mc.movie_id)\n" +
  1799  			"         │           │   ├─ InnerJoin\n" +
  1800  			"         │           │   │   ├─ (lt.id = ml.link_type_id)\n" +
  1801  			"         │           │   │   ├─ TableAlias(ml)\n" +
  1802  			"         │           │   │   │   └─ Table\n" +
  1803  			"         │           │   │   │       ├─ name: movie_link\n" +
  1804  			"         │           │   │   │       └─ columns: [movie_id link_type_id]\n" +
  1805  			"         │           │   │   └─ TableAlias(lt)\n" +
  1806  			"         │           │   │       └─ Table\n" +
  1807  			"         │           │   │           ├─ name: link_type\n" +
  1808  			"         │           │   │           └─ columns: [id]\n" +
  1809  			"         │           │   └─ InnerJoin\n" +
  1810  			"         │           │       ├─ (mc.company_type_id = ct.id)\n" +
  1811  			"         │           │       ├─ InnerJoin\n" +
  1812  			"         │           │       │   ├─ (mc.company_id = cn.id)\n" +
  1813  			"         │           │       │   ├─ Filter\n" +
  1814  			"         │           │       │   │   ├─ (NOT(mc.note IS NULL))\n" +
  1815  			"         │           │       │   │   └─ TableAlias(mc)\n" +
  1816  			"         │           │       │   │       └─ Table\n" +
  1817  			"         │           │       │   │           ├─ name: movie_companies\n" +
  1818  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  1819  			"         │           │       │   └─ Filter\n" +
  1820  			"         │           │       │       ├─ (NOT((cn.country_code = '[pl]')))\n" +
  1821  			"         │           │       │       └─ TableAlias(cn)\n" +
  1822  			"         │           │       │           └─ Table\n" +
  1823  			"         │           │       │               ├─ name: company_name\n" +
  1824  			"         │           │       │               └─ columns: [id name country_code]\n" +
  1825  			"         │           │       └─ Filter\n" +
  1826  			"         │           │           ├─ ((NOT((ct.kind = 'production companies'))) AND (NOT(ct.kind IS NULL)))\n" +
  1827  			"         │           │           └─ TableAlias(ct)\n" +
  1828  			"         │           │               └─ Table\n" +
  1829  			"         │           │                   ├─ name: company_type\n" +
  1830  			"         │           │                   └─ columns: [id kind]\n" +
  1831  			"         │           └─ TableAlias(mk)\n" +
  1832  			"         │               └─ IndexedTableAccess(movie_keyword)\n" +
  1833  			"         │                   ├─ index: [movie_keyword.movie_id]\n" +
  1834  			"         │                   ├─ columns: [movie_id keyword_id]\n" +
  1835  			"         │                   └─ keys: mc.movie_id\n" +
  1836  			"         └─ HashLookup\n" +
  1837  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id)\n" +
  1838  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  1839  			"             └─ Filter\n" +
  1840  			"                 ├─ (t.production_year > 1950)\n" +
  1841  			"                 └─ TableAlias(t)\n" +
  1842  			"                     └─ Table\n" +
  1843  			"                         ├─ name: title\n" +
  1844  			"                         └─ columns: [id title production_year]\n" +
  1845  			"",
  1846  	},
  1847  	{
  1848  		Query: `
  1849  SELECT MIN(cn.name) AS movie_company,
  1850         MIN(mi_idx.info) AS rating,
  1851         MIN(t.title) AS drama_horror_movie
  1852  FROM company_name AS cn,
  1853       company_type AS ct,
  1854       info_type AS it1,
  1855       info_type AS it2,
  1856       movie_companies AS mc,
  1857       movie_info AS mi,
  1858       movie_info_idx AS mi_idx,
  1859       title AS t
  1860  WHERE cn.country_code = '[us]'
  1861    AND ct.kind = 'production companies'
  1862    AND it1.info = 'genres'
  1863    AND it2.info = 'rating'
  1864    AND mi.info IN ('Drama',
  1865                    'Horror')
  1866    AND mi_idx.info > '8.0'
  1867    AND t.production_year BETWEEN 2005 AND 2008
  1868    AND t.id = mi.movie_id
  1869    AND t.id = mi_idx.movie_id
  1870    AND mi.info_type_id = it1.id
  1871    AND mi_idx.info_type_id = it2.id
  1872    AND t.id = mc.movie_id
  1873    AND ct.id = mc.company_type_id
  1874    AND cn.id = mc.company_id
  1875    AND mc.movie_id = mi.movie_id
  1876    AND mc.movie_id = mi_idx.movie_id
  1877    AND mi.movie_id = mi_idx.movie_id;
  1878  
  1879  `,
  1880  		ExpectedPlan: "Project\n" +
  1881  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as drama_horror_movie]\n" +
  1882  			" └─ GroupBy\n" +
  1883  			"     ├─ select: MIN(cn.name:11!null), MIN(mi_idx.info:4!null), MIN(t.title:19!null)\n" +
  1884  			"     ├─ group: \n" +
  1885  			"     └─ HashJoin\n" +
  1886  			"         ├─ AND\n" +
  1887  			"         │   ├─ AND\n" +
  1888  			"         │   │   ├─ Eq\n" +
  1889  			"         │   │   │   ├─ t.id:18!null\n" +
  1890  			"         │   │   │   └─ mi.movie_id:15!null\n" +
  1891  			"         │   │   └─ Eq\n" +
  1892  			"         │   │       ├─ t.id:18!null\n" +
  1893  			"         │   │       └─ mi_idx.movie_id:2!null\n" +
  1894  			"         │   └─ Eq\n" +
  1895  			"         │       ├─ t.id:18!null\n" +
  1896  			"         │       └─ mc.movie_id:7!null\n" +
  1897  			"         ├─ HashJoin\n" +
  1898  			"         │   ├─ Eq\n" +
  1899  			"         │   │   ├─ mi.info_type_id:16!null\n" +
  1900  			"         │   │   └─ it1.id:0!null\n" +
  1901  			"         │   ├─ Filter\n" +
  1902  			"         │   │   ├─ Eq\n" +
  1903  			"         │   │   │   ├─ it1.info:1!null\n" +
  1904  			"         │   │   │   └─ genres (longtext)\n" +
  1905  			"         │   │   └─ TableAlias(it1)\n" +
  1906  			"         │   │       └─ ProcessTable\n" +
  1907  			"         │   │           └─ Table\n" +
  1908  			"         │   │               ├─ name: info_type\n" +
  1909  			"         │   │               └─ columns: [id info]\n" +
  1910  			"         │   └─ HashLookup\n" +
  1911  			"         │       ├─ left-key: TUPLE(it1.id:0!null)\n" +
  1912  			"         │       ├─ right-key: TUPLE(mi.info_type_id:14!null)\n" +
  1913  			"         │       └─ LookupJoin\n" +
  1914  			"         │           ├─ Eq\n" +
  1915  			"         │           │   ├─ mi.movie_id:15!null\n" +
  1916  			"         │           │   └─ mi_idx.movie_id:2!null\n" +
  1917  			"         │           ├─ InnerJoin\n" +
  1918  			"         │           │   ├─ Eq\n" +
  1919  			"         │           │   │   ├─ mc.movie_id:7!null\n" +
  1920  			"         │           │   │   └─ mi_idx.movie_id:2!null\n" +
  1921  			"         │           │   ├─ InnerJoin\n" +
  1922  			"         │           │   │   ├─ Eq\n" +
  1923  			"         │           │   │   │   ├─ mi_idx.info_type_id:3!null\n" +
  1924  			"         │           │   │   │   └─ it2.id:5!null\n" +
  1925  			"         │           │   │   ├─ Filter\n" +
  1926  			"         │           │   │   │   ├─ GreaterThan\n" +
  1927  			"         │           │   │   │   │   ├─ mi_idx.info:2!null\n" +
  1928  			"         │           │   │   │   │   └─ 8.0 (longtext)\n" +
  1929  			"         │           │   │   │   └─ TableAlias(mi_idx)\n" +
  1930  			"         │           │   │   │       └─ ProcessTable\n" +
  1931  			"         │           │   │   │           └─ Table\n" +
  1932  			"         │           │   │   │               ├─ name: movie_info_idx\n" +
  1933  			"         │           │   │   │               └─ columns: [movie_id info_type_id info]\n" +
  1934  			"         │           │   │   └─ Filter\n" +
  1935  			"         │           │   │       ├─ Eq\n" +
  1936  			"         │           │   │       │   ├─ it2.info:1!null\n" +
  1937  			"         │           │   │       │   └─ rating (longtext)\n" +
  1938  			"         │           │   │       └─ TableAlias(it2)\n" +
  1939  			"         │           │   │           └─ Table\n" +
  1940  			"         │           │   │               ├─ name: info_type\n" +
  1941  			"         │           │   │               ├─ columns: [id info]\n" +
  1942  			"         │           │   │               ├─ colSet: (12,13)\n" +
  1943  			"         │           │   │               └─ tableId: 4\n" +
  1944  			"         │           │   └─ InnerJoin\n" +
  1945  			"         │           │       ├─ Eq\n" +
  1946  			"         │           │       │   ├─ ct.id:13!null\n" +
  1947  			"         │           │       │   └─ mc.company_type_id:9!null\n" +
  1948  			"         │           │       ├─ InnerJoin\n" +
  1949  			"         │           │       │   ├─ Eq\n" +
  1950  			"         │           │       │   │   ├─ cn.id:10!null\n" +
  1951  			"         │           │       │   │   └─ mc.company_id:8!null\n" +
  1952  			"         │           │       │   ├─ TableAlias(mc)\n" +
  1953  			"         │           │       │   │   └─ ProcessTable\n" +
  1954  			"         │           │       │   │       └─ Table\n" +
  1955  			"         │           │       │   │           ├─ name: movie_companies\n" +
  1956  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  1957  			"         │           │       │   └─ Filter\n" +
  1958  			"         │           │       │       ├─ Eq\n" +
  1959  			"         │           │       │       │   ├─ cn.country_code:2\n" +
  1960  			"         │           │       │       │   └─ [us] (longtext)\n" +
  1961  			"         │           │       │       └─ TableAlias(cn)\n" +
  1962  			"         │           │       │           └─ ProcessTable\n" +
  1963  			"         │           │       │               └─ Table\n" +
  1964  			"         │           │       │                   ├─ name: company_name\n" +
  1965  			"         │           │       │                   └─ columns: [id name country_code]\n" +
  1966  			"         │           │       └─ Filter\n" +
  1967  			"         │           │           ├─ Eq\n" +
  1968  			"         │           │           │   ├─ ct.kind:1!null\n" +
  1969  			"         │           │           │   └─ production companies (longtext)\n" +
  1970  			"         │           │           └─ TableAlias(ct)\n" +
  1971  			"         │           │               └─ ProcessTable\n" +
  1972  			"         │           │                   └─ Table\n" +
  1973  			"         │           │                       ├─ name: company_type\n" +
  1974  			"         │           │                       └─ columns: [id kind]\n" +
  1975  			"         │           └─ Filter\n" +
  1976  			"         │               ├─ HashIn\n" +
  1977  			"         │               │   ├─ mi.info:2!null\n" +
  1978  			"         │               │   └─ TUPLE(Drama (longtext), Horror (longtext))\n" +
  1979  			"         │               └─ TableAlias(mi)\n" +
  1980  			"         │                   └─ IndexedTableAccess(movie_info)\n" +
  1981  			"         │                       ├─ index: [movie_info.movie_id]\n" +
  1982  			"         │                       ├─ keys: [mc.movie_id:7!null]\n" +
  1983  			"         │                       ├─ colSet: (19-23)\n" +
  1984  			"         │                       ├─ tableId: 6\n" +
  1985  			"         │                       └─ Table\n" +
  1986  			"         │                           ├─ name: movie_info\n" +
  1987  			"         │                           └─ columns: [movie_id info_type_id info]\n" +
  1988  			"         └─ HashLookup\n" +
  1989  			"             ├─ left-key: TUPLE(mi.movie_id:15!null, mi_idx.movie_id:2!null, mc.movie_id:7!null)\n" +
  1990  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  1991  			"             └─ Filter\n" +
  1992  			"                 ├─ AND\n" +
  1993  			"                 │   ├─ GreaterThanOrEqual\n" +
  1994  			"                 │   │   ├─ t.production_year:2\n" +
  1995  			"                 │   │   └─ 2005 (smallint)\n" +
  1996  			"                 │   └─ LessThanOrEqual\n" +
  1997  			"                 │       ├─ t.production_year:2\n" +
  1998  			"                 │       └─ 2008 (smallint)\n" +
  1999  			"                 └─ TableAlias(t)\n" +
  2000  			"                     └─ ProcessTable\n" +
  2001  			"                         └─ Table\n" +
  2002  			"                             ├─ name: title\n" +
  2003  			"                             └─ columns: [id title production_year]\n" +
  2004  			"",
  2005  		ExpectedEstimates: "Project\n" +
  2006  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as drama_horror_movie]\n" +
  2007  			" └─ GroupBy\n" +
  2008  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
  2009  			"     ├─ Grouping()\n" +
  2010  			"     └─ HashJoin\n" +
  2011  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = mc.movie_id))\n" +
  2012  			"         ├─ HashJoin\n" +
  2013  			"         │   ├─ (mi.info_type_id = it1.id)\n" +
  2014  			"         │   ├─ Filter\n" +
  2015  			"         │   │   ├─ (it1.info = 'genres')\n" +
  2016  			"         │   │   └─ TableAlias(it1)\n" +
  2017  			"         │   │       └─ Table\n" +
  2018  			"         │   │           ├─ name: info_type\n" +
  2019  			"         │   │           └─ columns: [id info]\n" +
  2020  			"         │   └─ HashLookup\n" +
  2021  			"         │       ├─ left-key: (it1.id)\n" +
  2022  			"         │       ├─ right-key: (mi.info_type_id)\n" +
  2023  			"         │       └─ LookupJoin\n" +
  2024  			"         │           ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  2025  			"         │           ├─ InnerJoin\n" +
  2026  			"         │           │   ├─ (mc.movie_id = mi_idx.movie_id)\n" +
  2027  			"         │           │   ├─ InnerJoin\n" +
  2028  			"         │           │   │   ├─ (mi_idx.info_type_id = it2.id)\n" +
  2029  			"         │           │   │   ├─ Filter\n" +
  2030  			"         │           │   │   │   ├─ (mi_idx.info > '8.0')\n" +
  2031  			"         │           │   │   │   └─ TableAlias(mi_idx)\n" +
  2032  			"         │           │   │   │       └─ Table\n" +
  2033  			"         │           │   │   │           ├─ name: movie_info_idx\n" +
  2034  			"         │           │   │   │           └─ columns: [movie_id info_type_id info]\n" +
  2035  			"         │           │   │   └─ Filter\n" +
  2036  			"         │           │   │       ├─ (it2.info = 'rating')\n" +
  2037  			"         │           │   │       └─ TableAlias(it2)\n" +
  2038  			"         │           │   │           └─ Table\n" +
  2039  			"         │           │   │               ├─ name: info_type\n" +
  2040  			"         │           │   │               └─ columns: [id info]\n" +
  2041  			"         │           │   └─ InnerJoin\n" +
  2042  			"         │           │       ├─ (ct.id = mc.company_type_id)\n" +
  2043  			"         │           │       ├─ InnerJoin\n" +
  2044  			"         │           │       │   ├─ (cn.id = mc.company_id)\n" +
  2045  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2046  			"         │           │       │   │   └─ Table\n" +
  2047  			"         │           │       │   │       ├─ name: movie_companies\n" +
  2048  			"         │           │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  2049  			"         │           │       │   └─ Filter\n" +
  2050  			"         │           │       │       ├─ (cn.country_code = '[us]')\n" +
  2051  			"         │           │       │       └─ TableAlias(cn)\n" +
  2052  			"         │           │       │           └─ Table\n" +
  2053  			"         │           │       │               ├─ name: company_name\n" +
  2054  			"         │           │       │               └─ columns: [id name country_code]\n" +
  2055  			"         │           │       └─ Filter\n" +
  2056  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
  2057  			"         │           │           └─ TableAlias(ct)\n" +
  2058  			"         │           │               └─ Table\n" +
  2059  			"         │           │                   ├─ name: company_type\n" +
  2060  			"         │           │                   └─ columns: [id kind]\n" +
  2061  			"         │           └─ Filter\n" +
  2062  			"         │               ├─ (mi.info HASH IN ('Drama', 'Horror'))\n" +
  2063  			"         │               └─ TableAlias(mi)\n" +
  2064  			"         │                   └─ IndexedTableAccess(movie_info)\n" +
  2065  			"         │                       ├─ index: [movie_info.movie_id]\n" +
  2066  			"         │                       ├─ columns: [movie_id info_type_id info]\n" +
  2067  			"         │                       └─ keys: mc.movie_id\n" +
  2068  			"         └─ HashLookup\n" +
  2069  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, mc.movie_id)\n" +
  2070  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  2071  			"             └─ Filter\n" +
  2072  			"                 ├─ ((t.production_year >= 2005) AND (t.production_year <= 2008))\n" +
  2073  			"                 └─ TableAlias(t)\n" +
  2074  			"                     └─ Table\n" +
  2075  			"                         ├─ name: title\n" +
  2076  			"                         └─ columns: [id title production_year]\n" +
  2077  			"",
  2078  		ExpectedAnalysis: "Project\n" +
  2079  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as drama_horror_movie]\n" +
  2080  			" └─ GroupBy\n" +
  2081  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
  2082  			"     ├─ Grouping()\n" +
  2083  			"     └─ HashJoin\n" +
  2084  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = mc.movie_id))\n" +
  2085  			"         ├─ HashJoin\n" +
  2086  			"         │   ├─ (mi.info_type_id = it1.id)\n" +
  2087  			"         │   ├─ Filter\n" +
  2088  			"         │   │   ├─ (it1.info = 'genres')\n" +
  2089  			"         │   │   └─ TableAlias(it1)\n" +
  2090  			"         │   │       └─ Table\n" +
  2091  			"         │   │           ├─ name: info_type\n" +
  2092  			"         │   │           └─ columns: [id info]\n" +
  2093  			"         │   └─ HashLookup\n" +
  2094  			"         │       ├─ left-key: (it1.id)\n" +
  2095  			"         │       ├─ right-key: (mi.info_type_id)\n" +
  2096  			"         │       └─ LookupJoin\n" +
  2097  			"         │           ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  2098  			"         │           ├─ InnerJoin\n" +
  2099  			"         │           │   ├─ (mc.movie_id = mi_idx.movie_id)\n" +
  2100  			"         │           │   ├─ InnerJoin\n" +
  2101  			"         │           │   │   ├─ (mi_idx.info_type_id = it2.id)\n" +
  2102  			"         │           │   │   ├─ Filter\n" +
  2103  			"         │           │   │   │   ├─ (mi_idx.info > '8.0')\n" +
  2104  			"         │           │   │   │   └─ TableAlias(mi_idx)\n" +
  2105  			"         │           │   │   │       └─ Table\n" +
  2106  			"         │           │   │   │           ├─ name: movie_info_idx\n" +
  2107  			"         │           │   │   │           └─ columns: [movie_id info_type_id info]\n" +
  2108  			"         │           │   │   └─ Filter\n" +
  2109  			"         │           │   │       ├─ (it2.info = 'rating')\n" +
  2110  			"         │           │   │       └─ TableAlias(it2)\n" +
  2111  			"         │           │   │           └─ Table\n" +
  2112  			"         │           │   │               ├─ name: info_type\n" +
  2113  			"         │           │   │               └─ columns: [id info]\n" +
  2114  			"         │           │   └─ InnerJoin\n" +
  2115  			"         │           │       ├─ (ct.id = mc.company_type_id)\n" +
  2116  			"         │           │       ├─ InnerJoin\n" +
  2117  			"         │           │       │   ├─ (cn.id = mc.company_id)\n" +
  2118  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2119  			"         │           │       │   │   └─ Table\n" +
  2120  			"         │           │       │   │       ├─ name: movie_companies\n" +
  2121  			"         │           │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  2122  			"         │           │       │   └─ Filter\n" +
  2123  			"         │           │       │       ├─ (cn.country_code = '[us]')\n" +
  2124  			"         │           │       │       └─ TableAlias(cn)\n" +
  2125  			"         │           │       │           └─ Table\n" +
  2126  			"         │           │       │               ├─ name: company_name\n" +
  2127  			"         │           │       │               └─ columns: [id name country_code]\n" +
  2128  			"         │           │       └─ Filter\n" +
  2129  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
  2130  			"         │           │           └─ TableAlias(ct)\n" +
  2131  			"         │           │               └─ Table\n" +
  2132  			"         │           │                   ├─ name: company_type\n" +
  2133  			"         │           │                   └─ columns: [id kind]\n" +
  2134  			"         │           └─ Filter\n" +
  2135  			"         │               ├─ (mi.info HASH IN ('Drama', 'Horror'))\n" +
  2136  			"         │               └─ TableAlias(mi)\n" +
  2137  			"         │                   └─ IndexedTableAccess(movie_info)\n" +
  2138  			"         │                       ├─ index: [movie_info.movie_id]\n" +
  2139  			"         │                       ├─ columns: [movie_id info_type_id info]\n" +
  2140  			"         │                       └─ keys: mc.movie_id\n" +
  2141  			"         └─ HashLookup\n" +
  2142  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, mc.movie_id)\n" +
  2143  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  2144  			"             └─ Filter\n" +
  2145  			"                 ├─ ((t.production_year >= 2005) AND (t.production_year <= 2008))\n" +
  2146  			"                 └─ TableAlias(t)\n" +
  2147  			"                     └─ Table\n" +
  2148  			"                         ├─ name: title\n" +
  2149  			"                         └─ columns: [id title production_year]\n" +
  2150  			"",
  2151  	},
  2152  	{
  2153  		Query: `
  2154  SELECT MIN(mi.info) AS budget,
  2155         MIN(t.title) AS unsuccsessful_movie
  2156  FROM company_name AS cn,
  2157       company_type AS ct,
  2158       info_type AS it1,
  2159       info_type AS it2,
  2160       movie_companies AS mc,
  2161       movie_info AS mi,
  2162       movie_info_idx AS mi_idx,
  2163       title AS t
  2164  WHERE cn.country_code ='[us]'
  2165    AND ct.kind IS NOT NULL
  2166    AND (ct.kind ='production companies'
  2167         OR ct.kind = 'distributors')
  2168    AND it1.info ='budget'
  2169    AND it2.info ='bottom 10 rank'
  2170    AND t.production_year >2000
  2171    AND (t.title LIKE 'Birdemic%'
  2172         OR t.title LIKE '%Movie%')
  2173    AND t.id = mi.movie_id
  2174    AND t.id = mi_idx.movie_id
  2175    AND mi.info_type_id = it1.id
  2176    AND mi_idx.info_type_id = it2.id
  2177    AND t.id = mc.movie_id
  2178    AND ct.id = mc.company_type_id
  2179    AND cn.id = mc.company_id
  2180    AND mc.movie_id = mi.movie_id
  2181    AND mc.movie_id = mi_idx.movie_id
  2182    AND mi.movie_id = mi_idx.movie_id;
  2183  
  2184  `,
  2185  		ExpectedPlan: "Project\n" +
  2186  			" ├─ columns: [min(mi.info):0!null as budget, min(t.title):1!null as unsuccsessful_movie]\n" +
  2187  			" └─ GroupBy\n" +
  2188  			"     ├─ select: MIN(mi.info:15!null), MIN(t.title:17!null)\n" +
  2189  			"     ├─ group: \n" +
  2190  			"     └─ HashJoin\n" +
  2191  			"         ├─ AND\n" +
  2192  			"         │   ├─ AND\n" +
  2193  			"         │   │   ├─ Eq\n" +
  2194  			"         │   │   │   ├─ t.id:16!null\n" +
  2195  			"         │   │   │   └─ mi.movie_id:13!null\n" +
  2196  			"         │   │   └─ Eq\n" +
  2197  			"         │   │       ├─ t.id:16!null\n" +
  2198  			"         │   │       └─ mi_idx.movie_id:2!null\n" +
  2199  			"         │   └─ Eq\n" +
  2200  			"         │       ├─ t.id:16!null\n" +
  2201  			"         │       └─ mc.movie_id:6!null\n" +
  2202  			"         ├─ HashJoin\n" +
  2203  			"         │   ├─ Eq\n" +
  2204  			"         │   │   ├─ mi.info_type_id:14!null\n" +
  2205  			"         │   │   └─ it1.id:0!null\n" +
  2206  			"         │   ├─ Filter\n" +
  2207  			"         │   │   ├─ Eq\n" +
  2208  			"         │   │   │   ├─ it1.info:1!null\n" +
  2209  			"         │   │   │   └─ budget (longtext)\n" +
  2210  			"         │   │   └─ TableAlias(it1)\n" +
  2211  			"         │   │       └─ ProcessTable\n" +
  2212  			"         │   │           └─ Table\n" +
  2213  			"         │   │               ├─ name: info_type\n" +
  2214  			"         │   │               └─ columns: [id info]\n" +
  2215  			"         │   └─ HashLookup\n" +
  2216  			"         │       ├─ left-key: TUPLE(it1.id:0!null)\n" +
  2217  			"         │       ├─ right-key: TUPLE(mi.info_type_id:12!null)\n" +
  2218  			"         │       └─ LookupJoin\n" +
  2219  			"         │           ├─ Eq\n" +
  2220  			"         │           │   ├─ mi.movie_id:13!null\n" +
  2221  			"         │           │   └─ mi_idx.movie_id:2!null\n" +
  2222  			"         │           ├─ InnerJoin\n" +
  2223  			"         │           │   ├─ Eq\n" +
  2224  			"         │           │   │   ├─ mc.movie_id:6!null\n" +
  2225  			"         │           │   │   └─ mi_idx.movie_id:2!null\n" +
  2226  			"         │           │   ├─ InnerJoin\n" +
  2227  			"         │           │   │   ├─ Eq\n" +
  2228  			"         │           │   │   │   ├─ mi_idx.info_type_id:3!null\n" +
  2229  			"         │           │   │   │   └─ it2.id:4!null\n" +
  2230  			"         │           │   │   ├─ TableAlias(mi_idx)\n" +
  2231  			"         │           │   │   │   └─ ProcessTable\n" +
  2232  			"         │           │   │   │       └─ Table\n" +
  2233  			"         │           │   │   │           ├─ name: movie_info_idx\n" +
  2234  			"         │           │   │   │           └─ columns: [movie_id info_type_id]\n" +
  2235  			"         │           │   │   └─ Filter\n" +
  2236  			"         │           │   │       ├─ Eq\n" +
  2237  			"         │           │   │       │   ├─ it2.info:1!null\n" +
  2238  			"         │           │   │       │   └─ bottom 10 rank (longtext)\n" +
  2239  			"         │           │   │       └─ TableAlias(it2)\n" +
  2240  			"         │           │   │           └─ Table\n" +
  2241  			"         │           │   │               ├─ name: info_type\n" +
  2242  			"         │           │   │               ├─ columns: [id info]\n" +
  2243  			"         │           │   │               ├─ colSet: (12,13)\n" +
  2244  			"         │           │   │               └─ tableId: 4\n" +
  2245  			"         │           │   └─ InnerJoin\n" +
  2246  			"         │           │       ├─ Eq\n" +
  2247  			"         │           │       │   ├─ ct.id:11!null\n" +
  2248  			"         │           │       │   └─ mc.company_type_id:8!null\n" +
  2249  			"         │           │       ├─ InnerJoin\n" +
  2250  			"         │           │       │   ├─ Eq\n" +
  2251  			"         │           │       │   │   ├─ cn.id:9!null\n" +
  2252  			"         │           │       │   │   └─ mc.company_id:7!null\n" +
  2253  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2254  			"         │           │       │   │   └─ ProcessTable\n" +
  2255  			"         │           │       │   │       └─ Table\n" +
  2256  			"         │           │       │   │           ├─ name: movie_companies\n" +
  2257  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  2258  			"         │           │       │   └─ Filter\n" +
  2259  			"         │           │       │       ├─ Eq\n" +
  2260  			"         │           │       │       │   ├─ cn.country_code:1\n" +
  2261  			"         │           │       │       │   └─ [us] (longtext)\n" +
  2262  			"         │           │       │       └─ TableAlias(cn)\n" +
  2263  			"         │           │       │           └─ ProcessTable\n" +
  2264  			"         │           │       │               └─ Table\n" +
  2265  			"         │           │       │                   ├─ name: company_name\n" +
  2266  			"         │           │       │                   └─ columns: [id country_code]\n" +
  2267  			"         │           │       └─ Filter\n" +
  2268  			"         │           │           ├─ AND\n" +
  2269  			"         │           │           │   ├─ NOT\n" +
  2270  			"         │           │           │   │   └─ ct.kind:1!null IS NULL\n" +
  2271  			"         │           │           │   └─ Or\n" +
  2272  			"         │           │           │       ├─ Eq\n" +
  2273  			"         │           │           │       │   ├─ ct.kind:1!null\n" +
  2274  			"         │           │           │       │   └─ production companies (longtext)\n" +
  2275  			"         │           │           │       └─ Eq\n" +
  2276  			"         │           │           │           ├─ ct.kind:1!null\n" +
  2277  			"         │           │           │           └─ distributors (longtext)\n" +
  2278  			"         │           │           └─ TableAlias(ct)\n" +
  2279  			"         │           │               └─ ProcessTable\n" +
  2280  			"         │           │                   └─ Table\n" +
  2281  			"         │           │                       ├─ name: company_type\n" +
  2282  			"         │           │                       └─ columns: [id kind]\n" +
  2283  			"         │           └─ TableAlias(mi)\n" +
  2284  			"         │               └─ IndexedTableAccess(movie_info)\n" +
  2285  			"         │                   ├─ index: [movie_info.movie_id]\n" +
  2286  			"         │                   ├─ keys: [mc.movie_id:6!null]\n" +
  2287  			"         │                   ├─ colSet: (19-23)\n" +
  2288  			"         │                   ├─ tableId: 6\n" +
  2289  			"         │                   └─ Table\n" +
  2290  			"         │                       ├─ name: movie_info\n" +
  2291  			"         │                       └─ columns: [movie_id info_type_id info]\n" +
  2292  			"         └─ HashLookup\n" +
  2293  			"             ├─ left-key: TUPLE(mi.movie_id:13!null, mi_idx.movie_id:2!null, mc.movie_id:6!null)\n" +
  2294  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  2295  			"             └─ Filter\n" +
  2296  			"                 ├─ AND\n" +
  2297  			"                 │   ├─ GreaterThan\n" +
  2298  			"                 │   │   ├─ t.production_year:2\n" +
  2299  			"                 │   │   └─ 2000 (smallint)\n" +
  2300  			"                 │   └─ Or\n" +
  2301  			"                 │       ├─ AND\n" +
  2302  			"                 │       │   ├─ GreaterThanOrEqual\n" +
  2303  			"                 │       │   │   ├─ t.title:1!null\n" +
  2304  			"                 │       │   │   └─ Birdemic (longtext)\n" +
  2305  			"                 │       │   └─ LessThanOrEqual\n" +
  2306  			"                 │       │       ├─ t.title:1!null\n" +
  2307  			"                 │       │       └─ Birdemicÿ (longtext)\n" +
  2308  			"                 │       └─ t.title LIKE '%Movie%'\n" +
  2309  			"                 └─ TableAlias(t)\n" +
  2310  			"                     └─ ProcessTable\n" +
  2311  			"                         └─ Table\n" +
  2312  			"                             ├─ name: title\n" +
  2313  			"                             └─ columns: [id title production_year]\n" +
  2314  			"",
  2315  		ExpectedEstimates: "Project\n" +
  2316  			" ├─ columns: [min(mi.info) as budget, min(t.title) as unsuccsessful_movie]\n" +
  2317  			" └─ GroupBy\n" +
  2318  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  2319  			"     ├─ Grouping()\n" +
  2320  			"     └─ HashJoin\n" +
  2321  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = mc.movie_id))\n" +
  2322  			"         ├─ HashJoin\n" +
  2323  			"         │   ├─ (mi.info_type_id = it1.id)\n" +
  2324  			"         │   ├─ Filter\n" +
  2325  			"         │   │   ├─ (it1.info = 'budget')\n" +
  2326  			"         │   │   └─ TableAlias(it1)\n" +
  2327  			"         │   │       └─ Table\n" +
  2328  			"         │   │           ├─ name: info_type\n" +
  2329  			"         │   │           └─ columns: [id info]\n" +
  2330  			"         │   └─ HashLookup\n" +
  2331  			"         │       ├─ left-key: (it1.id)\n" +
  2332  			"         │       ├─ right-key: (mi.info_type_id)\n" +
  2333  			"         │       └─ LookupJoin\n" +
  2334  			"         │           ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  2335  			"         │           ├─ InnerJoin\n" +
  2336  			"         │           │   ├─ (mc.movie_id = mi_idx.movie_id)\n" +
  2337  			"         │           │   ├─ InnerJoin\n" +
  2338  			"         │           │   │   ├─ (mi_idx.info_type_id = it2.id)\n" +
  2339  			"         │           │   │   ├─ TableAlias(mi_idx)\n" +
  2340  			"         │           │   │   │   └─ Table\n" +
  2341  			"         │           │   │   │       ├─ name: movie_info_idx\n" +
  2342  			"         │           │   │   │       └─ columns: [movie_id info_type_id]\n" +
  2343  			"         │           │   │   └─ Filter\n" +
  2344  			"         │           │   │       ├─ (it2.info = 'bottom 10 rank')\n" +
  2345  			"         │           │   │       └─ TableAlias(it2)\n" +
  2346  			"         │           │   │           └─ Table\n" +
  2347  			"         │           │   │               ├─ name: info_type\n" +
  2348  			"         │           │   │               └─ columns: [id info]\n" +
  2349  			"         │           │   └─ InnerJoin\n" +
  2350  			"         │           │       ├─ (ct.id = mc.company_type_id)\n" +
  2351  			"         │           │       ├─ InnerJoin\n" +
  2352  			"         │           │       │   ├─ (cn.id = mc.company_id)\n" +
  2353  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2354  			"         │           │       │   │   └─ Table\n" +
  2355  			"         │           │       │   │       ├─ name: movie_companies\n" +
  2356  			"         │           │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  2357  			"         │           │       │   └─ Filter\n" +
  2358  			"         │           │       │       ├─ (cn.country_code = '[us]')\n" +
  2359  			"         │           │       │       └─ TableAlias(cn)\n" +
  2360  			"         │           │       │           └─ Table\n" +
  2361  			"         │           │       │               ├─ name: company_name\n" +
  2362  			"         │           │       │               └─ columns: [id country_code]\n" +
  2363  			"         │           │       └─ Filter\n" +
  2364  			"         │           │           ├─ ((NOT(ct.kind IS NULL)) AND ((ct.kind = 'production companies') OR (ct.kind = 'distributors')))\n" +
  2365  			"         │           │           └─ TableAlias(ct)\n" +
  2366  			"         │           │               └─ Table\n" +
  2367  			"         │           │                   ├─ name: company_type\n" +
  2368  			"         │           │                   └─ columns: [id kind]\n" +
  2369  			"         │           └─ TableAlias(mi)\n" +
  2370  			"         │               └─ IndexedTableAccess(movie_info)\n" +
  2371  			"         │                   ├─ index: [movie_info.movie_id]\n" +
  2372  			"         │                   ├─ columns: [movie_id info_type_id info]\n" +
  2373  			"         │                   └─ keys: mc.movie_id\n" +
  2374  			"         └─ HashLookup\n" +
  2375  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, mc.movie_id)\n" +
  2376  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  2377  			"             └─ Filter\n" +
  2378  			"                 ├─ ((t.production_year > 2000) AND (((t.title >= 'Birdemic') AND (t.title <= 'Birdemicÿ')) OR t.title LIKE '%Movie%'))\n" +
  2379  			"                 └─ TableAlias(t)\n" +
  2380  			"                     └─ Table\n" +
  2381  			"                         ├─ name: title\n" +
  2382  			"                         └─ columns: [id title production_year]\n" +
  2383  			"",
  2384  		ExpectedAnalysis: "Project\n" +
  2385  			" ├─ columns: [min(mi.info) as budget, min(t.title) as unsuccsessful_movie]\n" +
  2386  			" └─ GroupBy\n" +
  2387  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  2388  			"     ├─ Grouping()\n" +
  2389  			"     └─ HashJoin\n" +
  2390  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = mc.movie_id))\n" +
  2391  			"         ├─ HashJoin\n" +
  2392  			"         │   ├─ (mi.info_type_id = it1.id)\n" +
  2393  			"         │   ├─ Filter\n" +
  2394  			"         │   │   ├─ (it1.info = 'budget')\n" +
  2395  			"         │   │   └─ TableAlias(it1)\n" +
  2396  			"         │   │       └─ Table\n" +
  2397  			"         │   │           ├─ name: info_type\n" +
  2398  			"         │   │           └─ columns: [id info]\n" +
  2399  			"         │   └─ HashLookup\n" +
  2400  			"         │       ├─ left-key: (it1.id)\n" +
  2401  			"         │       ├─ right-key: (mi.info_type_id)\n" +
  2402  			"         │       └─ LookupJoin\n" +
  2403  			"         │           ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  2404  			"         │           ├─ InnerJoin\n" +
  2405  			"         │           │   ├─ (mc.movie_id = mi_idx.movie_id)\n" +
  2406  			"         │           │   ├─ InnerJoin\n" +
  2407  			"         │           │   │   ├─ (mi_idx.info_type_id = it2.id)\n" +
  2408  			"         │           │   │   ├─ TableAlias(mi_idx)\n" +
  2409  			"         │           │   │   │   └─ Table\n" +
  2410  			"         │           │   │   │       ├─ name: movie_info_idx\n" +
  2411  			"         │           │   │   │       └─ columns: [movie_id info_type_id]\n" +
  2412  			"         │           │   │   └─ Filter\n" +
  2413  			"         │           │   │       ├─ (it2.info = 'bottom 10 rank')\n" +
  2414  			"         │           │   │       └─ TableAlias(it2)\n" +
  2415  			"         │           │   │           └─ Table\n" +
  2416  			"         │           │   │               ├─ name: info_type\n" +
  2417  			"         │           │   │               └─ columns: [id info]\n" +
  2418  			"         │           │   └─ InnerJoin\n" +
  2419  			"         │           │       ├─ (ct.id = mc.company_type_id)\n" +
  2420  			"         │           │       ├─ InnerJoin\n" +
  2421  			"         │           │       │   ├─ (cn.id = mc.company_id)\n" +
  2422  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2423  			"         │           │       │   │   └─ Table\n" +
  2424  			"         │           │       │   │       ├─ name: movie_companies\n" +
  2425  			"         │           │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  2426  			"         │           │       │   └─ Filter\n" +
  2427  			"         │           │       │       ├─ (cn.country_code = '[us]')\n" +
  2428  			"         │           │       │       └─ TableAlias(cn)\n" +
  2429  			"         │           │       │           └─ Table\n" +
  2430  			"         │           │       │               ├─ name: company_name\n" +
  2431  			"         │           │       │               └─ columns: [id country_code]\n" +
  2432  			"         │           │       └─ Filter\n" +
  2433  			"         │           │           ├─ ((NOT(ct.kind IS NULL)) AND ((ct.kind = 'production companies') OR (ct.kind = 'distributors')))\n" +
  2434  			"         │           │           └─ TableAlias(ct)\n" +
  2435  			"         │           │               └─ Table\n" +
  2436  			"         │           │                   ├─ name: company_type\n" +
  2437  			"         │           │                   └─ columns: [id kind]\n" +
  2438  			"         │           └─ TableAlias(mi)\n" +
  2439  			"         │               └─ IndexedTableAccess(movie_info)\n" +
  2440  			"         │                   ├─ index: [movie_info.movie_id]\n" +
  2441  			"         │                   ├─ columns: [movie_id info_type_id info]\n" +
  2442  			"         │                   └─ keys: mc.movie_id\n" +
  2443  			"         └─ HashLookup\n" +
  2444  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, mc.movie_id)\n" +
  2445  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  2446  			"             └─ Filter\n" +
  2447  			"                 ├─ ((t.production_year > 2000) AND (((t.title >= 'Birdemic') AND (t.title <= 'Birdemicÿ')) OR t.title LIKE '%Movie%'))\n" +
  2448  			"                 └─ TableAlias(t)\n" +
  2449  			"                     └─ Table\n" +
  2450  			"                         ├─ name: title\n" +
  2451  			"                         └─ columns: [id title production_year]\n" +
  2452  			"",
  2453  	},
  2454  	{
  2455  		Query: `
  2456  SELECT MIN(cn.name) AS movie_company,
  2457         MIN(mi_idx.info) AS rating,
  2458         MIN(t.title) AS mainstream_movie
  2459  FROM company_name AS cn,
  2460       company_type AS ct,
  2461       info_type AS it1,
  2462       info_type AS it2,
  2463       movie_companies AS mc,
  2464       movie_info AS mi,
  2465       movie_info_idx AS mi_idx,
  2466       title AS t
  2467  WHERE cn.country_code = '[us]'
  2468    AND ct.kind = 'production companies'
  2469    AND it1.info = 'genres'
  2470    AND it2.info = 'rating'
  2471    AND mi.info IN ('Drama',
  2472                    'Horror',
  2473                    'Western',
  2474                    'Family')
  2475    AND mi_idx.info > '7.0'
  2476    AND t.production_year BETWEEN 2000 AND 2010
  2477    AND t.id = mi.movie_id
  2478    AND t.id = mi_idx.movie_id
  2479    AND mi.info_type_id = it1.id
  2480    AND mi_idx.info_type_id = it2.id
  2481    AND t.id = mc.movie_id
  2482    AND ct.id = mc.company_type_id
  2483    AND cn.id = mc.company_id
  2484    AND mc.movie_id = mi.movie_id
  2485    AND mc.movie_id = mi_idx.movie_id
  2486    AND mi.movie_id = mi_idx.movie_id;
  2487  
  2488  `,
  2489  		ExpectedPlan: "Project\n" +
  2490  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as mainstream_movie]\n" +
  2491  			" └─ GroupBy\n" +
  2492  			"     ├─ select: MIN(cn.name:11!null), MIN(mi_idx.info:4!null), MIN(t.title:19!null)\n" +
  2493  			"     ├─ group: \n" +
  2494  			"     └─ HashJoin\n" +
  2495  			"         ├─ AND\n" +
  2496  			"         │   ├─ AND\n" +
  2497  			"         │   │   ├─ Eq\n" +
  2498  			"         │   │   │   ├─ t.id:18!null\n" +
  2499  			"         │   │   │   └─ mi.movie_id:15!null\n" +
  2500  			"         │   │   └─ Eq\n" +
  2501  			"         │   │       ├─ t.id:18!null\n" +
  2502  			"         │   │       └─ mi_idx.movie_id:2!null\n" +
  2503  			"         │   └─ Eq\n" +
  2504  			"         │       ├─ t.id:18!null\n" +
  2505  			"         │       └─ mc.movie_id:7!null\n" +
  2506  			"         ├─ HashJoin\n" +
  2507  			"         │   ├─ Eq\n" +
  2508  			"         │   │   ├─ mi.info_type_id:16!null\n" +
  2509  			"         │   │   └─ it1.id:0!null\n" +
  2510  			"         │   ├─ Filter\n" +
  2511  			"         │   │   ├─ Eq\n" +
  2512  			"         │   │   │   ├─ it1.info:1!null\n" +
  2513  			"         │   │   │   └─ genres (longtext)\n" +
  2514  			"         │   │   └─ TableAlias(it1)\n" +
  2515  			"         │   │       └─ ProcessTable\n" +
  2516  			"         │   │           └─ Table\n" +
  2517  			"         │   │               ├─ name: info_type\n" +
  2518  			"         │   │               └─ columns: [id info]\n" +
  2519  			"         │   └─ HashLookup\n" +
  2520  			"         │       ├─ left-key: TUPLE(it1.id:0!null)\n" +
  2521  			"         │       ├─ right-key: TUPLE(mi.info_type_id:14!null)\n" +
  2522  			"         │       └─ LookupJoin\n" +
  2523  			"         │           ├─ Eq\n" +
  2524  			"         │           │   ├─ mi.movie_id:15!null\n" +
  2525  			"         │           │   └─ mi_idx.movie_id:2!null\n" +
  2526  			"         │           ├─ InnerJoin\n" +
  2527  			"         │           │   ├─ Eq\n" +
  2528  			"         │           │   │   ├─ mc.movie_id:7!null\n" +
  2529  			"         │           │   │   └─ mi_idx.movie_id:2!null\n" +
  2530  			"         │           │   ├─ InnerJoin\n" +
  2531  			"         │           │   │   ├─ Eq\n" +
  2532  			"         │           │   │   │   ├─ mi_idx.info_type_id:3!null\n" +
  2533  			"         │           │   │   │   └─ it2.id:5!null\n" +
  2534  			"         │           │   │   ├─ Filter\n" +
  2535  			"         │           │   │   │   ├─ GreaterThan\n" +
  2536  			"         │           │   │   │   │   ├─ mi_idx.info:2!null\n" +
  2537  			"         │           │   │   │   │   └─ 7.0 (longtext)\n" +
  2538  			"         │           │   │   │   └─ TableAlias(mi_idx)\n" +
  2539  			"         │           │   │   │       └─ ProcessTable\n" +
  2540  			"         │           │   │   │           └─ Table\n" +
  2541  			"         │           │   │   │               ├─ name: movie_info_idx\n" +
  2542  			"         │           │   │   │               └─ columns: [movie_id info_type_id info]\n" +
  2543  			"         │           │   │   └─ Filter\n" +
  2544  			"         │           │   │       ├─ Eq\n" +
  2545  			"         │           │   │       │   ├─ it2.info:1!null\n" +
  2546  			"         │           │   │       │   └─ rating (longtext)\n" +
  2547  			"         │           │   │       └─ TableAlias(it2)\n" +
  2548  			"         │           │   │           └─ Table\n" +
  2549  			"         │           │   │               ├─ name: info_type\n" +
  2550  			"         │           │   │               ├─ columns: [id info]\n" +
  2551  			"         │           │   │               ├─ colSet: (12,13)\n" +
  2552  			"         │           │   │               └─ tableId: 4\n" +
  2553  			"         │           │   └─ InnerJoin\n" +
  2554  			"         │           │       ├─ Eq\n" +
  2555  			"         │           │       │   ├─ ct.id:13!null\n" +
  2556  			"         │           │       │   └─ mc.company_type_id:9!null\n" +
  2557  			"         │           │       ├─ InnerJoin\n" +
  2558  			"         │           │       │   ├─ Eq\n" +
  2559  			"         │           │       │   │   ├─ cn.id:10!null\n" +
  2560  			"         │           │       │   │   └─ mc.company_id:8!null\n" +
  2561  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2562  			"         │           │       │   │   └─ ProcessTable\n" +
  2563  			"         │           │       │   │       └─ Table\n" +
  2564  			"         │           │       │   │           ├─ name: movie_companies\n" +
  2565  			"         │           │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  2566  			"         │           │       │   └─ Filter\n" +
  2567  			"         │           │       │       ├─ Eq\n" +
  2568  			"         │           │       │       │   ├─ cn.country_code:2\n" +
  2569  			"         │           │       │       │   └─ [us] (longtext)\n" +
  2570  			"         │           │       │       └─ TableAlias(cn)\n" +
  2571  			"         │           │       │           └─ ProcessTable\n" +
  2572  			"         │           │       │               └─ Table\n" +
  2573  			"         │           │       │                   ├─ name: company_name\n" +
  2574  			"         │           │       │                   └─ columns: [id name country_code]\n" +
  2575  			"         │           │       └─ Filter\n" +
  2576  			"         │           │           ├─ Eq\n" +
  2577  			"         │           │           │   ├─ ct.kind:1!null\n" +
  2578  			"         │           │           │   └─ production companies (longtext)\n" +
  2579  			"         │           │           └─ TableAlias(ct)\n" +
  2580  			"         │           │               └─ ProcessTable\n" +
  2581  			"         │           │                   └─ Table\n" +
  2582  			"         │           │                       ├─ name: company_type\n" +
  2583  			"         │           │                       └─ columns: [id kind]\n" +
  2584  			"         │           └─ Filter\n" +
  2585  			"         │               ├─ HashIn\n" +
  2586  			"         │               │   ├─ mi.info:2!null\n" +
  2587  			"         │               │   └─ TUPLE(Drama (longtext), Horror (longtext), Western (longtext), Family (longtext))\n" +
  2588  			"         │               └─ TableAlias(mi)\n" +
  2589  			"         │                   └─ IndexedTableAccess(movie_info)\n" +
  2590  			"         │                       ├─ index: [movie_info.movie_id]\n" +
  2591  			"         │                       ├─ keys: [mc.movie_id:7!null]\n" +
  2592  			"         │                       ├─ colSet: (19-23)\n" +
  2593  			"         │                       ├─ tableId: 6\n" +
  2594  			"         │                       └─ Table\n" +
  2595  			"         │                           ├─ name: movie_info\n" +
  2596  			"         │                           └─ columns: [movie_id info_type_id info]\n" +
  2597  			"         └─ HashLookup\n" +
  2598  			"             ├─ left-key: TUPLE(mi.movie_id:15!null, mi_idx.movie_id:2!null, mc.movie_id:7!null)\n" +
  2599  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  2600  			"             └─ Filter\n" +
  2601  			"                 ├─ AND\n" +
  2602  			"                 │   ├─ GreaterThanOrEqual\n" +
  2603  			"                 │   │   ├─ t.production_year:2\n" +
  2604  			"                 │   │   └─ 2000 (smallint)\n" +
  2605  			"                 │   └─ LessThanOrEqual\n" +
  2606  			"                 │       ├─ t.production_year:2\n" +
  2607  			"                 │       └─ 2010 (smallint)\n" +
  2608  			"                 └─ TableAlias(t)\n" +
  2609  			"                     └─ ProcessTable\n" +
  2610  			"                         └─ Table\n" +
  2611  			"                             ├─ name: title\n" +
  2612  			"                             └─ columns: [id title production_year]\n" +
  2613  			"",
  2614  		ExpectedEstimates: "Project\n" +
  2615  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as mainstream_movie]\n" +
  2616  			" └─ GroupBy\n" +
  2617  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
  2618  			"     ├─ Grouping()\n" +
  2619  			"     └─ HashJoin\n" +
  2620  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = mc.movie_id))\n" +
  2621  			"         ├─ HashJoin\n" +
  2622  			"         │   ├─ (mi.info_type_id = it1.id)\n" +
  2623  			"         │   ├─ Filter\n" +
  2624  			"         │   │   ├─ (it1.info = 'genres')\n" +
  2625  			"         │   │   └─ TableAlias(it1)\n" +
  2626  			"         │   │       └─ Table\n" +
  2627  			"         │   │           ├─ name: info_type\n" +
  2628  			"         │   │           └─ columns: [id info]\n" +
  2629  			"         │   └─ HashLookup\n" +
  2630  			"         │       ├─ left-key: (it1.id)\n" +
  2631  			"         │       ├─ right-key: (mi.info_type_id)\n" +
  2632  			"         │       └─ LookupJoin\n" +
  2633  			"         │           ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  2634  			"         │           ├─ InnerJoin\n" +
  2635  			"         │           │   ├─ (mc.movie_id = mi_idx.movie_id)\n" +
  2636  			"         │           │   ├─ InnerJoin\n" +
  2637  			"         │           │   │   ├─ (mi_idx.info_type_id = it2.id)\n" +
  2638  			"         │           │   │   ├─ Filter\n" +
  2639  			"         │           │   │   │   ├─ (mi_idx.info > '7.0')\n" +
  2640  			"         │           │   │   │   └─ TableAlias(mi_idx)\n" +
  2641  			"         │           │   │   │       └─ Table\n" +
  2642  			"         │           │   │   │           ├─ name: movie_info_idx\n" +
  2643  			"         │           │   │   │           └─ columns: [movie_id info_type_id info]\n" +
  2644  			"         │           │   │   └─ Filter\n" +
  2645  			"         │           │   │       ├─ (it2.info = 'rating')\n" +
  2646  			"         │           │   │       └─ TableAlias(it2)\n" +
  2647  			"         │           │   │           └─ Table\n" +
  2648  			"         │           │   │               ├─ name: info_type\n" +
  2649  			"         │           │   │               └─ columns: [id info]\n" +
  2650  			"         │           │   └─ InnerJoin\n" +
  2651  			"         │           │       ├─ (ct.id = mc.company_type_id)\n" +
  2652  			"         │           │       ├─ InnerJoin\n" +
  2653  			"         │           │       │   ├─ (cn.id = mc.company_id)\n" +
  2654  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2655  			"         │           │       │   │   └─ Table\n" +
  2656  			"         │           │       │   │       ├─ name: movie_companies\n" +
  2657  			"         │           │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  2658  			"         │           │       │   └─ Filter\n" +
  2659  			"         │           │       │       ├─ (cn.country_code = '[us]')\n" +
  2660  			"         │           │       │       └─ TableAlias(cn)\n" +
  2661  			"         │           │       │           └─ Table\n" +
  2662  			"         │           │       │               ├─ name: company_name\n" +
  2663  			"         │           │       │               └─ columns: [id name country_code]\n" +
  2664  			"         │           │       └─ Filter\n" +
  2665  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
  2666  			"         │           │           └─ TableAlias(ct)\n" +
  2667  			"         │           │               └─ Table\n" +
  2668  			"         │           │                   ├─ name: company_type\n" +
  2669  			"         │           │                   └─ columns: [id kind]\n" +
  2670  			"         │           └─ Filter\n" +
  2671  			"         │               ├─ (mi.info HASH IN ('Drama', 'Horror', 'Western', 'Family'))\n" +
  2672  			"         │               └─ TableAlias(mi)\n" +
  2673  			"         │                   └─ IndexedTableAccess(movie_info)\n" +
  2674  			"         │                       ├─ index: [movie_info.movie_id]\n" +
  2675  			"         │                       ├─ columns: [movie_id info_type_id info]\n" +
  2676  			"         │                       └─ keys: mc.movie_id\n" +
  2677  			"         └─ HashLookup\n" +
  2678  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, mc.movie_id)\n" +
  2679  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  2680  			"             └─ Filter\n" +
  2681  			"                 ├─ ((t.production_year >= 2000) AND (t.production_year <= 2010))\n" +
  2682  			"                 └─ TableAlias(t)\n" +
  2683  			"                     └─ Table\n" +
  2684  			"                         ├─ name: title\n" +
  2685  			"                         └─ columns: [id title production_year]\n" +
  2686  			"",
  2687  		ExpectedAnalysis: "Project\n" +
  2688  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as mainstream_movie]\n" +
  2689  			" └─ GroupBy\n" +
  2690  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
  2691  			"     ├─ Grouping()\n" +
  2692  			"     └─ HashJoin\n" +
  2693  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = mc.movie_id))\n" +
  2694  			"         ├─ HashJoin\n" +
  2695  			"         │   ├─ (mi.info_type_id = it1.id)\n" +
  2696  			"         │   ├─ Filter\n" +
  2697  			"         │   │   ├─ (it1.info = 'genres')\n" +
  2698  			"         │   │   └─ TableAlias(it1)\n" +
  2699  			"         │   │       └─ Table\n" +
  2700  			"         │   │           ├─ name: info_type\n" +
  2701  			"         │   │           └─ columns: [id info]\n" +
  2702  			"         │   └─ HashLookup\n" +
  2703  			"         │       ├─ left-key: (it1.id)\n" +
  2704  			"         │       ├─ right-key: (mi.info_type_id)\n" +
  2705  			"         │       └─ LookupJoin\n" +
  2706  			"         │           ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  2707  			"         │           ├─ InnerJoin\n" +
  2708  			"         │           │   ├─ (mc.movie_id = mi_idx.movie_id)\n" +
  2709  			"         │           │   ├─ InnerJoin\n" +
  2710  			"         │           │   │   ├─ (mi_idx.info_type_id = it2.id)\n" +
  2711  			"         │           │   │   ├─ Filter\n" +
  2712  			"         │           │   │   │   ├─ (mi_idx.info > '7.0')\n" +
  2713  			"         │           │   │   │   └─ TableAlias(mi_idx)\n" +
  2714  			"         │           │   │   │       └─ Table\n" +
  2715  			"         │           │   │   │           ├─ name: movie_info_idx\n" +
  2716  			"         │           │   │   │           └─ columns: [movie_id info_type_id info]\n" +
  2717  			"         │           │   │   └─ Filter\n" +
  2718  			"         │           │   │       ├─ (it2.info = 'rating')\n" +
  2719  			"         │           │   │       └─ TableAlias(it2)\n" +
  2720  			"         │           │   │           └─ Table\n" +
  2721  			"         │           │   │               ├─ name: info_type\n" +
  2722  			"         │           │   │               └─ columns: [id info]\n" +
  2723  			"         │           │   └─ InnerJoin\n" +
  2724  			"         │           │       ├─ (ct.id = mc.company_type_id)\n" +
  2725  			"         │           │       ├─ InnerJoin\n" +
  2726  			"         │           │       │   ├─ (cn.id = mc.company_id)\n" +
  2727  			"         │           │       │   ├─ TableAlias(mc)\n" +
  2728  			"         │           │       │   │   └─ Table\n" +
  2729  			"         │           │       │   │       ├─ name: movie_companies\n" +
  2730  			"         │           │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  2731  			"         │           │       │   └─ Filter\n" +
  2732  			"         │           │       │       ├─ (cn.country_code = '[us]')\n" +
  2733  			"         │           │       │       └─ TableAlias(cn)\n" +
  2734  			"         │           │       │           └─ Table\n" +
  2735  			"         │           │       │               ├─ name: company_name\n" +
  2736  			"         │           │       │               └─ columns: [id name country_code]\n" +
  2737  			"         │           │       └─ Filter\n" +
  2738  			"         │           │           ├─ (ct.kind = 'production companies')\n" +
  2739  			"         │           │           └─ TableAlias(ct)\n" +
  2740  			"         │           │               └─ Table\n" +
  2741  			"         │           │                   ├─ name: company_type\n" +
  2742  			"         │           │                   └─ columns: [id kind]\n" +
  2743  			"         │           └─ Filter\n" +
  2744  			"         │               ├─ (mi.info HASH IN ('Drama', 'Horror', 'Western', 'Family'))\n" +
  2745  			"         │               └─ TableAlias(mi)\n" +
  2746  			"         │                   └─ IndexedTableAccess(movie_info)\n" +
  2747  			"         │                       ├─ index: [movie_info.movie_id]\n" +
  2748  			"         │                       ├─ columns: [movie_id info_type_id info]\n" +
  2749  			"         │                       └─ keys: mc.movie_id\n" +
  2750  			"         └─ HashLookup\n" +
  2751  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, mc.movie_id)\n" +
  2752  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  2753  			"             └─ Filter\n" +
  2754  			"                 ├─ ((t.production_year >= 2000) AND (t.production_year <= 2010))\n" +
  2755  			"                 └─ TableAlias(t)\n" +
  2756  			"                     └─ Table\n" +
  2757  			"                         ├─ name: title\n" +
  2758  			"                         └─ columns: [id title production_year]\n" +
  2759  			"",
  2760  	},
  2761  	{
  2762  		Query: `
  2763  SELECT MIN(mi.info) AS release_date,
  2764         MIN(miidx.info) AS rating,
  2765         MIN(t.title) AS german_movie
  2766  FROM company_name AS cn,
  2767       company_type AS ct,
  2768       info_type AS it,
  2769       info_type AS it2,
  2770       kind_type AS kt,
  2771       movie_companies AS mc,
  2772       movie_info AS mi,
  2773       movie_info_idx AS miidx,
  2774       title AS t
  2775  WHERE cn.country_code ='[de]'
  2776    AND ct.kind ='production companies'
  2777    AND it.info ='rating'
  2778    AND it2.info ='release dates'
  2779    AND kt.kind ='movie'
  2780    AND mi.movie_id = t.id
  2781    AND it2.id = mi.info_type_id
  2782    AND kt.id = t.kind_id
  2783    AND mc.movie_id = t.id
  2784    AND cn.id = mc.company_id
  2785    AND ct.id = mc.company_type_id
  2786    AND miidx.movie_id = t.id
  2787    AND it.id = miidx.info_type_id
  2788    AND mi.movie_id = miidx.movie_id
  2789    AND mi.movie_id = mc.movie_id
  2790    AND miidx.movie_id = mc.movie_id;
  2791  
  2792  `,
  2793  		ExpectedPlan: "Project\n" +
  2794  			" ├─ columns: [min(mi.info):0!null as release_date, min(miidx.info):1!null as rating, min(t.title):2!null as german_movie]\n" +
  2795  			" └─ GroupBy\n" +
  2796  			"     ├─ select: MIN(mi.info:16!null), MIN(miidx.info:21!null), MIN(t.title:10!null)\n" +
  2797  			"     ├─ group: \n" +
  2798  			"     └─ HashJoin\n" +
  2799  			"         ├─ Eq\n" +
  2800  			"         │   ├─ it.id:0!null\n" +
  2801  			"         │   └─ miidx.info_type_id:20!null\n" +
  2802  			"         ├─ Filter\n" +
  2803  			"         │   ├─ Eq\n" +
  2804  			"         │   │   ├─ it.info:1!null\n" +
  2805  			"         │   │   └─ rating (longtext)\n" +
  2806  			"         │   └─ TableAlias(it)\n" +
  2807  			"         │       └─ ProcessTable\n" +
  2808  			"         │           └─ Table\n" +
  2809  			"         │               ├─ name: info_type\n" +
  2810  			"         │               └─ columns: [id info]\n" +
  2811  			"         └─ HashLookup\n" +
  2812  			"             ├─ left-key: TUPLE(it.id:0!null)\n" +
  2813  			"             ├─ right-key: TUPLE(miidx.info_type_id:18!null)\n" +
  2814  			"             └─ HashJoin\n" +
  2815  			"                 ├─ AND\n" +
  2816  			"                 │   ├─ Eq\n" +
  2817  			"                 │   │   ├─ mi.movie_id:14!null\n" +
  2818  			"                 │   │   └─ mc.movie_id:2!null\n" +
  2819  			"                 │   └─ Eq\n" +
  2820  			"                 │       ├─ miidx.movie_id:19!null\n" +
  2821  			"                 │       └─ mc.movie_id:2!null\n" +
  2822  			"                 ├─ InnerJoin\n" +
  2823  			"                 │   ├─ Eq\n" +
  2824  			"                 │   │   ├─ ct.id:7!null\n" +
  2825  			"                 │   │   └─ mc.company_type_id:4!null\n" +
  2826  			"                 │   ├─ InnerJoin\n" +
  2827  			"                 │   │   ├─ Eq\n" +
  2828  			"                 │   │   │   ├─ cn.id:5!null\n" +
  2829  			"                 │   │   │   └─ mc.company_id:3!null\n" +
  2830  			"                 │   │   ├─ TableAlias(mc)\n" +
  2831  			"                 │   │   │   └─ ProcessTable\n" +
  2832  			"                 │   │   │       └─ Table\n" +
  2833  			"                 │   │   │           ├─ name: movie_companies\n" +
  2834  			"                 │   │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  2835  			"                 │   │   └─ Filter\n" +
  2836  			"                 │   │       ├─ Eq\n" +
  2837  			"                 │   │       │   ├─ cn.country_code:1\n" +
  2838  			"                 │   │       │   └─ [de] (longtext)\n" +
  2839  			"                 │   │       └─ TableAlias(cn)\n" +
  2840  			"                 │   │           └─ ProcessTable\n" +
  2841  			"                 │   │               └─ Table\n" +
  2842  			"                 │   │                   ├─ name: company_name\n" +
  2843  			"                 │   │                   └─ columns: [id country_code]\n" +
  2844  			"                 │   └─ Filter\n" +
  2845  			"                 │       ├─ Eq\n" +
  2846  			"                 │       │   ├─ ct.kind:1!null\n" +
  2847  			"                 │       │   └─ production companies (longtext)\n" +
  2848  			"                 │       └─ TableAlias(ct)\n" +
  2849  			"                 │           └─ ProcessTable\n" +
  2850  			"                 │               └─ Table\n" +
  2851  			"                 │                   ├─ name: company_type\n" +
  2852  			"                 │                   └─ columns: [id kind]\n" +
  2853  			"                 └─ HashLookup\n" +
  2854  			"                     ├─ left-key: TUPLE(mc.movie_id:2!null, mc.movie_id:2!null)\n" +
  2855  			"                     ├─ right-key: TUPLE(mi.movie_id:5!null, miidx.movie_id:10!null)\n" +
  2856  			"                     └─ LookupJoin\n" +
  2857  			"                         ├─ Eq\n" +
  2858  			"                         │   ├─ miidx.movie_id:19!null\n" +
  2859  			"                         │   └─ t.id:9!null\n" +
  2860  			"                         ├─ InnerJoin\n" +
  2861  			"                         │   ├─ Eq\n" +
  2862  			"                         │   │   ├─ mi.movie_id:14!null\n" +
  2863  			"                         │   │   └─ t.id:9!null\n" +
  2864  			"                         │   ├─ InnerJoin\n" +
  2865  			"                         │   │   ├─ Eq\n" +
  2866  			"                         │   │   │   ├─ kt.id:12!null\n" +
  2867  			"                         │   │   │   └─ t.kind_id:11!null\n" +
  2868  			"                         │   │   ├─ TableAlias(t)\n" +
  2869  			"                         │   │   │   └─ ProcessTable\n" +
  2870  			"                         │   │   │       └─ Table\n" +
  2871  			"                         │   │   │           ├─ name: title\n" +
  2872  			"                         │   │   │           └─ columns: [id title kind_id]\n" +
  2873  			"                         │   │   └─ Filter\n" +
  2874  			"                         │   │       ├─ Eq\n" +
  2875  			"                         │   │       │   ├─ kt.kind:1!null\n" +
  2876  			"                         │   │       │   └─ movie (longtext)\n" +
  2877  			"                         │   │       └─ TableAlias(kt)\n" +
  2878  			"                         │   │           └─ ProcessTable\n" +
  2879  			"                         │   │               └─ Table\n" +
  2880  			"                         │   │                   ├─ name: kind_type\n" +
  2881  			"                         │   │                   └─ columns: [id kind]\n" +
  2882  			"                         │   └─ InnerJoin\n" +
  2883  			"                         │       ├─ Eq\n" +
  2884  			"                         │       │   ├─ it2.id:17!null\n" +
  2885  			"                         │       │   └─ mi.info_type_id:15!null\n" +
  2886  			"                         │       ├─ TableAlias(mi)\n" +
  2887  			"                         │       │   └─ ProcessTable\n" +
  2888  			"                         │       │       └─ Table\n" +
  2889  			"                         │       │           ├─ name: movie_info\n" +
  2890  			"                         │       │           └─ columns: [movie_id info_type_id info]\n" +
  2891  			"                         │       └─ Filter\n" +
  2892  			"                         │           ├─ Eq\n" +
  2893  			"                         │           │   ├─ it2.info:1!null\n" +
  2894  			"                         │           │   └─ release dates (longtext)\n" +
  2895  			"                         │           └─ TableAlias(it2)\n" +
  2896  			"                         │               └─ Table\n" +
  2897  			"                         │                   ├─ name: info_type\n" +
  2898  			"                         │                   ├─ columns: [id info]\n" +
  2899  			"                         │                   ├─ colSet: (12,13)\n" +
  2900  			"                         │                   └─ tableId: 4\n" +
  2901  			"                         └─ TableAlias(miidx)\n" +
  2902  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  2903  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  2904  			"                                 ├─ keys: [mi.movie_id:14!null]\n" +
  2905  			"                                 ├─ colSet: (26-30)\n" +
  2906  			"                                 ├─ tableId: 8\n" +
  2907  			"                                 └─ Table\n" +
  2908  			"                                     ├─ name: movie_info_idx\n" +
  2909  			"                                     └─ columns: [movie_id info_type_id info]\n" +
  2910  			"",
  2911  		ExpectedEstimates: "Project\n" +
  2912  			" ├─ columns: [min(mi.info) as release_date, min(miidx.info) as rating, min(t.title) as german_movie]\n" +
  2913  			" └─ GroupBy\n" +
  2914  			"     ├─ SelectedExprs(MIN(mi.info), MIN(miidx.info), MIN(t.title))\n" +
  2915  			"     ├─ Grouping()\n" +
  2916  			"     └─ HashJoin\n" +
  2917  			"         ├─ (it.id = miidx.info_type_id)\n" +
  2918  			"         ├─ Filter\n" +
  2919  			"         │   ├─ (it.info = 'rating')\n" +
  2920  			"         │   └─ TableAlias(it)\n" +
  2921  			"         │       └─ Table\n" +
  2922  			"         │           ├─ name: info_type\n" +
  2923  			"         │           └─ columns: [id info]\n" +
  2924  			"         └─ HashLookup\n" +
  2925  			"             ├─ left-key: (it.id)\n" +
  2926  			"             ├─ right-key: (miidx.info_type_id)\n" +
  2927  			"             └─ HashJoin\n" +
  2928  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  2929  			"                 ├─ InnerJoin\n" +
  2930  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  2931  			"                 │   ├─ InnerJoin\n" +
  2932  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  2933  			"                 │   │   ├─ TableAlias(mc)\n" +
  2934  			"                 │   │   │   └─ Table\n" +
  2935  			"                 │   │   │       ├─ name: movie_companies\n" +
  2936  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  2937  			"                 │   │   └─ Filter\n" +
  2938  			"                 │   │       ├─ (cn.country_code = '[de]')\n" +
  2939  			"                 │   │       └─ TableAlias(cn)\n" +
  2940  			"                 │   │           └─ Table\n" +
  2941  			"                 │   │               ├─ name: company_name\n" +
  2942  			"                 │   │               └─ columns: [id country_code]\n" +
  2943  			"                 │   └─ Filter\n" +
  2944  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  2945  			"                 │       └─ TableAlias(ct)\n" +
  2946  			"                 │           └─ Table\n" +
  2947  			"                 │               ├─ name: company_type\n" +
  2948  			"                 │               └─ columns: [id kind]\n" +
  2949  			"                 └─ HashLookup\n" +
  2950  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  2951  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  2952  			"                     └─ LookupJoin\n" +
  2953  			"                         ├─ (miidx.movie_id = t.id)\n" +
  2954  			"                         ├─ InnerJoin\n" +
  2955  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  2956  			"                         │   ├─ InnerJoin\n" +
  2957  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  2958  			"                         │   │   ├─ TableAlias(t)\n" +
  2959  			"                         │   │   │   └─ Table\n" +
  2960  			"                         │   │   │       ├─ name: title\n" +
  2961  			"                         │   │   │       └─ columns: [id title kind_id]\n" +
  2962  			"                         │   │   └─ Filter\n" +
  2963  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  2964  			"                         │   │       └─ TableAlias(kt)\n" +
  2965  			"                         │   │           └─ Table\n" +
  2966  			"                         │   │               ├─ name: kind_type\n" +
  2967  			"                         │   │               └─ columns: [id kind]\n" +
  2968  			"                         │   └─ InnerJoin\n" +
  2969  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  2970  			"                         │       ├─ TableAlias(mi)\n" +
  2971  			"                         │       │   └─ Table\n" +
  2972  			"                         │       │       ├─ name: movie_info\n" +
  2973  			"                         │       │       └─ columns: [movie_id info_type_id info]\n" +
  2974  			"                         │       └─ Filter\n" +
  2975  			"                         │           ├─ (it2.info = 'release dates')\n" +
  2976  			"                         │           └─ TableAlias(it2)\n" +
  2977  			"                         │               └─ Table\n" +
  2978  			"                         │                   ├─ name: info_type\n" +
  2979  			"                         │                   └─ columns: [id info]\n" +
  2980  			"                         └─ TableAlias(miidx)\n" +
  2981  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  2982  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  2983  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  2984  			"                                 └─ keys: mi.movie_id\n" +
  2985  			"",
  2986  		ExpectedAnalysis: "Project\n" +
  2987  			" ├─ columns: [min(mi.info) as release_date, min(miidx.info) as rating, min(t.title) as german_movie]\n" +
  2988  			" └─ GroupBy\n" +
  2989  			"     ├─ SelectedExprs(MIN(mi.info), MIN(miidx.info), MIN(t.title))\n" +
  2990  			"     ├─ Grouping()\n" +
  2991  			"     └─ HashJoin\n" +
  2992  			"         ├─ (it.id = miidx.info_type_id)\n" +
  2993  			"         ├─ Filter\n" +
  2994  			"         │   ├─ (it.info = 'rating')\n" +
  2995  			"         │   └─ TableAlias(it)\n" +
  2996  			"         │       └─ Table\n" +
  2997  			"         │           ├─ name: info_type\n" +
  2998  			"         │           └─ columns: [id info]\n" +
  2999  			"         └─ HashLookup\n" +
  3000  			"             ├─ left-key: (it.id)\n" +
  3001  			"             ├─ right-key: (miidx.info_type_id)\n" +
  3002  			"             └─ HashJoin\n" +
  3003  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  3004  			"                 ├─ InnerJoin\n" +
  3005  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  3006  			"                 │   ├─ InnerJoin\n" +
  3007  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  3008  			"                 │   │   ├─ TableAlias(mc)\n" +
  3009  			"                 │   │   │   └─ Table\n" +
  3010  			"                 │   │   │       ├─ name: movie_companies\n" +
  3011  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  3012  			"                 │   │   └─ Filter\n" +
  3013  			"                 │   │       ├─ (cn.country_code = '[de]')\n" +
  3014  			"                 │   │       └─ TableAlias(cn)\n" +
  3015  			"                 │   │           └─ Table\n" +
  3016  			"                 │   │               ├─ name: company_name\n" +
  3017  			"                 │   │               └─ columns: [id country_code]\n" +
  3018  			"                 │   └─ Filter\n" +
  3019  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  3020  			"                 │       └─ TableAlias(ct)\n" +
  3021  			"                 │           └─ Table\n" +
  3022  			"                 │               ├─ name: company_type\n" +
  3023  			"                 │               └─ columns: [id kind]\n" +
  3024  			"                 └─ HashLookup\n" +
  3025  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  3026  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  3027  			"                     └─ LookupJoin\n" +
  3028  			"                         ├─ (miidx.movie_id = t.id)\n" +
  3029  			"                         ├─ InnerJoin\n" +
  3030  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  3031  			"                         │   ├─ InnerJoin\n" +
  3032  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  3033  			"                         │   │   ├─ TableAlias(t)\n" +
  3034  			"                         │   │   │   └─ Table\n" +
  3035  			"                         │   │   │       ├─ name: title\n" +
  3036  			"                         │   │   │       └─ columns: [id title kind_id]\n" +
  3037  			"                         │   │   └─ Filter\n" +
  3038  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  3039  			"                         │   │       └─ TableAlias(kt)\n" +
  3040  			"                         │   │           └─ Table\n" +
  3041  			"                         │   │               ├─ name: kind_type\n" +
  3042  			"                         │   │               └─ columns: [id kind]\n" +
  3043  			"                         │   └─ InnerJoin\n" +
  3044  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  3045  			"                         │       ├─ TableAlias(mi)\n" +
  3046  			"                         │       │   └─ Table\n" +
  3047  			"                         │       │       ├─ name: movie_info\n" +
  3048  			"                         │       │       └─ columns: [movie_id info_type_id info]\n" +
  3049  			"                         │       └─ Filter\n" +
  3050  			"                         │           ├─ (it2.info = 'release dates')\n" +
  3051  			"                         │           └─ TableAlias(it2)\n" +
  3052  			"                         │               └─ Table\n" +
  3053  			"                         │                   ├─ name: info_type\n" +
  3054  			"                         │                   └─ columns: [id info]\n" +
  3055  			"                         └─ TableAlias(miidx)\n" +
  3056  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3057  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3058  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  3059  			"                                 └─ keys: mi.movie_id\n" +
  3060  			"",
  3061  	},
  3062  	{
  3063  		Query: `
  3064  SELECT MIN(cn.name) AS producing_company,
  3065         MIN(miidx.info) AS rating,
  3066         MIN(t.title) AS movie_about_winning
  3067  FROM company_name AS cn,
  3068       company_type AS ct,
  3069       info_type AS it,
  3070       info_type AS it2,
  3071       kind_type AS kt,
  3072       movie_companies AS mc,
  3073       movie_info AS mi,
  3074       movie_info_idx AS miidx,
  3075       title AS t
  3076  WHERE cn.country_code ='[us]'
  3077    AND ct.kind ='production companies'
  3078    AND it.info ='rating'
  3079    AND it2.info ='release dates'
  3080    AND kt.kind ='movie'
  3081    AND t.title != ''
  3082    AND (t.title LIKE '%Champion%'
  3083         OR t.title LIKE '%Loser%')
  3084    AND mi.movie_id = t.id
  3085    AND it2.id = mi.info_type_id
  3086    AND kt.id = t.kind_id
  3087    AND mc.movie_id = t.id
  3088    AND cn.id = mc.company_id
  3089    AND ct.id = mc.company_type_id
  3090    AND miidx.movie_id = t.id
  3091    AND it.id = miidx.info_type_id
  3092    AND mi.movie_id = miidx.movie_id
  3093    AND mi.movie_id = mc.movie_id
  3094    AND miidx.movie_id = mc.movie_id;
  3095  
  3096  `,
  3097  		ExpectedPlan: "Project\n" +
  3098  			" ├─ columns: [min(cn.name):0!null as producing_company, min(miidx.info):1!null as rating, min(t.title):2!null as movie_about_winning]\n" +
  3099  			" └─ GroupBy\n" +
  3100  			"     ├─ select: MIN(cn.name:6!null), MIN(miidx.info:21!null), MIN(t.title:11!null)\n" +
  3101  			"     ├─ group: \n" +
  3102  			"     └─ HashJoin\n" +
  3103  			"         ├─ Eq\n" +
  3104  			"         │   ├─ it.id:0!null\n" +
  3105  			"         │   └─ miidx.info_type_id:20!null\n" +
  3106  			"         ├─ Filter\n" +
  3107  			"         │   ├─ Eq\n" +
  3108  			"         │   │   ├─ it.info:1!null\n" +
  3109  			"         │   │   └─ rating (longtext)\n" +
  3110  			"         │   └─ TableAlias(it)\n" +
  3111  			"         │       └─ ProcessTable\n" +
  3112  			"         │           └─ Table\n" +
  3113  			"         │               ├─ name: info_type\n" +
  3114  			"         │               └─ columns: [id info]\n" +
  3115  			"         └─ HashLookup\n" +
  3116  			"             ├─ left-key: TUPLE(it.id:0!null)\n" +
  3117  			"             ├─ right-key: TUPLE(miidx.info_type_id:18!null)\n" +
  3118  			"             └─ HashJoin\n" +
  3119  			"                 ├─ AND\n" +
  3120  			"                 │   ├─ Eq\n" +
  3121  			"                 │   │   ├─ mi.movie_id:15!null\n" +
  3122  			"                 │   │   └─ mc.movie_id:2!null\n" +
  3123  			"                 │   └─ Eq\n" +
  3124  			"                 │       ├─ miidx.movie_id:19!null\n" +
  3125  			"                 │       └─ mc.movie_id:2!null\n" +
  3126  			"                 ├─ InnerJoin\n" +
  3127  			"                 │   ├─ Eq\n" +
  3128  			"                 │   │   ├─ ct.id:8!null\n" +
  3129  			"                 │   │   └─ mc.company_type_id:4!null\n" +
  3130  			"                 │   ├─ InnerJoin\n" +
  3131  			"                 │   │   ├─ Eq\n" +
  3132  			"                 │   │   │   ├─ cn.id:5!null\n" +
  3133  			"                 │   │   │   └─ mc.company_id:3!null\n" +
  3134  			"                 │   │   ├─ TableAlias(mc)\n" +
  3135  			"                 │   │   │   └─ ProcessTable\n" +
  3136  			"                 │   │   │       └─ Table\n" +
  3137  			"                 │   │   │           ├─ name: movie_companies\n" +
  3138  			"                 │   │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  3139  			"                 │   │   └─ Filter\n" +
  3140  			"                 │   │       ├─ Eq\n" +
  3141  			"                 │   │       │   ├─ cn.country_code:2\n" +
  3142  			"                 │   │       │   └─ [us] (longtext)\n" +
  3143  			"                 │   │       └─ TableAlias(cn)\n" +
  3144  			"                 │   │           └─ ProcessTable\n" +
  3145  			"                 │   │               └─ Table\n" +
  3146  			"                 │   │                   ├─ name: company_name\n" +
  3147  			"                 │   │                   └─ columns: [id name country_code]\n" +
  3148  			"                 │   └─ Filter\n" +
  3149  			"                 │       ├─ Eq\n" +
  3150  			"                 │       │   ├─ ct.kind:1!null\n" +
  3151  			"                 │       │   └─ production companies (longtext)\n" +
  3152  			"                 │       └─ TableAlias(ct)\n" +
  3153  			"                 │           └─ ProcessTable\n" +
  3154  			"                 │               └─ Table\n" +
  3155  			"                 │                   ├─ name: company_type\n" +
  3156  			"                 │                   └─ columns: [id kind]\n" +
  3157  			"                 └─ HashLookup\n" +
  3158  			"                     ├─ left-key: TUPLE(mc.movie_id:2!null, mc.movie_id:2!null)\n" +
  3159  			"                     ├─ right-key: TUPLE(mi.movie_id:5!null, miidx.movie_id:9!null)\n" +
  3160  			"                     └─ LookupJoin\n" +
  3161  			"                         ├─ Eq\n" +
  3162  			"                         │   ├─ miidx.movie_id:19!null\n" +
  3163  			"                         │   └─ t.id:10!null\n" +
  3164  			"                         ├─ InnerJoin\n" +
  3165  			"                         │   ├─ Eq\n" +
  3166  			"                         │   │   ├─ mi.movie_id:15!null\n" +
  3167  			"                         │   │   └─ t.id:10!null\n" +
  3168  			"                         │   ├─ InnerJoin\n" +
  3169  			"                         │   │   ├─ Eq\n" +
  3170  			"                         │   │   │   ├─ kt.id:13!null\n" +
  3171  			"                         │   │   │   └─ t.kind_id:12!null\n" +
  3172  			"                         │   │   ├─ Filter\n" +
  3173  			"                         │   │   │   ├─ AND\n" +
  3174  			"                         │   │   │   │   ├─ NOT\n" +
  3175  			"                         │   │   │   │   │   └─ Eq\n" +
  3176  			"                         │   │   │   │   │       ├─ t.title:1!null\n" +
  3177  			"                         │   │   │   │   │       └─  (longtext)\n" +
  3178  			"                         │   │   │   │   └─ Or\n" +
  3179  			"                         │   │   │   │       ├─ t.title LIKE '%Champion%'\n" +
  3180  			"                         │   │   │   │       └─ t.title LIKE '%Loser%'\n" +
  3181  			"                         │   │   │   └─ TableAlias(t)\n" +
  3182  			"                         │   │   │       └─ ProcessTable\n" +
  3183  			"                         │   │   │           └─ Table\n" +
  3184  			"                         │   │   │               ├─ name: title\n" +
  3185  			"                         │   │   │               └─ columns: [id title kind_id]\n" +
  3186  			"                         │   │   └─ Filter\n" +
  3187  			"                         │   │       ├─ Eq\n" +
  3188  			"                         │   │       │   ├─ kt.kind:1!null\n" +
  3189  			"                         │   │       │   └─ movie (longtext)\n" +
  3190  			"                         │   │       └─ TableAlias(kt)\n" +
  3191  			"                         │   │           └─ ProcessTable\n" +
  3192  			"                         │   │               └─ Table\n" +
  3193  			"                         │   │                   ├─ name: kind_type\n" +
  3194  			"                         │   │                   └─ columns: [id kind]\n" +
  3195  			"                         │   └─ InnerJoin\n" +
  3196  			"                         │       ├─ Eq\n" +
  3197  			"                         │       │   ├─ it2.id:17!null\n" +
  3198  			"                         │       │   └─ mi.info_type_id:16!null\n" +
  3199  			"                         │       ├─ TableAlias(mi)\n" +
  3200  			"                         │       │   └─ ProcessTable\n" +
  3201  			"                         │       │       └─ Table\n" +
  3202  			"                         │       │           ├─ name: movie_info\n" +
  3203  			"                         │       │           └─ columns: [movie_id info_type_id]\n" +
  3204  			"                         │       └─ Filter\n" +
  3205  			"                         │           ├─ Eq\n" +
  3206  			"                         │           │   ├─ it2.info:1!null\n" +
  3207  			"                         │           │   └─ release dates (longtext)\n" +
  3208  			"                         │           └─ TableAlias(it2)\n" +
  3209  			"                         │               └─ Table\n" +
  3210  			"                         │                   ├─ name: info_type\n" +
  3211  			"                         │                   ├─ columns: [id info]\n" +
  3212  			"                         │                   ├─ colSet: (12,13)\n" +
  3213  			"                         │                   └─ tableId: 4\n" +
  3214  			"                         └─ TableAlias(miidx)\n" +
  3215  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3216  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3217  			"                                 ├─ keys: [mi.movie_id:15!null]\n" +
  3218  			"                                 ├─ colSet: (26-30)\n" +
  3219  			"                                 ├─ tableId: 8\n" +
  3220  			"                                 └─ Table\n" +
  3221  			"                                     ├─ name: movie_info_idx\n" +
  3222  			"                                     └─ columns: [movie_id info_type_id info]\n" +
  3223  			"",
  3224  		ExpectedEstimates: "Project\n" +
  3225  			" ├─ columns: [min(cn.name) as producing_company, min(miidx.info) as rating, min(t.title) as movie_about_winning]\n" +
  3226  			" └─ GroupBy\n" +
  3227  			"     ├─ SelectedExprs(MIN(cn.name), MIN(miidx.info), MIN(t.title))\n" +
  3228  			"     ├─ Grouping()\n" +
  3229  			"     └─ HashJoin\n" +
  3230  			"         ├─ (it.id = miidx.info_type_id)\n" +
  3231  			"         ├─ Filter\n" +
  3232  			"         │   ├─ (it.info = 'rating')\n" +
  3233  			"         │   └─ TableAlias(it)\n" +
  3234  			"         │       └─ Table\n" +
  3235  			"         │           ├─ name: info_type\n" +
  3236  			"         │           └─ columns: [id info]\n" +
  3237  			"         └─ HashLookup\n" +
  3238  			"             ├─ left-key: (it.id)\n" +
  3239  			"             ├─ right-key: (miidx.info_type_id)\n" +
  3240  			"             └─ HashJoin\n" +
  3241  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  3242  			"                 ├─ InnerJoin\n" +
  3243  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  3244  			"                 │   ├─ InnerJoin\n" +
  3245  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  3246  			"                 │   │   ├─ TableAlias(mc)\n" +
  3247  			"                 │   │   │   └─ Table\n" +
  3248  			"                 │   │   │       ├─ name: movie_companies\n" +
  3249  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  3250  			"                 │   │   └─ Filter\n" +
  3251  			"                 │   │       ├─ (cn.country_code = '[us]')\n" +
  3252  			"                 │   │       └─ TableAlias(cn)\n" +
  3253  			"                 │   │           └─ Table\n" +
  3254  			"                 │   │               ├─ name: company_name\n" +
  3255  			"                 │   │               └─ columns: [id name country_code]\n" +
  3256  			"                 │   └─ Filter\n" +
  3257  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  3258  			"                 │       └─ TableAlias(ct)\n" +
  3259  			"                 │           └─ Table\n" +
  3260  			"                 │               ├─ name: company_type\n" +
  3261  			"                 │               └─ columns: [id kind]\n" +
  3262  			"                 └─ HashLookup\n" +
  3263  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  3264  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  3265  			"                     └─ LookupJoin\n" +
  3266  			"                         ├─ (miidx.movie_id = t.id)\n" +
  3267  			"                         ├─ InnerJoin\n" +
  3268  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  3269  			"                         │   ├─ InnerJoin\n" +
  3270  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  3271  			"                         │   │   ├─ Filter\n" +
  3272  			"                         │   │   │   ├─ ((NOT((t.title = ''))) AND (t.title LIKE '%Champion%' OR t.title LIKE '%Loser%'))\n" +
  3273  			"                         │   │   │   └─ TableAlias(t)\n" +
  3274  			"                         │   │   │       └─ Table\n" +
  3275  			"                         │   │   │           ├─ name: title\n" +
  3276  			"                         │   │   │           └─ columns: [id title kind_id]\n" +
  3277  			"                         │   │   └─ Filter\n" +
  3278  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  3279  			"                         │   │       └─ TableAlias(kt)\n" +
  3280  			"                         │   │           └─ Table\n" +
  3281  			"                         │   │               ├─ name: kind_type\n" +
  3282  			"                         │   │               └─ columns: [id kind]\n" +
  3283  			"                         │   └─ InnerJoin\n" +
  3284  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  3285  			"                         │       ├─ TableAlias(mi)\n" +
  3286  			"                         │       │   └─ Table\n" +
  3287  			"                         │       │       ├─ name: movie_info\n" +
  3288  			"                         │       │       └─ columns: [movie_id info_type_id]\n" +
  3289  			"                         │       └─ Filter\n" +
  3290  			"                         │           ├─ (it2.info = 'release dates')\n" +
  3291  			"                         │           └─ TableAlias(it2)\n" +
  3292  			"                         │               └─ Table\n" +
  3293  			"                         │                   ├─ name: info_type\n" +
  3294  			"                         │                   └─ columns: [id info]\n" +
  3295  			"                         └─ TableAlias(miidx)\n" +
  3296  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3297  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3298  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  3299  			"                                 └─ keys: mi.movie_id\n" +
  3300  			"",
  3301  		ExpectedAnalysis: "Project\n" +
  3302  			" ├─ columns: [min(cn.name) as producing_company, min(miidx.info) as rating, min(t.title) as movie_about_winning]\n" +
  3303  			" └─ GroupBy\n" +
  3304  			"     ├─ SelectedExprs(MIN(cn.name), MIN(miidx.info), MIN(t.title))\n" +
  3305  			"     ├─ Grouping()\n" +
  3306  			"     └─ HashJoin\n" +
  3307  			"         ├─ (it.id = miidx.info_type_id)\n" +
  3308  			"         ├─ Filter\n" +
  3309  			"         │   ├─ (it.info = 'rating')\n" +
  3310  			"         │   └─ TableAlias(it)\n" +
  3311  			"         │       └─ Table\n" +
  3312  			"         │           ├─ name: info_type\n" +
  3313  			"         │           └─ columns: [id info]\n" +
  3314  			"         └─ HashLookup\n" +
  3315  			"             ├─ left-key: (it.id)\n" +
  3316  			"             ├─ right-key: (miidx.info_type_id)\n" +
  3317  			"             └─ HashJoin\n" +
  3318  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  3319  			"                 ├─ InnerJoin\n" +
  3320  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  3321  			"                 │   ├─ InnerJoin\n" +
  3322  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  3323  			"                 │   │   ├─ TableAlias(mc)\n" +
  3324  			"                 │   │   │   └─ Table\n" +
  3325  			"                 │   │   │       ├─ name: movie_companies\n" +
  3326  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  3327  			"                 │   │   └─ Filter\n" +
  3328  			"                 │   │       ├─ (cn.country_code = '[us]')\n" +
  3329  			"                 │   │       └─ TableAlias(cn)\n" +
  3330  			"                 │   │           └─ Table\n" +
  3331  			"                 │   │               ├─ name: company_name\n" +
  3332  			"                 │   │               └─ columns: [id name country_code]\n" +
  3333  			"                 │   └─ Filter\n" +
  3334  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  3335  			"                 │       └─ TableAlias(ct)\n" +
  3336  			"                 │           └─ Table\n" +
  3337  			"                 │               ├─ name: company_type\n" +
  3338  			"                 │               └─ columns: [id kind]\n" +
  3339  			"                 └─ HashLookup\n" +
  3340  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  3341  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  3342  			"                     └─ LookupJoin\n" +
  3343  			"                         ├─ (miidx.movie_id = t.id)\n" +
  3344  			"                         ├─ InnerJoin\n" +
  3345  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  3346  			"                         │   ├─ InnerJoin\n" +
  3347  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  3348  			"                         │   │   ├─ Filter\n" +
  3349  			"                         │   │   │   ├─ ((NOT((t.title = ''))) AND (t.title LIKE '%Champion%' OR t.title LIKE '%Loser%'))\n" +
  3350  			"                         │   │   │   └─ TableAlias(t)\n" +
  3351  			"                         │   │   │       └─ Table\n" +
  3352  			"                         │   │   │           ├─ name: title\n" +
  3353  			"                         │   │   │           └─ columns: [id title kind_id]\n" +
  3354  			"                         │   │   └─ Filter\n" +
  3355  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  3356  			"                         │   │       └─ TableAlias(kt)\n" +
  3357  			"                         │   │           └─ Table\n" +
  3358  			"                         │   │               ├─ name: kind_type\n" +
  3359  			"                         │   │               └─ columns: [id kind]\n" +
  3360  			"                         │   └─ InnerJoin\n" +
  3361  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  3362  			"                         │       ├─ TableAlias(mi)\n" +
  3363  			"                         │       │   └─ Table\n" +
  3364  			"                         │       │       ├─ name: movie_info\n" +
  3365  			"                         │       │       └─ columns: [movie_id info_type_id]\n" +
  3366  			"                         │       └─ Filter\n" +
  3367  			"                         │           ├─ (it2.info = 'release dates')\n" +
  3368  			"                         │           └─ TableAlias(it2)\n" +
  3369  			"                         │               └─ Table\n" +
  3370  			"                         │                   ├─ name: info_type\n" +
  3371  			"                         │                   └─ columns: [id info]\n" +
  3372  			"                         └─ TableAlias(miidx)\n" +
  3373  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3374  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3375  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  3376  			"                                 └─ keys: mi.movie_id\n" +
  3377  			"",
  3378  	},
  3379  	{
  3380  		Query: `
  3381  SELECT MIN(cn.name) AS producing_company,
  3382         MIN(miidx.info) AS rating,
  3383         MIN(t.title) AS movie_about_winning
  3384  FROM company_name AS cn,
  3385       company_type AS ct,
  3386       info_type AS it,
  3387       info_type AS it2,
  3388       kind_type AS kt,
  3389       movie_companies AS mc,
  3390       movie_info AS mi,
  3391       movie_info_idx AS miidx,
  3392       title AS t
  3393  WHERE cn.country_code ='[us]'
  3394    AND ct.kind ='production companies'
  3395    AND it.info ='rating'
  3396    AND it2.info ='release dates'
  3397    AND kt.kind ='movie'
  3398    AND t.title != ''
  3399    AND (t.title LIKE 'Champion%'
  3400         OR t.title LIKE 'Loser%')
  3401    AND mi.movie_id = t.id
  3402    AND it2.id = mi.info_type_id
  3403    AND kt.id = t.kind_id
  3404    AND mc.movie_id = t.id
  3405    AND cn.id = mc.company_id
  3406    AND ct.id = mc.company_type_id
  3407    AND miidx.movie_id = t.id
  3408    AND it.id = miidx.info_type_id
  3409    AND mi.movie_id = miidx.movie_id
  3410    AND mi.movie_id = mc.movie_id
  3411    AND miidx.movie_id = mc.movie_id;
  3412  
  3413  `,
  3414  		ExpectedPlan: "Project\n" +
  3415  			" ├─ columns: [min(cn.name):0!null as producing_company, min(miidx.info):1!null as rating, min(t.title):2!null as movie_about_winning]\n" +
  3416  			" └─ GroupBy\n" +
  3417  			"     ├─ select: MIN(cn.name:6!null), MIN(miidx.info:21!null), MIN(t.title:11!null)\n" +
  3418  			"     ├─ group: \n" +
  3419  			"     └─ HashJoin\n" +
  3420  			"         ├─ Eq\n" +
  3421  			"         │   ├─ it.id:0!null\n" +
  3422  			"         │   └─ miidx.info_type_id:20!null\n" +
  3423  			"         ├─ Filter\n" +
  3424  			"         │   ├─ Eq\n" +
  3425  			"         │   │   ├─ it.info:1!null\n" +
  3426  			"         │   │   └─ rating (longtext)\n" +
  3427  			"         │   └─ TableAlias(it)\n" +
  3428  			"         │       └─ ProcessTable\n" +
  3429  			"         │           └─ Table\n" +
  3430  			"         │               ├─ name: info_type\n" +
  3431  			"         │               └─ columns: [id info]\n" +
  3432  			"         └─ HashLookup\n" +
  3433  			"             ├─ left-key: TUPLE(it.id:0!null)\n" +
  3434  			"             ├─ right-key: TUPLE(miidx.info_type_id:18!null)\n" +
  3435  			"             └─ HashJoin\n" +
  3436  			"                 ├─ AND\n" +
  3437  			"                 │   ├─ Eq\n" +
  3438  			"                 │   │   ├─ mi.movie_id:15!null\n" +
  3439  			"                 │   │   └─ mc.movie_id:2!null\n" +
  3440  			"                 │   └─ Eq\n" +
  3441  			"                 │       ├─ miidx.movie_id:19!null\n" +
  3442  			"                 │       └─ mc.movie_id:2!null\n" +
  3443  			"                 ├─ InnerJoin\n" +
  3444  			"                 │   ├─ Eq\n" +
  3445  			"                 │   │   ├─ ct.id:8!null\n" +
  3446  			"                 │   │   └─ mc.company_type_id:4!null\n" +
  3447  			"                 │   ├─ InnerJoin\n" +
  3448  			"                 │   │   ├─ Eq\n" +
  3449  			"                 │   │   │   ├─ cn.id:5!null\n" +
  3450  			"                 │   │   │   └─ mc.company_id:3!null\n" +
  3451  			"                 │   │   ├─ TableAlias(mc)\n" +
  3452  			"                 │   │   │   └─ ProcessTable\n" +
  3453  			"                 │   │   │       └─ Table\n" +
  3454  			"                 │   │   │           ├─ name: movie_companies\n" +
  3455  			"                 │   │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  3456  			"                 │   │   └─ Filter\n" +
  3457  			"                 │   │       ├─ Eq\n" +
  3458  			"                 │   │       │   ├─ cn.country_code:2\n" +
  3459  			"                 │   │       │   └─ [us] (longtext)\n" +
  3460  			"                 │   │       └─ TableAlias(cn)\n" +
  3461  			"                 │   │           └─ ProcessTable\n" +
  3462  			"                 │   │               └─ Table\n" +
  3463  			"                 │   │                   ├─ name: company_name\n" +
  3464  			"                 │   │                   └─ columns: [id name country_code]\n" +
  3465  			"                 │   └─ Filter\n" +
  3466  			"                 │       ├─ Eq\n" +
  3467  			"                 │       │   ├─ ct.kind:1!null\n" +
  3468  			"                 │       │   └─ production companies (longtext)\n" +
  3469  			"                 │       └─ TableAlias(ct)\n" +
  3470  			"                 │           └─ ProcessTable\n" +
  3471  			"                 │               └─ Table\n" +
  3472  			"                 │                   ├─ name: company_type\n" +
  3473  			"                 │                   └─ columns: [id kind]\n" +
  3474  			"                 └─ HashLookup\n" +
  3475  			"                     ├─ left-key: TUPLE(mc.movie_id:2!null, mc.movie_id:2!null)\n" +
  3476  			"                     ├─ right-key: TUPLE(mi.movie_id:5!null, miidx.movie_id:9!null)\n" +
  3477  			"                     └─ LookupJoin\n" +
  3478  			"                         ├─ Eq\n" +
  3479  			"                         │   ├─ miidx.movie_id:19!null\n" +
  3480  			"                         │   └─ t.id:10!null\n" +
  3481  			"                         ├─ InnerJoin\n" +
  3482  			"                         │   ├─ Eq\n" +
  3483  			"                         │   │   ├─ mi.movie_id:15!null\n" +
  3484  			"                         │   │   └─ t.id:10!null\n" +
  3485  			"                         │   ├─ InnerJoin\n" +
  3486  			"                         │   │   ├─ Eq\n" +
  3487  			"                         │   │   │   ├─ kt.id:13!null\n" +
  3488  			"                         │   │   │   └─ t.kind_id:12!null\n" +
  3489  			"                         │   │   ├─ Filter\n" +
  3490  			"                         │   │   │   ├─ AND\n" +
  3491  			"                         │   │   │   │   ├─ NOT\n" +
  3492  			"                         │   │   │   │   │   └─ Eq\n" +
  3493  			"                         │   │   │   │   │       ├─ t.title:1!null\n" +
  3494  			"                         │   │   │   │   │       └─  (longtext)\n" +
  3495  			"                         │   │   │   │   └─ Or\n" +
  3496  			"                         │   │   │   │       ├─ AND\n" +
  3497  			"                         │   │   │   │       │   ├─ GreaterThanOrEqual\n" +
  3498  			"                         │   │   │   │       │   │   ├─ t.title:1!null\n" +
  3499  			"                         │   │   │   │       │   │   └─ Champion (longtext)\n" +
  3500  			"                         │   │   │   │       │   └─ LessThanOrEqual\n" +
  3501  			"                         │   │   │   │       │       ├─ t.title:1!null\n" +
  3502  			"                         │   │   │   │       │       └─ Championÿ (longtext)\n" +
  3503  			"                         │   │   │   │       └─ AND\n" +
  3504  			"                         │   │   │   │           ├─ GreaterThanOrEqual\n" +
  3505  			"                         │   │   │   │           │   ├─ t.title:1!null\n" +
  3506  			"                         │   │   │   │           │   └─ Loser (longtext)\n" +
  3507  			"                         │   │   │   │           └─ LessThanOrEqual\n" +
  3508  			"                         │   │   │   │               ├─ t.title:1!null\n" +
  3509  			"                         │   │   │   │               └─ Loserÿ (longtext)\n" +
  3510  			"                         │   │   │   └─ TableAlias(t)\n" +
  3511  			"                         │   │   │       └─ ProcessTable\n" +
  3512  			"                         │   │   │           └─ Table\n" +
  3513  			"                         │   │   │               ├─ name: title\n" +
  3514  			"                         │   │   │               └─ columns: [id title kind_id]\n" +
  3515  			"                         │   │   └─ Filter\n" +
  3516  			"                         │   │       ├─ Eq\n" +
  3517  			"                         │   │       │   ├─ kt.kind:1!null\n" +
  3518  			"                         │   │       │   └─ movie (longtext)\n" +
  3519  			"                         │   │       └─ TableAlias(kt)\n" +
  3520  			"                         │   │           └─ ProcessTable\n" +
  3521  			"                         │   │               └─ Table\n" +
  3522  			"                         │   │                   ├─ name: kind_type\n" +
  3523  			"                         │   │                   └─ columns: [id kind]\n" +
  3524  			"                         │   └─ InnerJoin\n" +
  3525  			"                         │       ├─ Eq\n" +
  3526  			"                         │       │   ├─ it2.id:17!null\n" +
  3527  			"                         │       │   └─ mi.info_type_id:16!null\n" +
  3528  			"                         │       ├─ TableAlias(mi)\n" +
  3529  			"                         │       │   └─ ProcessTable\n" +
  3530  			"                         │       │       └─ Table\n" +
  3531  			"                         │       │           ├─ name: movie_info\n" +
  3532  			"                         │       │           └─ columns: [movie_id info_type_id]\n" +
  3533  			"                         │       └─ Filter\n" +
  3534  			"                         │           ├─ Eq\n" +
  3535  			"                         │           │   ├─ it2.info:1!null\n" +
  3536  			"                         │           │   └─ release dates (longtext)\n" +
  3537  			"                         │           └─ TableAlias(it2)\n" +
  3538  			"                         │               └─ Table\n" +
  3539  			"                         │                   ├─ name: info_type\n" +
  3540  			"                         │                   ├─ columns: [id info]\n" +
  3541  			"                         │                   ├─ colSet: (12,13)\n" +
  3542  			"                         │                   └─ tableId: 4\n" +
  3543  			"                         └─ TableAlias(miidx)\n" +
  3544  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3545  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3546  			"                                 ├─ keys: [mi.movie_id:15!null]\n" +
  3547  			"                                 ├─ colSet: (26-30)\n" +
  3548  			"                                 ├─ tableId: 8\n" +
  3549  			"                                 └─ Table\n" +
  3550  			"                                     ├─ name: movie_info_idx\n" +
  3551  			"                                     └─ columns: [movie_id info_type_id info]\n" +
  3552  			"",
  3553  		ExpectedEstimates: "Project\n" +
  3554  			" ├─ columns: [min(cn.name) as producing_company, min(miidx.info) as rating, min(t.title) as movie_about_winning]\n" +
  3555  			" └─ GroupBy\n" +
  3556  			"     ├─ SelectedExprs(MIN(cn.name), MIN(miidx.info), MIN(t.title))\n" +
  3557  			"     ├─ Grouping()\n" +
  3558  			"     └─ HashJoin\n" +
  3559  			"         ├─ (it.id = miidx.info_type_id)\n" +
  3560  			"         ├─ Filter\n" +
  3561  			"         │   ├─ (it.info = 'rating')\n" +
  3562  			"         │   └─ TableAlias(it)\n" +
  3563  			"         │       └─ Table\n" +
  3564  			"         │           ├─ name: info_type\n" +
  3565  			"         │           └─ columns: [id info]\n" +
  3566  			"         └─ HashLookup\n" +
  3567  			"             ├─ left-key: (it.id)\n" +
  3568  			"             ├─ right-key: (miidx.info_type_id)\n" +
  3569  			"             └─ HashJoin\n" +
  3570  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  3571  			"                 ├─ InnerJoin\n" +
  3572  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  3573  			"                 │   ├─ InnerJoin\n" +
  3574  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  3575  			"                 │   │   ├─ TableAlias(mc)\n" +
  3576  			"                 │   │   │   └─ Table\n" +
  3577  			"                 │   │   │       ├─ name: movie_companies\n" +
  3578  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  3579  			"                 │   │   └─ Filter\n" +
  3580  			"                 │   │       ├─ (cn.country_code = '[us]')\n" +
  3581  			"                 │   │       └─ TableAlias(cn)\n" +
  3582  			"                 │   │           └─ Table\n" +
  3583  			"                 │   │               ├─ name: company_name\n" +
  3584  			"                 │   │               └─ columns: [id name country_code]\n" +
  3585  			"                 │   └─ Filter\n" +
  3586  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  3587  			"                 │       └─ TableAlias(ct)\n" +
  3588  			"                 │           └─ Table\n" +
  3589  			"                 │               ├─ name: company_type\n" +
  3590  			"                 │               └─ columns: [id kind]\n" +
  3591  			"                 └─ HashLookup\n" +
  3592  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  3593  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  3594  			"                     └─ LookupJoin\n" +
  3595  			"                         ├─ (miidx.movie_id = t.id)\n" +
  3596  			"                         ├─ InnerJoin\n" +
  3597  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  3598  			"                         │   ├─ InnerJoin\n" +
  3599  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  3600  			"                         │   │   ├─ Filter\n" +
  3601  			"                         │   │   │   ├─ ((NOT((t.title = ''))) AND (((t.title >= 'Champion') AND (t.title <= 'Championÿ')) OR ((t.title >= 'Loser') AND (t.title <= 'Loserÿ'))))\n" +
  3602  			"                         │   │   │   └─ TableAlias(t)\n" +
  3603  			"                         │   │   │       └─ Table\n" +
  3604  			"                         │   │   │           ├─ name: title\n" +
  3605  			"                         │   │   │           └─ columns: [id title kind_id]\n" +
  3606  			"                         │   │   └─ Filter\n" +
  3607  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  3608  			"                         │   │       └─ TableAlias(kt)\n" +
  3609  			"                         │   │           └─ Table\n" +
  3610  			"                         │   │               ├─ name: kind_type\n" +
  3611  			"                         │   │               └─ columns: [id kind]\n" +
  3612  			"                         │   └─ InnerJoin\n" +
  3613  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  3614  			"                         │       ├─ TableAlias(mi)\n" +
  3615  			"                         │       │   └─ Table\n" +
  3616  			"                         │       │       ├─ name: movie_info\n" +
  3617  			"                         │       │       └─ columns: [movie_id info_type_id]\n" +
  3618  			"                         │       └─ Filter\n" +
  3619  			"                         │           ├─ (it2.info = 'release dates')\n" +
  3620  			"                         │           └─ TableAlias(it2)\n" +
  3621  			"                         │               └─ Table\n" +
  3622  			"                         │                   ├─ name: info_type\n" +
  3623  			"                         │                   └─ columns: [id info]\n" +
  3624  			"                         └─ TableAlias(miidx)\n" +
  3625  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3626  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3627  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  3628  			"                                 └─ keys: mi.movie_id\n" +
  3629  			"",
  3630  		ExpectedAnalysis: "Project\n" +
  3631  			" ├─ columns: [min(cn.name) as producing_company, min(miidx.info) as rating, min(t.title) as movie_about_winning]\n" +
  3632  			" └─ GroupBy\n" +
  3633  			"     ├─ SelectedExprs(MIN(cn.name), MIN(miidx.info), MIN(t.title))\n" +
  3634  			"     ├─ Grouping()\n" +
  3635  			"     └─ HashJoin\n" +
  3636  			"         ├─ (it.id = miidx.info_type_id)\n" +
  3637  			"         ├─ Filter\n" +
  3638  			"         │   ├─ (it.info = 'rating')\n" +
  3639  			"         │   └─ TableAlias(it)\n" +
  3640  			"         │       └─ Table\n" +
  3641  			"         │           ├─ name: info_type\n" +
  3642  			"         │           └─ columns: [id info]\n" +
  3643  			"         └─ HashLookup\n" +
  3644  			"             ├─ left-key: (it.id)\n" +
  3645  			"             ├─ right-key: (miidx.info_type_id)\n" +
  3646  			"             └─ HashJoin\n" +
  3647  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  3648  			"                 ├─ InnerJoin\n" +
  3649  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  3650  			"                 │   ├─ InnerJoin\n" +
  3651  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  3652  			"                 │   │   ├─ TableAlias(mc)\n" +
  3653  			"                 │   │   │   └─ Table\n" +
  3654  			"                 │   │   │       ├─ name: movie_companies\n" +
  3655  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  3656  			"                 │   │   └─ Filter\n" +
  3657  			"                 │   │       ├─ (cn.country_code = '[us]')\n" +
  3658  			"                 │   │       └─ TableAlias(cn)\n" +
  3659  			"                 │   │           └─ Table\n" +
  3660  			"                 │   │               ├─ name: company_name\n" +
  3661  			"                 │   │               └─ columns: [id name country_code]\n" +
  3662  			"                 │   └─ Filter\n" +
  3663  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  3664  			"                 │       └─ TableAlias(ct)\n" +
  3665  			"                 │           └─ Table\n" +
  3666  			"                 │               ├─ name: company_type\n" +
  3667  			"                 │               └─ columns: [id kind]\n" +
  3668  			"                 └─ HashLookup\n" +
  3669  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  3670  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  3671  			"                     └─ LookupJoin\n" +
  3672  			"                         ├─ (miidx.movie_id = t.id)\n" +
  3673  			"                         ├─ InnerJoin\n" +
  3674  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  3675  			"                         │   ├─ InnerJoin\n" +
  3676  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  3677  			"                         │   │   ├─ Filter\n" +
  3678  			"                         │   │   │   ├─ ((NOT((t.title = ''))) AND (((t.title >= 'Champion') AND (t.title <= 'Championÿ')) OR ((t.title >= 'Loser') AND (t.title <= 'Loserÿ'))))\n" +
  3679  			"                         │   │   │   └─ TableAlias(t)\n" +
  3680  			"                         │   │   │       └─ Table\n" +
  3681  			"                         │   │   │           ├─ name: title\n" +
  3682  			"                         │   │   │           └─ columns: [id title kind_id]\n" +
  3683  			"                         │   │   └─ Filter\n" +
  3684  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  3685  			"                         │   │       └─ TableAlias(kt)\n" +
  3686  			"                         │   │           └─ Table\n" +
  3687  			"                         │   │               ├─ name: kind_type\n" +
  3688  			"                         │   │               └─ columns: [id kind]\n" +
  3689  			"                         │   └─ InnerJoin\n" +
  3690  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  3691  			"                         │       ├─ TableAlias(mi)\n" +
  3692  			"                         │       │   └─ Table\n" +
  3693  			"                         │       │       ├─ name: movie_info\n" +
  3694  			"                         │       │       └─ columns: [movie_id info_type_id]\n" +
  3695  			"                         │       └─ Filter\n" +
  3696  			"                         │           ├─ (it2.info = 'release dates')\n" +
  3697  			"                         │           └─ TableAlias(it2)\n" +
  3698  			"                         │               └─ Table\n" +
  3699  			"                         │                   ├─ name: info_type\n" +
  3700  			"                         │                   └─ columns: [id info]\n" +
  3701  			"                         └─ TableAlias(miidx)\n" +
  3702  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3703  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3704  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  3705  			"                                 └─ keys: mi.movie_id\n" +
  3706  			"",
  3707  	},
  3708  	{
  3709  		Query: `
  3710  SELECT MIN(cn.name) AS producing_company,
  3711         MIN(miidx.info) AS rating,
  3712         MIN(t.title) AS movie
  3713  FROM company_name AS cn,
  3714       company_type AS ct,
  3715       info_type AS it,
  3716       info_type AS it2,
  3717       kind_type AS kt,
  3718       movie_companies AS mc,
  3719       movie_info AS mi,
  3720       movie_info_idx AS miidx,
  3721       title AS t
  3722  WHERE cn.country_code ='[us]'
  3723    AND ct.kind ='production companies'
  3724    AND it.info ='rating'
  3725    AND it2.info ='release dates'
  3726    AND kt.kind ='movie'
  3727    AND mi.movie_id = t.id
  3728    AND it2.id = mi.info_type_id
  3729    AND kt.id = t.kind_id
  3730    AND mc.movie_id = t.id
  3731    AND cn.id = mc.company_id
  3732    AND ct.id = mc.company_type_id
  3733    AND miidx.movie_id = t.id
  3734    AND it.id = miidx.info_type_id
  3735    AND mi.movie_id = miidx.movie_id
  3736    AND mi.movie_id = mc.movie_id
  3737    AND miidx.movie_id = mc.movie_id;
  3738  
  3739  `,
  3740  		ExpectedPlan: "Project\n" +
  3741  			" ├─ columns: [min(cn.name):0!null as producing_company, min(miidx.info):1!null as rating, min(t.title):2!null as movie]\n" +
  3742  			" └─ GroupBy\n" +
  3743  			"     ├─ select: MIN(cn.name:6!null), MIN(miidx.info:21!null), MIN(t.title:11!null)\n" +
  3744  			"     ├─ group: \n" +
  3745  			"     └─ HashJoin\n" +
  3746  			"         ├─ Eq\n" +
  3747  			"         │   ├─ it.id:0!null\n" +
  3748  			"         │   └─ miidx.info_type_id:20!null\n" +
  3749  			"         ├─ Filter\n" +
  3750  			"         │   ├─ Eq\n" +
  3751  			"         │   │   ├─ it.info:1!null\n" +
  3752  			"         │   │   └─ rating (longtext)\n" +
  3753  			"         │   └─ TableAlias(it)\n" +
  3754  			"         │       └─ ProcessTable\n" +
  3755  			"         │           └─ Table\n" +
  3756  			"         │               ├─ name: info_type\n" +
  3757  			"         │               └─ columns: [id info]\n" +
  3758  			"         └─ HashLookup\n" +
  3759  			"             ├─ left-key: TUPLE(it.id:0!null)\n" +
  3760  			"             ├─ right-key: TUPLE(miidx.info_type_id:18!null)\n" +
  3761  			"             └─ HashJoin\n" +
  3762  			"                 ├─ AND\n" +
  3763  			"                 │   ├─ Eq\n" +
  3764  			"                 │   │   ├─ mi.movie_id:15!null\n" +
  3765  			"                 │   │   └─ mc.movie_id:2!null\n" +
  3766  			"                 │   └─ Eq\n" +
  3767  			"                 │       ├─ miidx.movie_id:19!null\n" +
  3768  			"                 │       └─ mc.movie_id:2!null\n" +
  3769  			"                 ├─ InnerJoin\n" +
  3770  			"                 │   ├─ Eq\n" +
  3771  			"                 │   │   ├─ ct.id:8!null\n" +
  3772  			"                 │   │   └─ mc.company_type_id:4!null\n" +
  3773  			"                 │   ├─ InnerJoin\n" +
  3774  			"                 │   │   ├─ Eq\n" +
  3775  			"                 │   │   │   ├─ cn.id:5!null\n" +
  3776  			"                 │   │   │   └─ mc.company_id:3!null\n" +
  3777  			"                 │   │   ├─ TableAlias(mc)\n" +
  3778  			"                 │   │   │   └─ ProcessTable\n" +
  3779  			"                 │   │   │       └─ Table\n" +
  3780  			"                 │   │   │           ├─ name: movie_companies\n" +
  3781  			"                 │   │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  3782  			"                 │   │   └─ Filter\n" +
  3783  			"                 │   │       ├─ Eq\n" +
  3784  			"                 │   │       │   ├─ cn.country_code:2\n" +
  3785  			"                 │   │       │   └─ [us] (longtext)\n" +
  3786  			"                 │   │       └─ TableAlias(cn)\n" +
  3787  			"                 │   │           └─ ProcessTable\n" +
  3788  			"                 │   │               └─ Table\n" +
  3789  			"                 │   │                   ├─ name: company_name\n" +
  3790  			"                 │   │                   └─ columns: [id name country_code]\n" +
  3791  			"                 │   └─ Filter\n" +
  3792  			"                 │       ├─ Eq\n" +
  3793  			"                 │       │   ├─ ct.kind:1!null\n" +
  3794  			"                 │       │   └─ production companies (longtext)\n" +
  3795  			"                 │       └─ TableAlias(ct)\n" +
  3796  			"                 │           └─ ProcessTable\n" +
  3797  			"                 │               └─ Table\n" +
  3798  			"                 │                   ├─ name: company_type\n" +
  3799  			"                 │                   └─ columns: [id kind]\n" +
  3800  			"                 └─ HashLookup\n" +
  3801  			"                     ├─ left-key: TUPLE(mc.movie_id:2!null, mc.movie_id:2!null)\n" +
  3802  			"                     ├─ right-key: TUPLE(mi.movie_id:5!null, miidx.movie_id:9!null)\n" +
  3803  			"                     └─ LookupJoin\n" +
  3804  			"                         ├─ Eq\n" +
  3805  			"                         │   ├─ miidx.movie_id:19!null\n" +
  3806  			"                         │   └─ t.id:10!null\n" +
  3807  			"                         ├─ InnerJoin\n" +
  3808  			"                         │   ├─ Eq\n" +
  3809  			"                         │   │   ├─ mi.movie_id:15!null\n" +
  3810  			"                         │   │   └─ t.id:10!null\n" +
  3811  			"                         │   ├─ InnerJoin\n" +
  3812  			"                         │   │   ├─ Eq\n" +
  3813  			"                         │   │   │   ├─ kt.id:13!null\n" +
  3814  			"                         │   │   │   └─ t.kind_id:12!null\n" +
  3815  			"                         │   │   ├─ TableAlias(t)\n" +
  3816  			"                         │   │   │   └─ ProcessTable\n" +
  3817  			"                         │   │   │       └─ Table\n" +
  3818  			"                         │   │   │           ├─ name: title\n" +
  3819  			"                         │   │   │           └─ columns: [id title kind_id]\n" +
  3820  			"                         │   │   └─ Filter\n" +
  3821  			"                         │   │       ├─ Eq\n" +
  3822  			"                         │   │       │   ├─ kt.kind:1!null\n" +
  3823  			"                         │   │       │   └─ movie (longtext)\n" +
  3824  			"                         │   │       └─ TableAlias(kt)\n" +
  3825  			"                         │   │           └─ ProcessTable\n" +
  3826  			"                         │   │               └─ Table\n" +
  3827  			"                         │   │                   ├─ name: kind_type\n" +
  3828  			"                         │   │                   └─ columns: [id kind]\n" +
  3829  			"                         │   └─ InnerJoin\n" +
  3830  			"                         │       ├─ Eq\n" +
  3831  			"                         │       │   ├─ it2.id:17!null\n" +
  3832  			"                         │       │   └─ mi.info_type_id:16!null\n" +
  3833  			"                         │       ├─ TableAlias(mi)\n" +
  3834  			"                         │       │   └─ ProcessTable\n" +
  3835  			"                         │       │       └─ Table\n" +
  3836  			"                         │       │           ├─ name: movie_info\n" +
  3837  			"                         │       │           └─ columns: [movie_id info_type_id]\n" +
  3838  			"                         │       └─ Filter\n" +
  3839  			"                         │           ├─ Eq\n" +
  3840  			"                         │           │   ├─ it2.info:1!null\n" +
  3841  			"                         │           │   └─ release dates (longtext)\n" +
  3842  			"                         │           └─ TableAlias(it2)\n" +
  3843  			"                         │               └─ Table\n" +
  3844  			"                         │                   ├─ name: info_type\n" +
  3845  			"                         │                   ├─ columns: [id info]\n" +
  3846  			"                         │                   ├─ colSet: (12,13)\n" +
  3847  			"                         │                   └─ tableId: 4\n" +
  3848  			"                         └─ TableAlias(miidx)\n" +
  3849  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3850  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3851  			"                                 ├─ keys: [mi.movie_id:15!null]\n" +
  3852  			"                                 ├─ colSet: (26-30)\n" +
  3853  			"                                 ├─ tableId: 8\n" +
  3854  			"                                 └─ Table\n" +
  3855  			"                                     ├─ name: movie_info_idx\n" +
  3856  			"                                     └─ columns: [movie_id info_type_id info]\n" +
  3857  			"",
  3858  		ExpectedEstimates: "Project\n" +
  3859  			" ├─ columns: [min(cn.name) as producing_company, min(miidx.info) as rating, min(t.title) as movie]\n" +
  3860  			" └─ GroupBy\n" +
  3861  			"     ├─ SelectedExprs(MIN(cn.name), MIN(miidx.info), MIN(t.title))\n" +
  3862  			"     ├─ Grouping()\n" +
  3863  			"     └─ HashJoin\n" +
  3864  			"         ├─ (it.id = miidx.info_type_id)\n" +
  3865  			"         ├─ Filter\n" +
  3866  			"         │   ├─ (it.info = 'rating')\n" +
  3867  			"         │   └─ TableAlias(it)\n" +
  3868  			"         │       └─ Table\n" +
  3869  			"         │           ├─ name: info_type\n" +
  3870  			"         │           └─ columns: [id info]\n" +
  3871  			"         └─ HashLookup\n" +
  3872  			"             ├─ left-key: (it.id)\n" +
  3873  			"             ├─ right-key: (miidx.info_type_id)\n" +
  3874  			"             └─ HashJoin\n" +
  3875  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  3876  			"                 ├─ InnerJoin\n" +
  3877  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  3878  			"                 │   ├─ InnerJoin\n" +
  3879  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  3880  			"                 │   │   ├─ TableAlias(mc)\n" +
  3881  			"                 │   │   │   └─ Table\n" +
  3882  			"                 │   │   │       ├─ name: movie_companies\n" +
  3883  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  3884  			"                 │   │   └─ Filter\n" +
  3885  			"                 │   │       ├─ (cn.country_code = '[us]')\n" +
  3886  			"                 │   │       └─ TableAlias(cn)\n" +
  3887  			"                 │   │           └─ Table\n" +
  3888  			"                 │   │               ├─ name: company_name\n" +
  3889  			"                 │   │               └─ columns: [id name country_code]\n" +
  3890  			"                 │   └─ Filter\n" +
  3891  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  3892  			"                 │       └─ TableAlias(ct)\n" +
  3893  			"                 │           └─ Table\n" +
  3894  			"                 │               ├─ name: company_type\n" +
  3895  			"                 │               └─ columns: [id kind]\n" +
  3896  			"                 └─ HashLookup\n" +
  3897  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  3898  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  3899  			"                     └─ LookupJoin\n" +
  3900  			"                         ├─ (miidx.movie_id = t.id)\n" +
  3901  			"                         ├─ InnerJoin\n" +
  3902  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  3903  			"                         │   ├─ InnerJoin\n" +
  3904  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  3905  			"                         │   │   ├─ TableAlias(t)\n" +
  3906  			"                         │   │   │   └─ Table\n" +
  3907  			"                         │   │   │       ├─ name: title\n" +
  3908  			"                         │   │   │       └─ columns: [id title kind_id]\n" +
  3909  			"                         │   │   └─ Filter\n" +
  3910  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  3911  			"                         │   │       └─ TableAlias(kt)\n" +
  3912  			"                         │   │           └─ Table\n" +
  3913  			"                         │   │               ├─ name: kind_type\n" +
  3914  			"                         │   │               └─ columns: [id kind]\n" +
  3915  			"                         │   └─ InnerJoin\n" +
  3916  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  3917  			"                         │       ├─ TableAlias(mi)\n" +
  3918  			"                         │       │   └─ Table\n" +
  3919  			"                         │       │       ├─ name: movie_info\n" +
  3920  			"                         │       │       └─ columns: [movie_id info_type_id]\n" +
  3921  			"                         │       └─ Filter\n" +
  3922  			"                         │           ├─ (it2.info = 'release dates')\n" +
  3923  			"                         │           └─ TableAlias(it2)\n" +
  3924  			"                         │               └─ Table\n" +
  3925  			"                         │                   ├─ name: info_type\n" +
  3926  			"                         │                   └─ columns: [id info]\n" +
  3927  			"                         └─ TableAlias(miidx)\n" +
  3928  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  3929  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  3930  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  3931  			"                                 └─ keys: mi.movie_id\n" +
  3932  			"",
  3933  		ExpectedAnalysis: "Project\n" +
  3934  			" ├─ columns: [min(cn.name) as producing_company, min(miidx.info) as rating, min(t.title) as movie]\n" +
  3935  			" └─ GroupBy\n" +
  3936  			"     ├─ SelectedExprs(MIN(cn.name), MIN(miidx.info), MIN(t.title))\n" +
  3937  			"     ├─ Grouping()\n" +
  3938  			"     └─ HashJoin\n" +
  3939  			"         ├─ (it.id = miidx.info_type_id)\n" +
  3940  			"         ├─ Filter\n" +
  3941  			"         │   ├─ (it.info = 'rating')\n" +
  3942  			"         │   └─ TableAlias(it)\n" +
  3943  			"         │       └─ Table\n" +
  3944  			"         │           ├─ name: info_type\n" +
  3945  			"         │           └─ columns: [id info]\n" +
  3946  			"         └─ HashLookup\n" +
  3947  			"             ├─ left-key: (it.id)\n" +
  3948  			"             ├─ right-key: (miidx.info_type_id)\n" +
  3949  			"             └─ HashJoin\n" +
  3950  			"                 ├─ ((mi.movie_id = mc.movie_id) AND (miidx.movie_id = mc.movie_id))\n" +
  3951  			"                 ├─ InnerJoin\n" +
  3952  			"                 │   ├─ (ct.id = mc.company_type_id)\n" +
  3953  			"                 │   ├─ InnerJoin\n" +
  3954  			"                 │   │   ├─ (cn.id = mc.company_id)\n" +
  3955  			"                 │   │   ├─ TableAlias(mc)\n" +
  3956  			"                 │   │   │   └─ Table\n" +
  3957  			"                 │   │   │       ├─ name: movie_companies\n" +
  3958  			"                 │   │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  3959  			"                 │   │   └─ Filter\n" +
  3960  			"                 │   │       ├─ (cn.country_code = '[us]')\n" +
  3961  			"                 │   │       └─ TableAlias(cn)\n" +
  3962  			"                 │   │           └─ Table\n" +
  3963  			"                 │   │               ├─ name: company_name\n" +
  3964  			"                 │   │               └─ columns: [id name country_code]\n" +
  3965  			"                 │   └─ Filter\n" +
  3966  			"                 │       ├─ (ct.kind = 'production companies')\n" +
  3967  			"                 │       └─ TableAlias(ct)\n" +
  3968  			"                 │           └─ Table\n" +
  3969  			"                 │               ├─ name: company_type\n" +
  3970  			"                 │               └─ columns: [id kind]\n" +
  3971  			"                 └─ HashLookup\n" +
  3972  			"                     ├─ left-key: (mc.movie_id, mc.movie_id)\n" +
  3973  			"                     ├─ right-key: (mi.movie_id, miidx.movie_id)\n" +
  3974  			"                     └─ LookupJoin\n" +
  3975  			"                         ├─ (miidx.movie_id = t.id)\n" +
  3976  			"                         ├─ InnerJoin\n" +
  3977  			"                         │   ├─ (mi.movie_id = t.id)\n" +
  3978  			"                         │   ├─ InnerJoin\n" +
  3979  			"                         │   │   ├─ (kt.id = t.kind_id)\n" +
  3980  			"                         │   │   ├─ TableAlias(t)\n" +
  3981  			"                         │   │   │   └─ Table\n" +
  3982  			"                         │   │   │       ├─ name: title\n" +
  3983  			"                         │   │   │       └─ columns: [id title kind_id]\n" +
  3984  			"                         │   │   └─ Filter\n" +
  3985  			"                         │   │       ├─ (kt.kind = 'movie')\n" +
  3986  			"                         │   │       └─ TableAlias(kt)\n" +
  3987  			"                         │   │           └─ Table\n" +
  3988  			"                         │   │               ├─ name: kind_type\n" +
  3989  			"                         │   │               └─ columns: [id kind]\n" +
  3990  			"                         │   └─ InnerJoin\n" +
  3991  			"                         │       ├─ (it2.id = mi.info_type_id)\n" +
  3992  			"                         │       ├─ TableAlias(mi)\n" +
  3993  			"                         │       │   └─ Table\n" +
  3994  			"                         │       │       ├─ name: movie_info\n" +
  3995  			"                         │       │       └─ columns: [movie_id info_type_id]\n" +
  3996  			"                         │       └─ Filter\n" +
  3997  			"                         │           ├─ (it2.info = 'release dates')\n" +
  3998  			"                         │           └─ TableAlias(it2)\n" +
  3999  			"                         │               └─ Table\n" +
  4000  			"                         │                   ├─ name: info_type\n" +
  4001  			"                         │                   └─ columns: [id info]\n" +
  4002  			"                         └─ TableAlias(miidx)\n" +
  4003  			"                             └─ IndexedTableAccess(movie_info_idx)\n" +
  4004  			"                                 ├─ index: [movie_info_idx.movie_id]\n" +
  4005  			"                                 ├─ columns: [movie_id info_type_id info]\n" +
  4006  			"                                 └─ keys: mi.movie_id\n" +
  4007  			"",
  4008  	},
  4009  	{
  4010  		Query: `
  4011  SELECT MIN(mi_idx.info) AS rating,
  4012         MIN(t.title) AS northern_dark_movie
  4013  FROM info_type AS it1,
  4014       info_type AS it2,
  4015       keyword AS k,
  4016       kind_type AS kt,
  4017       movie_info AS mi,
  4018       movie_info_idx AS mi_idx,
  4019       movie_keyword AS mk,
  4020       title AS t
  4021  WHERE it1.info = 'countries'
  4022    AND it2.info = 'rating'
  4023    AND k.keyword IN ('murder',
  4024                      'murder-in-title',
  4025                      'blood',
  4026                      'violence')
  4027    AND kt.kind = 'movie'
  4028    AND mi.info IN ('Sweden',
  4029                    'Norway',
  4030                    'Germany',
  4031                    'Denmark',
  4032                    'Swedish',
  4033                    'Denish',
  4034                    'Norwegian',
  4035                    'German',
  4036                    'USA',
  4037                    'American')
  4038    AND mi_idx.info < '8.5'
  4039    AND t.production_year > 2010
  4040    AND kt.id = t.kind_id
  4041    AND t.id = mi.movie_id
  4042    AND t.id = mk.movie_id
  4043    AND t.id = mi_idx.movie_id
  4044    AND mk.movie_id = mi.movie_id
  4045    AND mk.movie_id = mi_idx.movie_id
  4046    AND mi.movie_id = mi_idx.movie_id
  4047    AND k.id = mk.keyword_id
  4048    AND it1.id = mi.info_type_id
  4049    AND it2.id = mi_idx.info_type_id;
  4050  
  4051  `,
  4052  		ExpectedPlan: "Project\n" +
  4053  			" ├─ columns: [min(mi_idx.info):0!null as rating, min(t.title):1!null as northern_dark_movie]\n" +
  4054  			" └─ GroupBy\n" +
  4055  			"     ├─ select: MIN(mi_idx.info:12!null), MIN(t.title:1!null)\n" +
  4056  			"     ├─ group: \n" +
  4057  			"     └─ InnerJoin\n" +
  4058  			"         ├─ AND\n" +
  4059  			"         │   ├─ AND\n" +
  4060  			"         │   │   ├─ Eq\n" +
  4061  			"         │   │   │   ├─ t.id:0!null\n" +
  4062  			"         │   │   │   └─ mi.movie_id:17!null\n" +
  4063  			"         │   │   └─ Eq\n" +
  4064  			"         │   │       ├─ t.id:0!null\n" +
  4065  			"         │   │       └─ mk.movie_id:6!null\n" +
  4066  			"         │   └─ Eq\n" +
  4067  			"         │       ├─ t.id:0!null\n" +
  4068  			"         │       └─ mi_idx.movie_id:10!null\n" +
  4069  			"         ├─ InnerJoin\n" +
  4070  			"         │   ├─ Eq\n" +
  4071  			"         │   │   ├─ kt.id:4!null\n" +
  4072  			"         │   │   └─ t.kind_id:2!null\n" +
  4073  			"         │   ├─ Filter\n" +
  4074  			"         │   │   ├─ GreaterThan\n" +
  4075  			"         │   │   │   ├─ t.production_year:3\n" +
  4076  			"         │   │   │   └─ 2010 (smallint)\n" +
  4077  			"         │   │   └─ TableAlias(t)\n" +
  4078  			"         │   │       └─ ProcessTable\n" +
  4079  			"         │   │           └─ Table\n" +
  4080  			"         │   │               ├─ name: title\n" +
  4081  			"         │   │               └─ columns: [id title kind_id production_year]\n" +
  4082  			"         │   └─ Filter\n" +
  4083  			"         │       ├─ Eq\n" +
  4084  			"         │       │   ├─ kt.kind:1!null\n" +
  4085  			"         │       │   └─ movie (longtext)\n" +
  4086  			"         │       └─ TableAlias(kt)\n" +
  4087  			"         │           └─ ProcessTable\n" +
  4088  			"         │               └─ Table\n" +
  4089  			"         │                   ├─ name: kind_type\n" +
  4090  			"         │                   └─ columns: [id kind]\n" +
  4091  			"         └─ InnerJoin\n" +
  4092  			"             ├─ AND\n" +
  4093  			"             │   ├─ AND\n" +
  4094  			"             │   │   ├─ Eq\n" +
  4095  			"             │   │   │   ├─ it1.id:15!null\n" +
  4096  			"             │   │   │   └─ mi.info_type_id:18!null\n" +
  4097  			"             │   │   └─ Eq\n" +
  4098  			"             │   │       ├─ mi.movie_id:17!null\n" +
  4099  			"             │   │       └─ mi_idx.movie_id:10!null\n" +
  4100  			"             │   └─ Eq\n" +
  4101  			"             │       ├─ mk.movie_id:6!null\n" +
  4102  			"             │       └─ mi.movie_id:17!null\n" +
  4103  			"             ├─ InnerJoin\n" +
  4104  			"             │   ├─ Eq\n" +
  4105  			"             │   │   ├─ mk.movie_id:6!null\n" +
  4106  			"             │   │   └─ mi_idx.movie_id:10!null\n" +
  4107  			"             │   ├─ InnerJoin\n" +
  4108  			"             │   │   ├─ Eq\n" +
  4109  			"             │   │   │   ├─ k.id:8!null\n" +
  4110  			"             │   │   │   └─ mk.keyword_id:7!null\n" +
  4111  			"             │   │   ├─ TableAlias(mk)\n" +
  4112  			"             │   │   │   └─ ProcessTable\n" +
  4113  			"             │   │   │       └─ Table\n" +
  4114  			"             │   │   │           ├─ name: movie_keyword\n" +
  4115  			"             │   │   │           └─ columns: [movie_id keyword_id]\n" +
  4116  			"             │   │   └─ Filter\n" +
  4117  			"             │   │       ├─ HashIn\n" +
  4118  			"             │   │       │   ├─ k.keyword:1!null\n" +
  4119  			"             │   │       │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
  4120  			"             │   │       └─ TableAlias(k)\n" +
  4121  			"             │   │           └─ ProcessTable\n" +
  4122  			"             │   │               └─ Table\n" +
  4123  			"             │   │                   ├─ name: keyword\n" +
  4124  			"             │   │                   └─ columns: [id keyword]\n" +
  4125  			"             │   └─ CrossJoin\n" +
  4126  			"             │       ├─ InnerJoin\n" +
  4127  			"             │       │   ├─ Eq\n" +
  4128  			"             │       │   │   ├─ it2.id:13!null\n" +
  4129  			"             │       │   │   └─ mi_idx.info_type_id:11!null\n" +
  4130  			"             │       │   ├─ Filter\n" +
  4131  			"             │       │   │   ├─ LessThan\n" +
  4132  			"             │       │   │   │   ├─ mi_idx.info:2!null\n" +
  4133  			"             │       │   │   │   └─ 8.5 (longtext)\n" +
  4134  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4135  			"             │       │   │       └─ ProcessTable\n" +
  4136  			"             │       │   │           └─ Table\n" +
  4137  			"             │       │   │               ├─ name: movie_info_idx\n" +
  4138  			"             │       │   │               └─ columns: [movie_id info_type_id info]\n" +
  4139  			"             │       │   └─ Filter\n" +
  4140  			"             │       │       ├─ Eq\n" +
  4141  			"             │       │       │   ├─ it2.info:1!null\n" +
  4142  			"             │       │       │   └─ rating (longtext)\n" +
  4143  			"             │       │       └─ TableAlias(it2)\n" +
  4144  			"             │       │           └─ ProcessTable\n" +
  4145  			"             │       │               └─ Table\n" +
  4146  			"             │       │                   ├─ name: info_type\n" +
  4147  			"             │       │                   └─ columns: [id info]\n" +
  4148  			"             │       └─ Filter\n" +
  4149  			"             │           ├─ Eq\n" +
  4150  			"             │           │   ├─ it1.info:1!null\n" +
  4151  			"             │           │   └─ countries (longtext)\n" +
  4152  			"             │           └─ TableAlias(it1)\n" +
  4153  			"             │               └─ Table\n" +
  4154  			"             │                   ├─ name: info_type\n" +
  4155  			"             │                   ├─ columns: [id info]\n" +
  4156  			"             │                   ├─ colSet: (1,2)\n" +
  4157  			"             │                   └─ tableId: 1\n" +
  4158  			"             └─ Filter\n" +
  4159  			"                 ├─ HashIn\n" +
  4160  			"                 │   ├─ mi.info:2!null\n" +
  4161  			"                 │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
  4162  			"                 └─ TableAlias(mi)\n" +
  4163  			"                     └─ ProcessTable\n" +
  4164  			"                         └─ Table\n" +
  4165  			"                             ├─ name: movie_info\n" +
  4166  			"                             └─ columns: [movie_id info_type_id info]\n" +
  4167  			"",
  4168  		ExpectedEstimates: "Project\n" +
  4169  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as northern_dark_movie]\n" +
  4170  			" └─ GroupBy\n" +
  4171  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
  4172  			"     ├─ Grouping()\n" +
  4173  			"     └─ InnerJoin\n" +
  4174  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mk.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
  4175  			"         ├─ InnerJoin\n" +
  4176  			"         │   ├─ (kt.id = t.kind_id)\n" +
  4177  			"         │   ├─ Filter\n" +
  4178  			"         │   │   ├─ (t.production_year > 2010)\n" +
  4179  			"         │   │   └─ TableAlias(t)\n" +
  4180  			"         │   │       └─ Table\n" +
  4181  			"         │   │           ├─ name: title\n" +
  4182  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
  4183  			"         │   └─ Filter\n" +
  4184  			"         │       ├─ (kt.kind = 'movie')\n" +
  4185  			"         │       └─ TableAlias(kt)\n" +
  4186  			"         │           └─ Table\n" +
  4187  			"         │               ├─ name: kind_type\n" +
  4188  			"         │               └─ columns: [id kind]\n" +
  4189  			"         └─ InnerJoin\n" +
  4190  			"             ├─ (((it1.id = mi.info_type_id) AND (mi.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mi.movie_id))\n" +
  4191  			"             ├─ InnerJoin\n" +
  4192  			"             │   ├─ (mk.movie_id = mi_idx.movie_id)\n" +
  4193  			"             │   ├─ InnerJoin\n" +
  4194  			"             │   │   ├─ (k.id = mk.keyword_id)\n" +
  4195  			"             │   │   ├─ TableAlias(mk)\n" +
  4196  			"             │   │   │   └─ Table\n" +
  4197  			"             │   │   │       ├─ name: movie_keyword\n" +
  4198  			"             │   │   │       └─ columns: [movie_id keyword_id]\n" +
  4199  			"             │   │   └─ Filter\n" +
  4200  			"             │   │       ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
  4201  			"             │   │       └─ TableAlias(k)\n" +
  4202  			"             │   │           └─ Table\n" +
  4203  			"             │   │               ├─ name: keyword\n" +
  4204  			"             │   │               └─ columns: [id keyword]\n" +
  4205  			"             │   └─ CrossJoin\n" +
  4206  			"             │       ├─ InnerJoin\n" +
  4207  			"             │       │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  4208  			"             │       │   ├─ Filter\n" +
  4209  			"             │       │   │   ├─ (mi_idx.info < '8.5')\n" +
  4210  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4211  			"             │       │   │       └─ Table\n" +
  4212  			"             │       │   │           ├─ name: movie_info_idx\n" +
  4213  			"             │       │   │           └─ columns: [movie_id info_type_id info]\n" +
  4214  			"             │       │   └─ Filter\n" +
  4215  			"             │       │       ├─ (it2.info = 'rating')\n" +
  4216  			"             │       │       └─ TableAlias(it2)\n" +
  4217  			"             │       │           └─ Table\n" +
  4218  			"             │       │               ├─ name: info_type\n" +
  4219  			"             │       │               └─ columns: [id info]\n" +
  4220  			"             │       └─ Filter\n" +
  4221  			"             │           ├─ (it1.info = 'countries')\n" +
  4222  			"             │           └─ TableAlias(it1)\n" +
  4223  			"             │               └─ Table\n" +
  4224  			"             │                   ├─ name: info_type\n" +
  4225  			"             │                   └─ columns: [id info]\n" +
  4226  			"             └─ Filter\n" +
  4227  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
  4228  			"                 └─ TableAlias(mi)\n" +
  4229  			"                     └─ Table\n" +
  4230  			"                         ├─ name: movie_info\n" +
  4231  			"                         └─ columns: [movie_id info_type_id info]\n" +
  4232  			"",
  4233  		ExpectedAnalysis: "Project\n" +
  4234  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as northern_dark_movie]\n" +
  4235  			" └─ GroupBy\n" +
  4236  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
  4237  			"     ├─ Grouping()\n" +
  4238  			"     └─ InnerJoin\n" +
  4239  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mk.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
  4240  			"         ├─ InnerJoin\n" +
  4241  			"         │   ├─ (kt.id = t.kind_id)\n" +
  4242  			"         │   ├─ Filter\n" +
  4243  			"         │   │   ├─ (t.production_year > 2010)\n" +
  4244  			"         │   │   └─ TableAlias(t)\n" +
  4245  			"         │   │       └─ Table\n" +
  4246  			"         │   │           ├─ name: title\n" +
  4247  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
  4248  			"         │   └─ Filter\n" +
  4249  			"         │       ├─ (kt.kind = 'movie')\n" +
  4250  			"         │       └─ TableAlias(kt)\n" +
  4251  			"         │           └─ Table\n" +
  4252  			"         │               ├─ name: kind_type\n" +
  4253  			"         │               └─ columns: [id kind]\n" +
  4254  			"         └─ InnerJoin\n" +
  4255  			"             ├─ (((it1.id = mi.info_type_id) AND (mi.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mi.movie_id))\n" +
  4256  			"             ├─ InnerJoin\n" +
  4257  			"             │   ├─ (mk.movie_id = mi_idx.movie_id)\n" +
  4258  			"             │   ├─ InnerJoin\n" +
  4259  			"             │   │   ├─ (k.id = mk.keyword_id)\n" +
  4260  			"             │   │   ├─ TableAlias(mk)\n" +
  4261  			"             │   │   │   └─ Table\n" +
  4262  			"             │   │   │       ├─ name: movie_keyword\n" +
  4263  			"             │   │   │       └─ columns: [movie_id keyword_id]\n" +
  4264  			"             │   │   └─ Filter\n" +
  4265  			"             │   │       ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
  4266  			"             │   │       └─ TableAlias(k)\n" +
  4267  			"             │   │           └─ Table\n" +
  4268  			"             │   │               ├─ name: keyword\n" +
  4269  			"             │   │               └─ columns: [id keyword]\n" +
  4270  			"             │   └─ CrossJoin\n" +
  4271  			"             │       ├─ InnerJoin\n" +
  4272  			"             │       │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  4273  			"             │       │   ├─ Filter\n" +
  4274  			"             │       │   │   ├─ (mi_idx.info < '8.5')\n" +
  4275  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4276  			"             │       │   │       └─ Table\n" +
  4277  			"             │       │   │           ├─ name: movie_info_idx\n" +
  4278  			"             │       │   │           └─ columns: [movie_id info_type_id info]\n" +
  4279  			"             │       │   └─ Filter\n" +
  4280  			"             │       │       ├─ (it2.info = 'rating')\n" +
  4281  			"             │       │       └─ TableAlias(it2)\n" +
  4282  			"             │       │           └─ Table\n" +
  4283  			"             │       │               ├─ name: info_type\n" +
  4284  			"             │       │               └─ columns: [id info]\n" +
  4285  			"             │       └─ Filter\n" +
  4286  			"             │           ├─ (it1.info = 'countries')\n" +
  4287  			"             │           └─ TableAlias(it1)\n" +
  4288  			"             │               └─ Table\n" +
  4289  			"             │                   ├─ name: info_type\n" +
  4290  			"             │                   └─ columns: [id info]\n" +
  4291  			"             └─ Filter\n" +
  4292  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
  4293  			"                 └─ TableAlias(mi)\n" +
  4294  			"                     └─ Table\n" +
  4295  			"                         ├─ name: movie_info\n" +
  4296  			"                         └─ columns: [movie_id info_type_id info]\n" +
  4297  			"",
  4298  	},
  4299  	{
  4300  		Query: `
  4301  SELECT MIN(mi_idx.info) AS rating,
  4302         MIN(t.title) AS western_dark_production
  4303  FROM info_type AS it1,
  4304       info_type AS it2,
  4305       keyword AS k,
  4306       kind_type AS kt,
  4307       movie_info AS mi,
  4308       movie_info_idx AS mi_idx,
  4309       movie_keyword AS mk,
  4310       title AS t
  4311  WHERE it1.info = 'countries'
  4312    AND it2.info = 'rating'
  4313    AND k.keyword IN ('murder',
  4314                      'murder-in-title')
  4315    AND kt.kind = 'movie'
  4316    AND mi.info IN ('Sweden',
  4317                    'Norway',
  4318                    'Germany',
  4319                    'Denmark',
  4320                    'Swedish',
  4321                    'Denish',
  4322                    'Norwegian',
  4323                    'German',
  4324                    'USA',
  4325                    'American')
  4326    AND mi_idx.info > '6.0'
  4327    AND t.production_year > 2010
  4328    AND (t.title LIKE '%murder%'
  4329         OR t.title LIKE '%Murder%'
  4330         OR t.title LIKE '%Mord%')
  4331    AND kt.id = t.kind_id
  4332    AND t.id = mi.movie_id
  4333    AND t.id = mk.movie_id
  4334    AND t.id = mi_idx.movie_id
  4335    AND mk.movie_id = mi.movie_id
  4336    AND mk.movie_id = mi_idx.movie_id
  4337    AND mi.movie_id = mi_idx.movie_id
  4338    AND k.id = mk.keyword_id
  4339    AND it1.id = mi.info_type_id
  4340    AND it2.id = mi_idx.info_type_id;
  4341  
  4342  `,
  4343  		ExpectedPlan: "Project\n" +
  4344  			" ├─ columns: [min(mi_idx.info):0!null as rating, min(t.title):1!null as western_dark_production]\n" +
  4345  			" └─ GroupBy\n" +
  4346  			"     ├─ select: MIN(mi_idx.info:12!null), MIN(t.title:1!null)\n" +
  4347  			"     ├─ group: \n" +
  4348  			"     └─ InnerJoin\n" +
  4349  			"         ├─ AND\n" +
  4350  			"         │   ├─ AND\n" +
  4351  			"         │   │   ├─ Eq\n" +
  4352  			"         │   │   │   ├─ t.id:0!null\n" +
  4353  			"         │   │   │   └─ mi.movie_id:17!null\n" +
  4354  			"         │   │   └─ Eq\n" +
  4355  			"         │   │       ├─ t.id:0!null\n" +
  4356  			"         │   │       └─ mk.movie_id:6!null\n" +
  4357  			"         │   └─ Eq\n" +
  4358  			"         │       ├─ t.id:0!null\n" +
  4359  			"         │       └─ mi_idx.movie_id:10!null\n" +
  4360  			"         ├─ InnerJoin\n" +
  4361  			"         │   ├─ Eq\n" +
  4362  			"         │   │   ├─ kt.id:4!null\n" +
  4363  			"         │   │   └─ t.kind_id:2!null\n" +
  4364  			"         │   ├─ Filter\n" +
  4365  			"         │   │   ├─ AND\n" +
  4366  			"         │   │   │   ├─ GreaterThan\n" +
  4367  			"         │   │   │   │   ├─ t.production_year:3\n" +
  4368  			"         │   │   │   │   └─ 2010 (smallint)\n" +
  4369  			"         │   │   │   └─ Or\n" +
  4370  			"         │   │   │       ├─ Or\n" +
  4371  			"         │   │   │       │   ├─ t.title LIKE '%murder%'\n" +
  4372  			"         │   │   │       │   └─ t.title LIKE '%Murder%'\n" +
  4373  			"         │   │   │       └─ t.title LIKE '%Mord%'\n" +
  4374  			"         │   │   └─ TableAlias(t)\n" +
  4375  			"         │   │       └─ ProcessTable\n" +
  4376  			"         │   │           └─ Table\n" +
  4377  			"         │   │               ├─ name: title\n" +
  4378  			"         │   │               └─ columns: [id title kind_id production_year]\n" +
  4379  			"         │   └─ Filter\n" +
  4380  			"         │       ├─ Eq\n" +
  4381  			"         │       │   ├─ kt.kind:1!null\n" +
  4382  			"         │       │   └─ movie (longtext)\n" +
  4383  			"         │       └─ TableAlias(kt)\n" +
  4384  			"         │           └─ ProcessTable\n" +
  4385  			"         │               └─ Table\n" +
  4386  			"         │                   ├─ name: kind_type\n" +
  4387  			"         │                   └─ columns: [id kind]\n" +
  4388  			"         └─ InnerJoin\n" +
  4389  			"             ├─ AND\n" +
  4390  			"             │   ├─ AND\n" +
  4391  			"             │   │   ├─ Eq\n" +
  4392  			"             │   │   │   ├─ it1.id:15!null\n" +
  4393  			"             │   │   │   └─ mi.info_type_id:18!null\n" +
  4394  			"             │   │   └─ Eq\n" +
  4395  			"             │   │       ├─ mi.movie_id:17!null\n" +
  4396  			"             │   │       └─ mi_idx.movie_id:10!null\n" +
  4397  			"             │   └─ Eq\n" +
  4398  			"             │       ├─ mk.movie_id:6!null\n" +
  4399  			"             │       └─ mi.movie_id:17!null\n" +
  4400  			"             ├─ InnerJoin\n" +
  4401  			"             │   ├─ Eq\n" +
  4402  			"             │   │   ├─ mk.movie_id:6!null\n" +
  4403  			"             │   │   └─ mi_idx.movie_id:10!null\n" +
  4404  			"             │   ├─ InnerJoin\n" +
  4405  			"             │   │   ├─ Eq\n" +
  4406  			"             │   │   │   ├─ k.id:8!null\n" +
  4407  			"             │   │   │   └─ mk.keyword_id:7!null\n" +
  4408  			"             │   │   ├─ TableAlias(mk)\n" +
  4409  			"             │   │   │   └─ ProcessTable\n" +
  4410  			"             │   │   │       └─ Table\n" +
  4411  			"             │   │   │           ├─ name: movie_keyword\n" +
  4412  			"             │   │   │           └─ columns: [movie_id keyword_id]\n" +
  4413  			"             │   │   └─ Filter\n" +
  4414  			"             │   │       ├─ HashIn\n" +
  4415  			"             │   │       │   ├─ k.keyword:1!null\n" +
  4416  			"             │   │       │   └─ TUPLE(murder (longtext), murder-in-title (longtext))\n" +
  4417  			"             │   │       └─ TableAlias(k)\n" +
  4418  			"             │   │           └─ ProcessTable\n" +
  4419  			"             │   │               └─ Table\n" +
  4420  			"             │   │                   ├─ name: keyword\n" +
  4421  			"             │   │                   └─ columns: [id keyword]\n" +
  4422  			"             │   └─ CrossJoin\n" +
  4423  			"             │       ├─ InnerJoin\n" +
  4424  			"             │       │   ├─ Eq\n" +
  4425  			"             │       │   │   ├─ it2.id:13!null\n" +
  4426  			"             │       │   │   └─ mi_idx.info_type_id:11!null\n" +
  4427  			"             │       │   ├─ Filter\n" +
  4428  			"             │       │   │   ├─ GreaterThan\n" +
  4429  			"             │       │   │   │   ├─ mi_idx.info:2!null\n" +
  4430  			"             │       │   │   │   └─ 6.0 (longtext)\n" +
  4431  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4432  			"             │       │   │       └─ ProcessTable\n" +
  4433  			"             │       │   │           └─ Table\n" +
  4434  			"             │       │   │               ├─ name: movie_info_idx\n" +
  4435  			"             │       │   │               └─ columns: [movie_id info_type_id info]\n" +
  4436  			"             │       │   └─ Filter\n" +
  4437  			"             │       │       ├─ Eq\n" +
  4438  			"             │       │       │   ├─ it2.info:1!null\n" +
  4439  			"             │       │       │   └─ rating (longtext)\n" +
  4440  			"             │       │       └─ TableAlias(it2)\n" +
  4441  			"             │       │           └─ ProcessTable\n" +
  4442  			"             │       │               └─ Table\n" +
  4443  			"             │       │                   ├─ name: info_type\n" +
  4444  			"             │       │                   └─ columns: [id info]\n" +
  4445  			"             │       └─ Filter\n" +
  4446  			"             │           ├─ Eq\n" +
  4447  			"             │           │   ├─ it1.info:1!null\n" +
  4448  			"             │           │   └─ countries (longtext)\n" +
  4449  			"             │           └─ TableAlias(it1)\n" +
  4450  			"             │               └─ Table\n" +
  4451  			"             │                   ├─ name: info_type\n" +
  4452  			"             │                   ├─ columns: [id info]\n" +
  4453  			"             │                   ├─ colSet: (1,2)\n" +
  4454  			"             │                   └─ tableId: 1\n" +
  4455  			"             └─ Filter\n" +
  4456  			"                 ├─ HashIn\n" +
  4457  			"                 │   ├─ mi.info:2!null\n" +
  4458  			"                 │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
  4459  			"                 └─ TableAlias(mi)\n" +
  4460  			"                     └─ ProcessTable\n" +
  4461  			"                         └─ Table\n" +
  4462  			"                             ├─ name: movie_info\n" +
  4463  			"                             └─ columns: [movie_id info_type_id info]\n" +
  4464  			"",
  4465  		ExpectedEstimates: "Project\n" +
  4466  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as western_dark_production]\n" +
  4467  			" └─ GroupBy\n" +
  4468  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
  4469  			"     ├─ Grouping()\n" +
  4470  			"     └─ InnerJoin\n" +
  4471  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mk.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
  4472  			"         ├─ InnerJoin\n" +
  4473  			"         │   ├─ (kt.id = t.kind_id)\n" +
  4474  			"         │   ├─ Filter\n" +
  4475  			"         │   │   ├─ ((t.production_year > 2010) AND ((t.title LIKE '%murder%' OR t.title LIKE '%Murder%') OR t.title LIKE '%Mord%'))\n" +
  4476  			"         │   │   └─ TableAlias(t)\n" +
  4477  			"         │   │       └─ Table\n" +
  4478  			"         │   │           ├─ name: title\n" +
  4479  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
  4480  			"         │   └─ Filter\n" +
  4481  			"         │       ├─ (kt.kind = 'movie')\n" +
  4482  			"         │       └─ TableAlias(kt)\n" +
  4483  			"         │           └─ Table\n" +
  4484  			"         │               ├─ name: kind_type\n" +
  4485  			"         │               └─ columns: [id kind]\n" +
  4486  			"         └─ InnerJoin\n" +
  4487  			"             ├─ (((it1.id = mi.info_type_id) AND (mi.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mi.movie_id))\n" +
  4488  			"             ├─ InnerJoin\n" +
  4489  			"             │   ├─ (mk.movie_id = mi_idx.movie_id)\n" +
  4490  			"             │   ├─ InnerJoin\n" +
  4491  			"             │   │   ├─ (k.id = mk.keyword_id)\n" +
  4492  			"             │   │   ├─ TableAlias(mk)\n" +
  4493  			"             │   │   │   └─ Table\n" +
  4494  			"             │   │   │       ├─ name: movie_keyword\n" +
  4495  			"             │   │   │       └─ columns: [movie_id keyword_id]\n" +
  4496  			"             │   │   └─ Filter\n" +
  4497  			"             │   │       ├─ (k.keyword HASH IN ('murder', 'murder-in-title'))\n" +
  4498  			"             │   │       └─ TableAlias(k)\n" +
  4499  			"             │   │           └─ Table\n" +
  4500  			"             │   │               ├─ name: keyword\n" +
  4501  			"             │   │               └─ columns: [id keyword]\n" +
  4502  			"             │   └─ CrossJoin\n" +
  4503  			"             │       ├─ InnerJoin\n" +
  4504  			"             │       │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  4505  			"             │       │   ├─ Filter\n" +
  4506  			"             │       │   │   ├─ (mi_idx.info > '6.0')\n" +
  4507  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4508  			"             │       │   │       └─ Table\n" +
  4509  			"             │       │   │           ├─ name: movie_info_idx\n" +
  4510  			"             │       │   │           └─ columns: [movie_id info_type_id info]\n" +
  4511  			"             │       │   └─ Filter\n" +
  4512  			"             │       │       ├─ (it2.info = 'rating')\n" +
  4513  			"             │       │       └─ TableAlias(it2)\n" +
  4514  			"             │       │           └─ Table\n" +
  4515  			"             │       │               ├─ name: info_type\n" +
  4516  			"             │       │               └─ columns: [id info]\n" +
  4517  			"             │       └─ Filter\n" +
  4518  			"             │           ├─ (it1.info = 'countries')\n" +
  4519  			"             │           └─ TableAlias(it1)\n" +
  4520  			"             │               └─ Table\n" +
  4521  			"             │                   ├─ name: info_type\n" +
  4522  			"             │                   └─ columns: [id info]\n" +
  4523  			"             └─ Filter\n" +
  4524  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
  4525  			"                 └─ TableAlias(mi)\n" +
  4526  			"                     └─ Table\n" +
  4527  			"                         ├─ name: movie_info\n" +
  4528  			"                         └─ columns: [movie_id info_type_id info]\n" +
  4529  			"",
  4530  		ExpectedAnalysis: "Project\n" +
  4531  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as western_dark_production]\n" +
  4532  			" └─ GroupBy\n" +
  4533  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
  4534  			"     ├─ Grouping()\n" +
  4535  			"     └─ InnerJoin\n" +
  4536  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mk.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
  4537  			"         ├─ InnerJoin\n" +
  4538  			"         │   ├─ (kt.id = t.kind_id)\n" +
  4539  			"         │   ├─ Filter\n" +
  4540  			"         │   │   ├─ ((t.production_year > 2010) AND ((t.title LIKE '%murder%' OR t.title LIKE '%Murder%') OR t.title LIKE '%Mord%'))\n" +
  4541  			"         │   │   └─ TableAlias(t)\n" +
  4542  			"         │   │       └─ Table\n" +
  4543  			"         │   │           ├─ name: title\n" +
  4544  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
  4545  			"         │   └─ Filter\n" +
  4546  			"         │       ├─ (kt.kind = 'movie')\n" +
  4547  			"         │       └─ TableAlias(kt)\n" +
  4548  			"         │           └─ Table\n" +
  4549  			"         │               ├─ name: kind_type\n" +
  4550  			"         │               └─ columns: [id kind]\n" +
  4551  			"         └─ InnerJoin\n" +
  4552  			"             ├─ (((it1.id = mi.info_type_id) AND (mi.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mi.movie_id))\n" +
  4553  			"             ├─ InnerJoin\n" +
  4554  			"             │   ├─ (mk.movie_id = mi_idx.movie_id)\n" +
  4555  			"             │   ├─ InnerJoin\n" +
  4556  			"             │   │   ├─ (k.id = mk.keyword_id)\n" +
  4557  			"             │   │   ├─ TableAlias(mk)\n" +
  4558  			"             │   │   │   └─ Table\n" +
  4559  			"             │   │   │       ├─ name: movie_keyword\n" +
  4560  			"             │   │   │       └─ columns: [movie_id keyword_id]\n" +
  4561  			"             │   │   └─ Filter\n" +
  4562  			"             │   │       ├─ (k.keyword HASH IN ('murder', 'murder-in-title'))\n" +
  4563  			"             │   │       └─ TableAlias(k)\n" +
  4564  			"             │   │           └─ Table\n" +
  4565  			"             │   │               ├─ name: keyword\n" +
  4566  			"             │   │               └─ columns: [id keyword]\n" +
  4567  			"             │   └─ CrossJoin\n" +
  4568  			"             │       ├─ InnerJoin\n" +
  4569  			"             │       │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  4570  			"             │       │   ├─ Filter\n" +
  4571  			"             │       │   │   ├─ (mi_idx.info > '6.0')\n" +
  4572  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4573  			"             │       │   │       └─ Table\n" +
  4574  			"             │       │   │           ├─ name: movie_info_idx\n" +
  4575  			"             │       │   │           └─ columns: [movie_id info_type_id info]\n" +
  4576  			"             │       │   └─ Filter\n" +
  4577  			"             │       │       ├─ (it2.info = 'rating')\n" +
  4578  			"             │       │       └─ TableAlias(it2)\n" +
  4579  			"             │       │           └─ Table\n" +
  4580  			"             │       │               ├─ name: info_type\n" +
  4581  			"             │       │               └─ columns: [id info]\n" +
  4582  			"             │       └─ Filter\n" +
  4583  			"             │           ├─ (it1.info = 'countries')\n" +
  4584  			"             │           └─ TableAlias(it1)\n" +
  4585  			"             │               └─ Table\n" +
  4586  			"             │                   ├─ name: info_type\n" +
  4587  			"             │                   └─ columns: [id info]\n" +
  4588  			"             └─ Filter\n" +
  4589  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
  4590  			"                 └─ TableAlias(mi)\n" +
  4591  			"                     └─ Table\n" +
  4592  			"                         ├─ name: movie_info\n" +
  4593  			"                         └─ columns: [movie_id info_type_id info]\n" +
  4594  			"",
  4595  	},
  4596  	{
  4597  		Query: `
  4598  SELECT MIN(mi_idx.info) AS rating,
  4599         MIN(t.title) AS north_european_dark_production
  4600  FROM info_type AS it1,
  4601       info_type AS it2,
  4602       keyword AS k,
  4603       kind_type AS kt,
  4604       movie_info AS mi,
  4605       movie_info_idx AS mi_idx,
  4606       movie_keyword AS mk,
  4607       title AS t
  4608  WHERE it1.info = 'countries'
  4609    AND it2.info = 'rating'
  4610    AND k.keyword IS NOT NULL
  4611    AND k.keyword IN ('murder',
  4612                      'murder-in-title',
  4613                      'blood',
  4614                      'violence')
  4615    AND kt.kind IN ('movie',
  4616                    'episode')
  4617    AND mi.info IN ('Sweden',
  4618                    'Norway',
  4619                    'Germany',
  4620                    'Denmark',
  4621                    'Swedish',
  4622                    'Danish',
  4623                    'Norwegian',
  4624                    'German',
  4625                    'USA',
  4626                    'American')
  4627    AND mi_idx.info < '8.5'
  4628    AND t.production_year > 2005
  4629    AND kt.id = t.kind_id
  4630    AND t.id = mi.movie_id
  4631    AND t.id = mk.movie_id
  4632    AND t.id = mi_idx.movie_id
  4633    AND mk.movie_id = mi.movie_id
  4634    AND mk.movie_id = mi_idx.movie_id
  4635    AND mi.movie_id = mi_idx.movie_id
  4636    AND k.id = mk.keyword_id
  4637    AND it1.id = mi.info_type_id
  4638    AND it2.id = mi_idx.info_type_id;
  4639  
  4640  `,
  4641  		ExpectedPlan: "Project\n" +
  4642  			" ├─ columns: [min(mi_idx.info):0!null as rating, min(t.title):1!null as north_european_dark_production]\n" +
  4643  			" └─ GroupBy\n" +
  4644  			"     ├─ select: MIN(mi_idx.info:12!null), MIN(t.title:1!null)\n" +
  4645  			"     ├─ group: \n" +
  4646  			"     └─ InnerJoin\n" +
  4647  			"         ├─ AND\n" +
  4648  			"         │   ├─ AND\n" +
  4649  			"         │   │   ├─ Eq\n" +
  4650  			"         │   │   │   ├─ t.id:0!null\n" +
  4651  			"         │   │   │   └─ mi.movie_id:17!null\n" +
  4652  			"         │   │   └─ Eq\n" +
  4653  			"         │   │       ├─ t.id:0!null\n" +
  4654  			"         │   │       └─ mk.movie_id:6!null\n" +
  4655  			"         │   └─ Eq\n" +
  4656  			"         │       ├─ t.id:0!null\n" +
  4657  			"         │       └─ mi_idx.movie_id:10!null\n" +
  4658  			"         ├─ InnerJoin\n" +
  4659  			"         │   ├─ Eq\n" +
  4660  			"         │   │   ├─ kt.id:4!null\n" +
  4661  			"         │   │   └─ t.kind_id:2!null\n" +
  4662  			"         │   ├─ Filter\n" +
  4663  			"         │   │   ├─ GreaterThan\n" +
  4664  			"         │   │   │   ├─ t.production_year:3\n" +
  4665  			"         │   │   │   └─ 2005 (smallint)\n" +
  4666  			"         │   │   └─ TableAlias(t)\n" +
  4667  			"         │   │       └─ ProcessTable\n" +
  4668  			"         │   │           └─ Table\n" +
  4669  			"         │   │               ├─ name: title\n" +
  4670  			"         │   │               └─ columns: [id title kind_id production_year]\n" +
  4671  			"         │   └─ Filter\n" +
  4672  			"         │       ├─ HashIn\n" +
  4673  			"         │       │   ├─ kt.kind:1!null\n" +
  4674  			"         │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
  4675  			"         │       └─ TableAlias(kt)\n" +
  4676  			"         │           └─ ProcessTable\n" +
  4677  			"         │               └─ Table\n" +
  4678  			"         │                   ├─ name: kind_type\n" +
  4679  			"         │                   └─ columns: [id kind]\n" +
  4680  			"         └─ InnerJoin\n" +
  4681  			"             ├─ AND\n" +
  4682  			"             │   ├─ AND\n" +
  4683  			"             │   │   ├─ Eq\n" +
  4684  			"             │   │   │   ├─ it1.id:15!null\n" +
  4685  			"             │   │   │   └─ mi.info_type_id:18!null\n" +
  4686  			"             │   │   └─ Eq\n" +
  4687  			"             │   │       ├─ mi.movie_id:17!null\n" +
  4688  			"             │   │       └─ mi_idx.movie_id:10!null\n" +
  4689  			"             │   └─ Eq\n" +
  4690  			"             │       ├─ mk.movie_id:6!null\n" +
  4691  			"             │       └─ mi.movie_id:17!null\n" +
  4692  			"             ├─ InnerJoin\n" +
  4693  			"             │   ├─ Eq\n" +
  4694  			"             │   │   ├─ mk.movie_id:6!null\n" +
  4695  			"             │   │   └─ mi_idx.movie_id:10!null\n" +
  4696  			"             │   ├─ InnerJoin\n" +
  4697  			"             │   │   ├─ Eq\n" +
  4698  			"             │   │   │   ├─ k.id:8!null\n" +
  4699  			"             │   │   │   └─ mk.keyword_id:7!null\n" +
  4700  			"             │   │   ├─ TableAlias(mk)\n" +
  4701  			"             │   │   │   └─ ProcessTable\n" +
  4702  			"             │   │   │       └─ Table\n" +
  4703  			"             │   │   │           ├─ name: movie_keyword\n" +
  4704  			"             │   │   │           └─ columns: [movie_id keyword_id]\n" +
  4705  			"             │   │   └─ Filter\n" +
  4706  			"             │   │       ├─ AND\n" +
  4707  			"             │   │       │   ├─ NOT\n" +
  4708  			"             │   │       │   │   └─ k.keyword:1!null IS NULL\n" +
  4709  			"             │   │       │   └─ HashIn\n" +
  4710  			"             │   │       │       ├─ k.keyword:1!null\n" +
  4711  			"             │   │       │       └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
  4712  			"             │   │       └─ TableAlias(k)\n" +
  4713  			"             │   │           └─ ProcessTable\n" +
  4714  			"             │   │               └─ Table\n" +
  4715  			"             │   │                   ├─ name: keyword\n" +
  4716  			"             │   │                   └─ columns: [id keyword]\n" +
  4717  			"             │   └─ CrossJoin\n" +
  4718  			"             │       ├─ InnerJoin\n" +
  4719  			"             │       │   ├─ Eq\n" +
  4720  			"             │       │   │   ├─ it2.id:13!null\n" +
  4721  			"             │       │   │   └─ mi_idx.info_type_id:11!null\n" +
  4722  			"             │       │   ├─ Filter\n" +
  4723  			"             │       │   │   ├─ LessThan\n" +
  4724  			"             │       │   │   │   ├─ mi_idx.info:2!null\n" +
  4725  			"             │       │   │   │   └─ 8.5 (longtext)\n" +
  4726  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4727  			"             │       │   │       └─ ProcessTable\n" +
  4728  			"             │       │   │           └─ Table\n" +
  4729  			"             │       │   │               ├─ name: movie_info_idx\n" +
  4730  			"             │       │   │               └─ columns: [movie_id info_type_id info]\n" +
  4731  			"             │       │   └─ Filter\n" +
  4732  			"             │       │       ├─ Eq\n" +
  4733  			"             │       │       │   ├─ it2.info:1!null\n" +
  4734  			"             │       │       │   └─ rating (longtext)\n" +
  4735  			"             │       │       └─ TableAlias(it2)\n" +
  4736  			"             │       │           └─ ProcessTable\n" +
  4737  			"             │       │               └─ Table\n" +
  4738  			"             │       │                   ├─ name: info_type\n" +
  4739  			"             │       │                   └─ columns: [id info]\n" +
  4740  			"             │       └─ Filter\n" +
  4741  			"             │           ├─ Eq\n" +
  4742  			"             │           │   ├─ it1.info:1!null\n" +
  4743  			"             │           │   └─ countries (longtext)\n" +
  4744  			"             │           └─ TableAlias(it1)\n" +
  4745  			"             │               └─ Table\n" +
  4746  			"             │                   ├─ name: info_type\n" +
  4747  			"             │                   ├─ columns: [id info]\n" +
  4748  			"             │                   ├─ colSet: (1,2)\n" +
  4749  			"             │                   └─ tableId: 1\n" +
  4750  			"             └─ Filter\n" +
  4751  			"                 ├─ HashIn\n" +
  4752  			"                 │   ├─ mi.info:2!null\n" +
  4753  			"                 │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Danish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
  4754  			"                 └─ TableAlias(mi)\n" +
  4755  			"                     └─ ProcessTable\n" +
  4756  			"                         └─ Table\n" +
  4757  			"                             ├─ name: movie_info\n" +
  4758  			"                             └─ columns: [movie_id info_type_id info]\n" +
  4759  			"",
  4760  		ExpectedEstimates: "Project\n" +
  4761  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as north_european_dark_production]\n" +
  4762  			" └─ GroupBy\n" +
  4763  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
  4764  			"     ├─ Grouping()\n" +
  4765  			"     └─ InnerJoin\n" +
  4766  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mk.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
  4767  			"         ├─ InnerJoin\n" +
  4768  			"         │   ├─ (kt.id = t.kind_id)\n" +
  4769  			"         │   ├─ Filter\n" +
  4770  			"         │   │   ├─ (t.production_year > 2005)\n" +
  4771  			"         │   │   └─ TableAlias(t)\n" +
  4772  			"         │   │       └─ Table\n" +
  4773  			"         │   │           ├─ name: title\n" +
  4774  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
  4775  			"         │   └─ Filter\n" +
  4776  			"         │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
  4777  			"         │       └─ TableAlias(kt)\n" +
  4778  			"         │           └─ Table\n" +
  4779  			"         │               ├─ name: kind_type\n" +
  4780  			"         │               └─ columns: [id kind]\n" +
  4781  			"         └─ InnerJoin\n" +
  4782  			"             ├─ (((it1.id = mi.info_type_id) AND (mi.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mi.movie_id))\n" +
  4783  			"             ├─ InnerJoin\n" +
  4784  			"             │   ├─ (mk.movie_id = mi_idx.movie_id)\n" +
  4785  			"             │   ├─ InnerJoin\n" +
  4786  			"             │   │   ├─ (k.id = mk.keyword_id)\n" +
  4787  			"             │   │   ├─ TableAlias(mk)\n" +
  4788  			"             │   │   │   └─ Table\n" +
  4789  			"             │   │   │       ├─ name: movie_keyword\n" +
  4790  			"             │   │   │       └─ columns: [movie_id keyword_id]\n" +
  4791  			"             │   │   └─ Filter\n" +
  4792  			"             │   │       ├─ ((NOT(k.keyword IS NULL)) AND (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence')))\n" +
  4793  			"             │   │       └─ TableAlias(k)\n" +
  4794  			"             │   │           └─ Table\n" +
  4795  			"             │   │               ├─ name: keyword\n" +
  4796  			"             │   │               └─ columns: [id keyword]\n" +
  4797  			"             │   └─ CrossJoin\n" +
  4798  			"             │       ├─ InnerJoin\n" +
  4799  			"             │       │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  4800  			"             │       │   ├─ Filter\n" +
  4801  			"             │       │   │   ├─ (mi_idx.info < '8.5')\n" +
  4802  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4803  			"             │       │   │       └─ Table\n" +
  4804  			"             │       │   │           ├─ name: movie_info_idx\n" +
  4805  			"             │       │   │           └─ columns: [movie_id info_type_id info]\n" +
  4806  			"             │       │   └─ Filter\n" +
  4807  			"             │       │       ├─ (it2.info = 'rating')\n" +
  4808  			"             │       │       └─ TableAlias(it2)\n" +
  4809  			"             │       │           └─ Table\n" +
  4810  			"             │       │               ├─ name: info_type\n" +
  4811  			"             │       │               └─ columns: [id info]\n" +
  4812  			"             │       └─ Filter\n" +
  4813  			"             │           ├─ (it1.info = 'countries')\n" +
  4814  			"             │           └─ TableAlias(it1)\n" +
  4815  			"             │               └─ Table\n" +
  4816  			"             │                   ├─ name: info_type\n" +
  4817  			"             │                   └─ columns: [id info]\n" +
  4818  			"             └─ Filter\n" +
  4819  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
  4820  			"                 └─ TableAlias(mi)\n" +
  4821  			"                     └─ Table\n" +
  4822  			"                         ├─ name: movie_info\n" +
  4823  			"                         └─ columns: [movie_id info_type_id info]\n" +
  4824  			"",
  4825  		ExpectedAnalysis: "Project\n" +
  4826  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as north_european_dark_production]\n" +
  4827  			" └─ GroupBy\n" +
  4828  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
  4829  			"     ├─ Grouping()\n" +
  4830  			"     └─ InnerJoin\n" +
  4831  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mk.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
  4832  			"         ├─ InnerJoin\n" +
  4833  			"         │   ├─ (kt.id = t.kind_id)\n" +
  4834  			"         │   ├─ Filter\n" +
  4835  			"         │   │   ├─ (t.production_year > 2005)\n" +
  4836  			"         │   │   └─ TableAlias(t)\n" +
  4837  			"         │   │       └─ Table\n" +
  4838  			"         │   │           ├─ name: title\n" +
  4839  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
  4840  			"         │   └─ Filter\n" +
  4841  			"         │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
  4842  			"         │       └─ TableAlias(kt)\n" +
  4843  			"         │           └─ Table\n" +
  4844  			"         │               ├─ name: kind_type\n" +
  4845  			"         │               └─ columns: [id kind]\n" +
  4846  			"         └─ InnerJoin\n" +
  4847  			"             ├─ (((it1.id = mi.info_type_id) AND (mi.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mi.movie_id))\n" +
  4848  			"             ├─ InnerJoin\n" +
  4849  			"             │   ├─ (mk.movie_id = mi_idx.movie_id)\n" +
  4850  			"             │   ├─ InnerJoin\n" +
  4851  			"             │   │   ├─ (k.id = mk.keyword_id)\n" +
  4852  			"             │   │   ├─ TableAlias(mk)\n" +
  4853  			"             │   │   │   └─ Table\n" +
  4854  			"             │   │   │       ├─ name: movie_keyword\n" +
  4855  			"             │   │   │       └─ columns: [movie_id keyword_id]\n" +
  4856  			"             │   │   └─ Filter\n" +
  4857  			"             │   │       ├─ ((NOT(k.keyword IS NULL)) AND (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence')))\n" +
  4858  			"             │   │       └─ TableAlias(k)\n" +
  4859  			"             │   │           └─ Table\n" +
  4860  			"             │   │               ├─ name: keyword\n" +
  4861  			"             │   │               └─ columns: [id keyword]\n" +
  4862  			"             │   └─ CrossJoin\n" +
  4863  			"             │       ├─ InnerJoin\n" +
  4864  			"             │       │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  4865  			"             │       │   ├─ Filter\n" +
  4866  			"             │       │   │   ├─ (mi_idx.info < '8.5')\n" +
  4867  			"             │       │   │   └─ TableAlias(mi_idx)\n" +
  4868  			"             │       │   │       └─ Table\n" +
  4869  			"             │       │   │           ├─ name: movie_info_idx\n" +
  4870  			"             │       │   │           └─ columns: [movie_id info_type_id info]\n" +
  4871  			"             │       │   └─ Filter\n" +
  4872  			"             │       │       ├─ (it2.info = 'rating')\n" +
  4873  			"             │       │       └─ TableAlias(it2)\n" +
  4874  			"             │       │           └─ Table\n" +
  4875  			"             │       │               ├─ name: info_type\n" +
  4876  			"             │       │               └─ columns: [id info]\n" +
  4877  			"             │       └─ Filter\n" +
  4878  			"             │           ├─ (it1.info = 'countries')\n" +
  4879  			"             │           └─ TableAlias(it1)\n" +
  4880  			"             │               └─ Table\n" +
  4881  			"             │                   ├─ name: info_type\n" +
  4882  			"             │                   └─ columns: [id info]\n" +
  4883  			"             └─ Filter\n" +
  4884  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
  4885  			"                 └─ TableAlias(mi)\n" +
  4886  			"                     └─ Table\n" +
  4887  			"                         ├─ name: movie_info\n" +
  4888  			"                         └─ columns: [movie_id info_type_id info]\n" +
  4889  			"",
  4890  	},
  4891  	{
  4892  		Query: `
  4893  SELECT MIN(mi.info) AS release_date,
  4894         MIN(t.title) AS internet_movie
  4895  FROM aka_title AS at,
  4896       company_name AS cn,
  4897       company_type AS ct,
  4898       info_type AS it1,
  4899       keyword AS k,
  4900       movie_companies AS mc,
  4901       movie_info AS mi,
  4902       movie_keyword AS mk,
  4903       title AS t
  4904  WHERE cn.country_code = '[us]'
  4905    AND it1.info = 'release dates'
  4906    AND mc.note LIKE '%(200%)%'
  4907    AND mc.note LIKE '%(worldwide)%'
  4908    AND mi.note LIKE '%internet%'
  4909    AND mi.info LIKE 'USA:% 200%'
  4910    AND t.production_year > 2000
  4911    AND t.id = at.movie_id
  4912    AND t.id = mi.movie_id
  4913    AND t.id = mk.movie_id
  4914    AND t.id = mc.movie_id
  4915    AND mk.movie_id = mi.movie_id
  4916    AND mk.movie_id = mc.movie_id
  4917    AND mk.movie_id = at.movie_id
  4918    AND mi.movie_id = mc.movie_id
  4919    AND mi.movie_id = at.movie_id
  4920    AND mc.movie_id = at.movie_id
  4921    AND k.id = mk.keyword_id
  4922    AND it1.id = mi.info_type_id
  4923    AND cn.id = mc.company_id
  4924    AND ct.id = mc.company_type_id;
  4925  
  4926  `,
  4927  		ExpectedPlan: "Project\n" +
  4928  			" ├─ columns: [min(mi.info):0!null as release_date, min(t.title):1!null as internet_movie]\n" +
  4929  			" └─ GroupBy\n" +
  4930  			"     ├─ select: MIN(mi.info:4!null), MIN(t.title:18!null)\n" +
  4931  			"     ├─ group: \n" +
  4932  			"     └─ HashJoin\n" +
  4933  			"         ├─ AND\n" +
  4934  			"         │   ├─ AND\n" +
  4935  			"         │   │   ├─ AND\n" +
  4936  			"         │   │   │   ├─ Eq\n" +
  4937  			"         │   │   │   │   ├─ t.id:17!null\n" +
  4938  			"         │   │   │   │   └─ at.movie_id:1!null\n" +
  4939  			"         │   │   │   └─ Eq\n" +
  4940  			"         │   │   │       ├─ t.id:17!null\n" +
  4941  			"         │   │   │       └─ mi.movie_id:2!null\n" +
  4942  			"         │   │   └─ Eq\n" +
  4943  			"         │   │       ├─ t.id:17!null\n" +
  4944  			"         │   │       └─ mk.movie_id:15!null\n" +
  4945  			"         │   └─ Eq\n" +
  4946  			"         │       ├─ t.id:17!null\n" +
  4947  			"         │       └─ mc.movie_id:8!null\n" +
  4948  			"         ├─ HashJoin\n" +
  4949  			"         │   ├─ Eq\n" +
  4950  			"         │   │   ├─ k.id:0!null\n" +
  4951  			"         │   │   └─ mk.keyword_id:16!null\n" +
  4952  			"         │   ├─ TableAlias(k)\n" +
  4953  			"         │   │   └─ ProcessTable\n" +
  4954  			"         │   │       └─ Table\n" +
  4955  			"         │   │           ├─ name: keyword\n" +
  4956  			"         │   │           └─ columns: [id]\n" +
  4957  			"         │   └─ HashLookup\n" +
  4958  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  4959  			"         │       ├─ right-key: TUPLE(mk.keyword_id:15!null)\n" +
  4960  			"         │       └─ HashJoin\n" +
  4961  			"         │           ├─ AND\n" +
  4962  			"         │           │   ├─ AND\n" +
  4963  			"         │           │   │   ├─ Eq\n" +
  4964  			"         │           │   │   │   ├─ mc.movie_id:8!null\n" +
  4965  			"         │           │   │   │   └─ at.movie_id:1!null\n" +
  4966  			"         │           │   │   └─ Eq\n" +
  4967  			"         │           │   │       ├─ mi.movie_id:2!null\n" +
  4968  			"         │           │   │       └─ at.movie_id:1!null\n" +
  4969  			"         │           │   └─ Eq\n" +
  4970  			"         │           │       ├─ mk.movie_id:15!null\n" +
  4971  			"         │           │       └─ at.movie_id:1!null\n" +
  4972  			"         │           ├─ TableAlias(at)\n" +
  4973  			"         │           │   └─ ProcessTable\n" +
  4974  			"         │           │       └─ Table\n" +
  4975  			"         │           │           ├─ name: aka_title\n" +
  4976  			"         │           │           └─ columns: [movie_id]\n" +
  4977  			"         │           └─ HashLookup\n" +
  4978  			"         │               ├─ left-key: TUPLE(at.movie_id:1!null, at.movie_id:1!null, at.movie_id:1!null)\n" +
  4979  			"         │               ├─ right-key: TUPLE(mc.movie_id:6!null, mi.movie_id:0!null, mk.movie_id:13!null)\n" +
  4980  			"         │               └─ LookupJoin\n" +
  4981  			"         │                   ├─ InnerJoin\n" +
  4982  			"         │                   │   ├─ Eq\n" +
  4983  			"         │                   │   │   ├─ mi.movie_id:2!null\n" +
  4984  			"         │                   │   │   └─ mc.movie_id:8!null\n" +
  4985  			"         │                   │   ├─ InnerJoin\n" +
  4986  			"         │                   │   │   ├─ Eq\n" +
  4987  			"         │                   │   │   │   ├─ it1.id:6!null\n" +
  4988  			"         │                   │   │   │   └─ mi.info_type_id:3!null\n" +
  4989  			"         │                   │   │   ├─ Filter\n" +
  4990  			"         │                   │   │   │   ├─ AND\n" +
  4991  			"         │                   │   │   │   │   ├─ mi.note LIKE '%internet%'\n" +
  4992  			"         │                   │   │   │   │   └─ mi.info LIKE 'USA:% 200%'\n" +
  4993  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  4994  			"         │                   │   │   │       └─ ProcessTable\n" +
  4995  			"         │                   │   │   │           └─ Table\n" +
  4996  			"         │                   │   │   │               ├─ name: movie_info\n" +
  4997  			"         │                   │   │   │               └─ columns: [movie_id info_type_id info note]\n" +
  4998  			"         │                   │   │   └─ Filter\n" +
  4999  			"         │                   │   │       ├─ Eq\n" +
  5000  			"         │                   │   │       │   ├─ it1.info:1!null\n" +
  5001  			"         │                   │   │       │   └─ release dates (longtext)\n" +
  5002  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5003  			"         │                   │   │           └─ ProcessTable\n" +
  5004  			"         │                   │   │               └─ Table\n" +
  5005  			"         │                   │   │                   ├─ name: info_type\n" +
  5006  			"         │                   │   │                   └─ columns: [id info]\n" +
  5007  			"         │                   │   └─ InnerJoin\n" +
  5008  			"         │                   │       ├─ Eq\n" +
  5009  			"         │                   │       │   ├─ ct.id:14!null\n" +
  5010  			"         │                   │       │   └─ mc.company_type_id:10!null\n" +
  5011  			"         │                   │       ├─ InnerJoin\n" +
  5012  			"         │                   │       │   ├─ Eq\n" +
  5013  			"         │                   │       │   │   ├─ cn.id:12!null\n" +
  5014  			"         │                   │       │   │   └─ mc.company_id:9!null\n" +
  5015  			"         │                   │       │   ├─ Filter\n" +
  5016  			"         │                   │       │   │   ├─ AND\n" +
  5017  			"         │                   │       │   │   │   ├─ mc.note LIKE '%(200%)%'\n" +
  5018  			"         │                   │       │   │   │   └─ mc.note LIKE '%(worldwide)%'\n" +
  5019  			"         │                   │       │   │   └─ TableAlias(mc)\n" +
  5020  			"         │                   │       │   │       └─ ProcessTable\n" +
  5021  			"         │                   │       │   │           └─ Table\n" +
  5022  			"         │                   │       │   │               ├─ name: movie_companies\n" +
  5023  			"         │                   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
  5024  			"         │                   │       │   └─ Filter\n" +
  5025  			"         │                   │       │       ├─ Eq\n" +
  5026  			"         │                   │       │       │   ├─ cn.country_code:1\n" +
  5027  			"         │                   │       │       │   └─ [us] (longtext)\n" +
  5028  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5029  			"         │                   │       │           └─ ProcessTable\n" +
  5030  			"         │                   │       │               └─ Table\n" +
  5031  			"         │                   │       │                   ├─ name: company_name\n" +
  5032  			"         │                   │       │                   └─ columns: [id country_code]\n" +
  5033  			"         │                   │       └─ TableAlias(ct)\n" +
  5034  			"         │                   │           └─ ProcessTable\n" +
  5035  			"         │                   │               └─ Table\n" +
  5036  			"         │                   │                   ├─ name: company_type\n" +
  5037  			"         │                   │                   └─ columns: [id]\n" +
  5038  			"         │                   └─ TableAlias(mk)\n" +
  5039  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5040  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5041  			"         │                           ├─ keys: [mi.movie_id:2!null]\n" +
  5042  			"         │                           ├─ colSet: (37-39)\n" +
  5043  			"         │                           ├─ tableId: 8\n" +
  5044  			"         │                           └─ Table\n" +
  5045  			"         │                               ├─ name: movie_keyword\n" +
  5046  			"         │                               └─ columns: [movie_id keyword_id]\n" +
  5047  			"         └─ HashLookup\n" +
  5048  			"             ├─ left-key: TUPLE(at.movie_id:1!null, mi.movie_id:2!null, mk.movie_id:15!null, mc.movie_id:8!null)\n" +
  5049  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  5050  			"             └─ Filter\n" +
  5051  			"                 ├─ GreaterThan\n" +
  5052  			"                 │   ├─ t.production_year:2\n" +
  5053  			"                 │   └─ 2000 (smallint)\n" +
  5054  			"                 └─ TableAlias(t)\n" +
  5055  			"                     └─ ProcessTable\n" +
  5056  			"                         └─ Table\n" +
  5057  			"                             ├─ name: title\n" +
  5058  			"                             └─ columns: [id title production_year]\n" +
  5059  			"",
  5060  		ExpectedEstimates: "Project\n" +
  5061  			" ├─ columns: [min(mi.info) as release_date, min(t.title) as internet_movie]\n" +
  5062  			" └─ GroupBy\n" +
  5063  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  5064  			"     ├─ Grouping()\n" +
  5065  			"     └─ HashJoin\n" +
  5066  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  5067  			"         ├─ HashJoin\n" +
  5068  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  5069  			"         │   ├─ TableAlias(k)\n" +
  5070  			"         │   │   └─ Table\n" +
  5071  			"         │   │       ├─ name: keyword\n" +
  5072  			"         │   │       └─ columns: [id]\n" +
  5073  			"         │   └─ HashLookup\n" +
  5074  			"         │       ├─ left-key: (k.id)\n" +
  5075  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  5076  			"         │       └─ HashJoin\n" +
  5077  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  5078  			"         │           ├─ TableAlias(at)\n" +
  5079  			"         │           │   └─ Table\n" +
  5080  			"         │           │       ├─ name: aka_title\n" +
  5081  			"         │           │       └─ columns: [movie_id]\n" +
  5082  			"         │           └─ HashLookup\n" +
  5083  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  5084  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  5085  			"         │               └─ LookupJoin\n" +
  5086  			"         │                   ├─ InnerJoin\n" +
  5087  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  5088  			"         │                   │   ├─ InnerJoin\n" +
  5089  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  5090  			"         │                   │   │   ├─ Filter\n" +
  5091  			"         │                   │   │   │   ├─ (mi.note LIKE '%internet%' AND mi.info LIKE 'USA:% 200%')\n" +
  5092  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5093  			"         │                   │   │   │       └─ Table\n" +
  5094  			"         │                   │   │   │           ├─ name: movie_info\n" +
  5095  			"         │                   │   │   │           └─ columns: [movie_id info_type_id info note]\n" +
  5096  			"         │                   │   │   └─ Filter\n" +
  5097  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  5098  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5099  			"         │                   │   │           └─ Table\n" +
  5100  			"         │                   │   │               ├─ name: info_type\n" +
  5101  			"         │                   │   │               └─ columns: [id info]\n" +
  5102  			"         │                   │   └─ InnerJoin\n" +
  5103  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  5104  			"         │                   │       ├─ InnerJoin\n" +
  5105  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  5106  			"         │                   │       │   ├─ Filter\n" +
  5107  			"         │                   │       │   │   ├─ (mc.note LIKE '%(200%)%' AND mc.note LIKE '%(worldwide)%')\n" +
  5108  			"         │                   │       │   │   └─ TableAlias(mc)\n" +
  5109  			"         │                   │       │   │       └─ Table\n" +
  5110  			"         │                   │       │   │           ├─ name: movie_companies\n" +
  5111  			"         │                   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  5112  			"         │                   │       │   └─ Filter\n" +
  5113  			"         │                   │       │       ├─ (cn.country_code = '[us]')\n" +
  5114  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5115  			"         │                   │       │           └─ Table\n" +
  5116  			"         │                   │       │               ├─ name: company_name\n" +
  5117  			"         │                   │       │               └─ columns: [id country_code]\n" +
  5118  			"         │                   │       └─ TableAlias(ct)\n" +
  5119  			"         │                   │           └─ Table\n" +
  5120  			"         │                   │               ├─ name: company_type\n" +
  5121  			"         │                   │               └─ columns: [id]\n" +
  5122  			"         │                   └─ TableAlias(mk)\n" +
  5123  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5124  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5125  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  5126  			"         │                           └─ keys: mi.movie_id\n" +
  5127  			"         └─ HashLookup\n" +
  5128  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  5129  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  5130  			"             └─ Filter\n" +
  5131  			"                 ├─ (t.production_year > 2000)\n" +
  5132  			"                 └─ TableAlias(t)\n" +
  5133  			"                     └─ Table\n" +
  5134  			"                         ├─ name: title\n" +
  5135  			"                         └─ columns: [id title production_year]\n" +
  5136  			"",
  5137  		ExpectedAnalysis: "Project\n" +
  5138  			" ├─ columns: [min(mi.info) as release_date, min(t.title) as internet_movie]\n" +
  5139  			" └─ GroupBy\n" +
  5140  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  5141  			"     ├─ Grouping()\n" +
  5142  			"     └─ HashJoin\n" +
  5143  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  5144  			"         ├─ HashJoin\n" +
  5145  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  5146  			"         │   ├─ TableAlias(k)\n" +
  5147  			"         │   │   └─ Table\n" +
  5148  			"         │   │       ├─ name: keyword\n" +
  5149  			"         │   │       └─ columns: [id]\n" +
  5150  			"         │   └─ HashLookup\n" +
  5151  			"         │       ├─ left-key: (k.id)\n" +
  5152  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  5153  			"         │       └─ HashJoin\n" +
  5154  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  5155  			"         │           ├─ TableAlias(at)\n" +
  5156  			"         │           │   └─ Table\n" +
  5157  			"         │           │       ├─ name: aka_title\n" +
  5158  			"         │           │       └─ columns: [movie_id]\n" +
  5159  			"         │           └─ HashLookup\n" +
  5160  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  5161  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  5162  			"         │               └─ LookupJoin\n" +
  5163  			"         │                   ├─ InnerJoin\n" +
  5164  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  5165  			"         │                   │   ├─ InnerJoin\n" +
  5166  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  5167  			"         │                   │   │   ├─ Filter\n" +
  5168  			"         │                   │   │   │   ├─ (mi.note LIKE '%internet%' AND mi.info LIKE 'USA:% 200%')\n" +
  5169  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5170  			"         │                   │   │   │       └─ Table\n" +
  5171  			"         │                   │   │   │           ├─ name: movie_info\n" +
  5172  			"         │                   │   │   │           └─ columns: [movie_id info_type_id info note]\n" +
  5173  			"         │                   │   │   └─ Filter\n" +
  5174  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  5175  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5176  			"         │                   │   │           └─ Table\n" +
  5177  			"         │                   │   │               ├─ name: info_type\n" +
  5178  			"         │                   │   │               └─ columns: [id info]\n" +
  5179  			"         │                   │   └─ InnerJoin\n" +
  5180  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  5181  			"         │                   │       ├─ InnerJoin\n" +
  5182  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  5183  			"         │                   │       │   ├─ Filter\n" +
  5184  			"         │                   │       │   │   ├─ (mc.note LIKE '%(200%)%' AND mc.note LIKE '%(worldwide)%')\n" +
  5185  			"         │                   │       │   │   └─ TableAlias(mc)\n" +
  5186  			"         │                   │       │   │       └─ Table\n" +
  5187  			"         │                   │       │   │           ├─ name: movie_companies\n" +
  5188  			"         │                   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  5189  			"         │                   │       │   └─ Filter\n" +
  5190  			"         │                   │       │       ├─ (cn.country_code = '[us]')\n" +
  5191  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5192  			"         │                   │       │           └─ Table\n" +
  5193  			"         │                   │       │               ├─ name: company_name\n" +
  5194  			"         │                   │       │               └─ columns: [id country_code]\n" +
  5195  			"         │                   │       └─ TableAlias(ct)\n" +
  5196  			"         │                   │           └─ Table\n" +
  5197  			"         │                   │               ├─ name: company_type\n" +
  5198  			"         │                   │               └─ columns: [id]\n" +
  5199  			"         │                   └─ TableAlias(mk)\n" +
  5200  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5201  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5202  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  5203  			"         │                           └─ keys: mi.movie_id\n" +
  5204  			"         └─ HashLookup\n" +
  5205  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  5206  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  5207  			"             └─ Filter\n" +
  5208  			"                 ├─ (t.production_year > 2000)\n" +
  5209  			"                 └─ TableAlias(t)\n" +
  5210  			"                     └─ Table\n" +
  5211  			"                         ├─ name: title\n" +
  5212  			"                         └─ columns: [id title production_year]\n" +
  5213  			"",
  5214  	},
  5215  	{
  5216  		Query: `
  5217  SELECT MIN(mi.info) AS release_date,
  5218         MIN(t.title) AS youtube_movie
  5219  FROM aka_title AS at,
  5220       company_name AS cn,
  5221       company_type AS ct,
  5222       info_type AS it1,
  5223       keyword AS k,
  5224       movie_companies AS mc,
  5225       movie_info AS mi,
  5226       movie_keyword AS mk,
  5227       title AS t
  5228  WHERE cn.country_code = '[us]'
  5229    AND cn.name = 'YouTube'
  5230    AND it1.info = 'release dates'
  5231    AND mc.note LIKE '%(200%)%'
  5232    AND mc.note LIKE '%(worldwide)%'
  5233    AND mi.note LIKE '%internet%'
  5234    AND mi.info LIKE 'USA:% 200%'
  5235    AND t.production_year BETWEEN 2005 AND 2010
  5236    AND t.id = at.movie_id
  5237    AND t.id = mi.movie_id
  5238    AND t.id = mk.movie_id
  5239    AND t.id = mc.movie_id
  5240    AND mk.movie_id = mi.movie_id
  5241    AND mk.movie_id = mc.movie_id
  5242    AND mk.movie_id = at.movie_id
  5243    AND mi.movie_id = mc.movie_id
  5244    AND mi.movie_id = at.movie_id
  5245    AND mc.movie_id = at.movie_id
  5246    AND k.id = mk.keyword_id
  5247    AND it1.id = mi.info_type_id
  5248    AND cn.id = mc.company_id
  5249    AND ct.id = mc.company_type_id;
  5250  
  5251  `,
  5252  		ExpectedPlan: "Project\n" +
  5253  			" ├─ columns: [min(mi.info):0!null as release_date, min(t.title):1!null as youtube_movie]\n" +
  5254  			" └─ GroupBy\n" +
  5255  			"     ├─ select: MIN(mi.info:4!null), MIN(t.title:19!null)\n" +
  5256  			"     ├─ group: \n" +
  5257  			"     └─ HashJoin\n" +
  5258  			"         ├─ AND\n" +
  5259  			"         │   ├─ AND\n" +
  5260  			"         │   │   ├─ AND\n" +
  5261  			"         │   │   │   ├─ Eq\n" +
  5262  			"         │   │   │   │   ├─ t.id:18!null\n" +
  5263  			"         │   │   │   │   └─ at.movie_id:1!null\n" +
  5264  			"         │   │   │   └─ Eq\n" +
  5265  			"         │   │   │       ├─ t.id:18!null\n" +
  5266  			"         │   │   │       └─ mi.movie_id:2!null\n" +
  5267  			"         │   │   └─ Eq\n" +
  5268  			"         │   │       ├─ t.id:18!null\n" +
  5269  			"         │   │       └─ mk.movie_id:16!null\n" +
  5270  			"         │   └─ Eq\n" +
  5271  			"         │       ├─ t.id:18!null\n" +
  5272  			"         │       └─ mc.movie_id:8!null\n" +
  5273  			"         ├─ HashJoin\n" +
  5274  			"         │   ├─ Eq\n" +
  5275  			"         │   │   ├─ k.id:0!null\n" +
  5276  			"         │   │   └─ mk.keyword_id:17!null\n" +
  5277  			"         │   ├─ TableAlias(k)\n" +
  5278  			"         │   │   └─ ProcessTable\n" +
  5279  			"         │   │       └─ Table\n" +
  5280  			"         │   │           ├─ name: keyword\n" +
  5281  			"         │   │           └─ columns: [id]\n" +
  5282  			"         │   └─ HashLookup\n" +
  5283  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  5284  			"         │       ├─ right-key: TUPLE(mk.keyword_id:16!null)\n" +
  5285  			"         │       └─ HashJoin\n" +
  5286  			"         │           ├─ AND\n" +
  5287  			"         │           │   ├─ AND\n" +
  5288  			"         │           │   │   ├─ Eq\n" +
  5289  			"         │           │   │   │   ├─ mc.movie_id:8!null\n" +
  5290  			"         │           │   │   │   └─ at.movie_id:1!null\n" +
  5291  			"         │           │   │   └─ Eq\n" +
  5292  			"         │           │   │       ├─ mi.movie_id:2!null\n" +
  5293  			"         │           │   │       └─ at.movie_id:1!null\n" +
  5294  			"         │           │   └─ Eq\n" +
  5295  			"         │           │       ├─ mk.movie_id:16!null\n" +
  5296  			"         │           │       └─ at.movie_id:1!null\n" +
  5297  			"         │           ├─ TableAlias(at)\n" +
  5298  			"         │           │   └─ ProcessTable\n" +
  5299  			"         │           │       └─ Table\n" +
  5300  			"         │           │           ├─ name: aka_title\n" +
  5301  			"         │           │           └─ columns: [movie_id]\n" +
  5302  			"         │           └─ HashLookup\n" +
  5303  			"         │               ├─ left-key: TUPLE(at.movie_id:1!null, at.movie_id:1!null, at.movie_id:1!null)\n" +
  5304  			"         │               ├─ right-key: TUPLE(mc.movie_id:6!null, mi.movie_id:0!null, mk.movie_id:14!null)\n" +
  5305  			"         │               └─ LookupJoin\n" +
  5306  			"         │                   ├─ InnerJoin\n" +
  5307  			"         │                   │   ├─ Eq\n" +
  5308  			"         │                   │   │   ├─ mi.movie_id:2!null\n" +
  5309  			"         │                   │   │   └─ mc.movie_id:8!null\n" +
  5310  			"         │                   │   ├─ InnerJoin\n" +
  5311  			"         │                   │   │   ├─ Eq\n" +
  5312  			"         │                   │   │   │   ├─ it1.id:6!null\n" +
  5313  			"         │                   │   │   │   └─ mi.info_type_id:3!null\n" +
  5314  			"         │                   │   │   ├─ Filter\n" +
  5315  			"         │                   │   │   │   ├─ AND\n" +
  5316  			"         │                   │   │   │   │   ├─ mi.note LIKE '%internet%'\n" +
  5317  			"         │                   │   │   │   │   └─ mi.info LIKE 'USA:% 200%'\n" +
  5318  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5319  			"         │                   │   │   │       └─ ProcessTable\n" +
  5320  			"         │                   │   │   │           └─ Table\n" +
  5321  			"         │                   │   │   │               ├─ name: movie_info\n" +
  5322  			"         │                   │   │   │               └─ columns: [movie_id info_type_id info note]\n" +
  5323  			"         │                   │   │   └─ Filter\n" +
  5324  			"         │                   │   │       ├─ Eq\n" +
  5325  			"         │                   │   │       │   ├─ it1.info:1!null\n" +
  5326  			"         │                   │   │       │   └─ release dates (longtext)\n" +
  5327  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5328  			"         │                   │   │           └─ ProcessTable\n" +
  5329  			"         │                   │   │               └─ Table\n" +
  5330  			"         │                   │   │                   ├─ name: info_type\n" +
  5331  			"         │                   │   │                   └─ columns: [id info]\n" +
  5332  			"         │                   │   └─ InnerJoin\n" +
  5333  			"         │                   │       ├─ Eq\n" +
  5334  			"         │                   │       │   ├─ ct.id:15!null\n" +
  5335  			"         │                   │       │   └─ mc.company_type_id:10!null\n" +
  5336  			"         │                   │       ├─ InnerJoin\n" +
  5337  			"         │                   │       │   ├─ Eq\n" +
  5338  			"         │                   │       │   │   ├─ cn.id:12!null\n" +
  5339  			"         │                   │       │   │   └─ mc.company_id:9!null\n" +
  5340  			"         │                   │       │   ├─ Filter\n" +
  5341  			"         │                   │       │   │   ├─ AND\n" +
  5342  			"         │                   │       │   │   │   ├─ mc.note LIKE '%(200%)%'\n" +
  5343  			"         │                   │       │   │   │   └─ mc.note LIKE '%(worldwide)%'\n" +
  5344  			"         │                   │       │   │   └─ TableAlias(mc)\n" +
  5345  			"         │                   │       │   │       └─ ProcessTable\n" +
  5346  			"         │                   │       │   │           └─ Table\n" +
  5347  			"         │                   │       │   │               ├─ name: movie_companies\n" +
  5348  			"         │                   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
  5349  			"         │                   │       │   └─ Filter\n" +
  5350  			"         │                   │       │       ├─ AND\n" +
  5351  			"         │                   │       │       │   ├─ Eq\n" +
  5352  			"         │                   │       │       │   │   ├─ cn.country_code:2\n" +
  5353  			"         │                   │       │       │   │   └─ [us] (longtext)\n" +
  5354  			"         │                   │       │       │   └─ Eq\n" +
  5355  			"         │                   │       │       │       ├─ cn.name:1!null\n" +
  5356  			"         │                   │       │       │       └─ YouTube (longtext)\n" +
  5357  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5358  			"         │                   │       │           └─ ProcessTable\n" +
  5359  			"         │                   │       │               └─ Table\n" +
  5360  			"         │                   │       │                   ├─ name: company_name\n" +
  5361  			"         │                   │       │                   └─ columns: [id name country_code]\n" +
  5362  			"         │                   │       └─ TableAlias(ct)\n" +
  5363  			"         │                   │           └─ ProcessTable\n" +
  5364  			"         │                   │               └─ Table\n" +
  5365  			"         │                   │                   ├─ name: company_type\n" +
  5366  			"         │                   │                   └─ columns: [id]\n" +
  5367  			"         │                   └─ TableAlias(mk)\n" +
  5368  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5369  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5370  			"         │                           ├─ keys: [mi.movie_id:2!null]\n" +
  5371  			"         │                           ├─ colSet: (37-39)\n" +
  5372  			"         │                           ├─ tableId: 8\n" +
  5373  			"         │                           └─ Table\n" +
  5374  			"         │                               ├─ name: movie_keyword\n" +
  5375  			"         │                               └─ columns: [movie_id keyword_id]\n" +
  5376  			"         └─ HashLookup\n" +
  5377  			"             ├─ left-key: TUPLE(at.movie_id:1!null, mi.movie_id:2!null, mk.movie_id:16!null, mc.movie_id:8!null)\n" +
  5378  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  5379  			"             └─ Filter\n" +
  5380  			"                 ├─ AND\n" +
  5381  			"                 │   ├─ GreaterThanOrEqual\n" +
  5382  			"                 │   │   ├─ t.production_year:2\n" +
  5383  			"                 │   │   └─ 2005 (smallint)\n" +
  5384  			"                 │   └─ LessThanOrEqual\n" +
  5385  			"                 │       ├─ t.production_year:2\n" +
  5386  			"                 │       └─ 2010 (smallint)\n" +
  5387  			"                 └─ TableAlias(t)\n" +
  5388  			"                     └─ ProcessTable\n" +
  5389  			"                         └─ Table\n" +
  5390  			"                             ├─ name: title\n" +
  5391  			"                             └─ columns: [id title production_year]\n" +
  5392  			"",
  5393  		ExpectedEstimates: "Project\n" +
  5394  			" ├─ columns: [min(mi.info) as release_date, min(t.title) as youtube_movie]\n" +
  5395  			" └─ GroupBy\n" +
  5396  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  5397  			"     ├─ Grouping()\n" +
  5398  			"     └─ HashJoin\n" +
  5399  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  5400  			"         ├─ HashJoin\n" +
  5401  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  5402  			"         │   ├─ TableAlias(k)\n" +
  5403  			"         │   │   └─ Table\n" +
  5404  			"         │   │       ├─ name: keyword\n" +
  5405  			"         │   │       └─ columns: [id]\n" +
  5406  			"         │   └─ HashLookup\n" +
  5407  			"         │       ├─ left-key: (k.id)\n" +
  5408  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  5409  			"         │       └─ HashJoin\n" +
  5410  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  5411  			"         │           ├─ TableAlias(at)\n" +
  5412  			"         │           │   └─ Table\n" +
  5413  			"         │           │       ├─ name: aka_title\n" +
  5414  			"         │           │       └─ columns: [movie_id]\n" +
  5415  			"         │           └─ HashLookup\n" +
  5416  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  5417  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  5418  			"         │               └─ LookupJoin\n" +
  5419  			"         │                   ├─ InnerJoin\n" +
  5420  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  5421  			"         │                   │   ├─ InnerJoin\n" +
  5422  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  5423  			"         │                   │   │   ├─ Filter\n" +
  5424  			"         │                   │   │   │   ├─ (mi.note LIKE '%internet%' AND mi.info LIKE 'USA:% 200%')\n" +
  5425  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5426  			"         │                   │   │   │       └─ Table\n" +
  5427  			"         │                   │   │   │           ├─ name: movie_info\n" +
  5428  			"         │                   │   │   │           └─ columns: [movie_id info_type_id info note]\n" +
  5429  			"         │                   │   │   └─ Filter\n" +
  5430  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  5431  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5432  			"         │                   │   │           └─ Table\n" +
  5433  			"         │                   │   │               ├─ name: info_type\n" +
  5434  			"         │                   │   │               └─ columns: [id info]\n" +
  5435  			"         │                   │   └─ InnerJoin\n" +
  5436  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  5437  			"         │                   │       ├─ InnerJoin\n" +
  5438  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  5439  			"         │                   │       │   ├─ Filter\n" +
  5440  			"         │                   │       │   │   ├─ (mc.note LIKE '%(200%)%' AND mc.note LIKE '%(worldwide)%')\n" +
  5441  			"         │                   │       │   │   └─ TableAlias(mc)\n" +
  5442  			"         │                   │       │   │       └─ Table\n" +
  5443  			"         │                   │       │   │           ├─ name: movie_companies\n" +
  5444  			"         │                   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  5445  			"         │                   │       │   └─ Filter\n" +
  5446  			"         │                   │       │       ├─ ((cn.country_code = '[us]') AND (cn.name = 'YouTube'))\n" +
  5447  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5448  			"         │                   │       │           └─ Table\n" +
  5449  			"         │                   │       │               ├─ name: company_name\n" +
  5450  			"         │                   │       │               └─ columns: [id name country_code]\n" +
  5451  			"         │                   │       └─ TableAlias(ct)\n" +
  5452  			"         │                   │           └─ Table\n" +
  5453  			"         │                   │               ├─ name: company_type\n" +
  5454  			"         │                   │               └─ columns: [id]\n" +
  5455  			"         │                   └─ TableAlias(mk)\n" +
  5456  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5457  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5458  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  5459  			"         │                           └─ keys: mi.movie_id\n" +
  5460  			"         └─ HashLookup\n" +
  5461  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  5462  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  5463  			"             └─ Filter\n" +
  5464  			"                 ├─ ((t.production_year >= 2005) AND (t.production_year <= 2010))\n" +
  5465  			"                 └─ TableAlias(t)\n" +
  5466  			"                     └─ Table\n" +
  5467  			"                         ├─ name: title\n" +
  5468  			"                         └─ columns: [id title production_year]\n" +
  5469  			"",
  5470  		ExpectedAnalysis: "Project\n" +
  5471  			" ├─ columns: [min(mi.info) as release_date, min(t.title) as youtube_movie]\n" +
  5472  			" └─ GroupBy\n" +
  5473  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  5474  			"     ├─ Grouping()\n" +
  5475  			"     └─ HashJoin\n" +
  5476  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  5477  			"         ├─ HashJoin\n" +
  5478  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  5479  			"         │   ├─ TableAlias(k)\n" +
  5480  			"         │   │   └─ Table\n" +
  5481  			"         │   │       ├─ name: keyword\n" +
  5482  			"         │   │       └─ columns: [id]\n" +
  5483  			"         │   └─ HashLookup\n" +
  5484  			"         │       ├─ left-key: (k.id)\n" +
  5485  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  5486  			"         │       └─ HashJoin\n" +
  5487  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  5488  			"         │           ├─ TableAlias(at)\n" +
  5489  			"         │           │   └─ Table\n" +
  5490  			"         │           │       ├─ name: aka_title\n" +
  5491  			"         │           │       └─ columns: [movie_id]\n" +
  5492  			"         │           └─ HashLookup\n" +
  5493  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  5494  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  5495  			"         │               └─ LookupJoin\n" +
  5496  			"         │                   ├─ InnerJoin\n" +
  5497  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  5498  			"         │                   │   ├─ InnerJoin\n" +
  5499  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  5500  			"         │                   │   │   ├─ Filter\n" +
  5501  			"         │                   │   │   │   ├─ (mi.note LIKE '%internet%' AND mi.info LIKE 'USA:% 200%')\n" +
  5502  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5503  			"         │                   │   │   │       └─ Table\n" +
  5504  			"         │                   │   │   │           ├─ name: movie_info\n" +
  5505  			"         │                   │   │   │           └─ columns: [movie_id info_type_id info note]\n" +
  5506  			"         │                   │   │   └─ Filter\n" +
  5507  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  5508  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5509  			"         │                   │   │           └─ Table\n" +
  5510  			"         │                   │   │               ├─ name: info_type\n" +
  5511  			"         │                   │   │               └─ columns: [id info]\n" +
  5512  			"         │                   │   └─ InnerJoin\n" +
  5513  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  5514  			"         │                   │       ├─ InnerJoin\n" +
  5515  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  5516  			"         │                   │       │   ├─ Filter\n" +
  5517  			"         │                   │       │   │   ├─ (mc.note LIKE '%(200%)%' AND mc.note LIKE '%(worldwide)%')\n" +
  5518  			"         │                   │       │   │   └─ TableAlias(mc)\n" +
  5519  			"         │                   │       │   │       └─ Table\n" +
  5520  			"         │                   │       │   │           ├─ name: movie_companies\n" +
  5521  			"         │                   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
  5522  			"         │                   │       │   └─ Filter\n" +
  5523  			"         │                   │       │       ├─ ((cn.country_code = '[us]') AND (cn.name = 'YouTube'))\n" +
  5524  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5525  			"         │                   │       │           └─ Table\n" +
  5526  			"         │                   │       │               ├─ name: company_name\n" +
  5527  			"         │                   │       │               └─ columns: [id name country_code]\n" +
  5528  			"         │                   │       └─ TableAlias(ct)\n" +
  5529  			"         │                   │           └─ Table\n" +
  5530  			"         │                   │               ├─ name: company_type\n" +
  5531  			"         │                   │               └─ columns: [id]\n" +
  5532  			"         │                   └─ TableAlias(mk)\n" +
  5533  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5534  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5535  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  5536  			"         │                           └─ keys: mi.movie_id\n" +
  5537  			"         └─ HashLookup\n" +
  5538  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  5539  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  5540  			"             └─ Filter\n" +
  5541  			"                 ├─ ((t.production_year >= 2005) AND (t.production_year <= 2010))\n" +
  5542  			"                 └─ TableAlias(t)\n" +
  5543  			"                     └─ Table\n" +
  5544  			"                         ├─ name: title\n" +
  5545  			"                         └─ columns: [id title production_year]\n" +
  5546  			"",
  5547  	},
  5548  	{
  5549  		Query: `
  5550  SELECT MIN(mi.info) AS release_date,
  5551         MIN(t.title) AS modern_american_internet_movie
  5552  FROM aka_title AS at,
  5553       company_name AS cn,
  5554       company_type AS ct,
  5555       info_type AS it1,
  5556       keyword AS k,
  5557       movie_companies AS mc,
  5558       movie_info AS mi,
  5559       movie_keyword AS mk,
  5560       title AS t
  5561  WHERE cn.country_code = '[us]'
  5562    AND it1.info = 'release dates'
  5563    AND mi.note LIKE '%internet%'
  5564    AND mi.info IS NOT NULL
  5565    AND (mi.info LIKE 'USA:% 199%'
  5566         OR mi.info LIKE 'USA:% 200%')
  5567    AND t.production_year > 1990
  5568    AND t.id = at.movie_id
  5569    AND t.id = mi.movie_id
  5570    AND t.id = mk.movie_id
  5571    AND t.id = mc.movie_id
  5572    AND mk.movie_id = mi.movie_id
  5573    AND mk.movie_id = mc.movie_id
  5574    AND mk.movie_id = at.movie_id
  5575    AND mi.movie_id = mc.movie_id
  5576    AND mi.movie_id = at.movie_id
  5577    AND mc.movie_id = at.movie_id
  5578    AND k.id = mk.keyword_id
  5579    AND it1.id = mi.info_type_id
  5580    AND cn.id = mc.company_id
  5581    AND ct.id = mc.company_type_id;
  5582  
  5583  `,
  5584  		ExpectedPlan: "Project\n" +
  5585  			" ├─ columns: [min(mi.info):0!null as release_date, min(t.title):1!null as modern_american_internet_movie]\n" +
  5586  			" └─ GroupBy\n" +
  5587  			"     ├─ select: MIN(mi.info:4!null), MIN(t.title:17!null)\n" +
  5588  			"     ├─ group: \n" +
  5589  			"     └─ HashJoin\n" +
  5590  			"         ├─ AND\n" +
  5591  			"         │   ├─ AND\n" +
  5592  			"         │   │   ├─ AND\n" +
  5593  			"         │   │   │   ├─ Eq\n" +
  5594  			"         │   │   │   │   ├─ t.id:16!null\n" +
  5595  			"         │   │   │   │   └─ at.movie_id:1!null\n" +
  5596  			"         │   │   │   └─ Eq\n" +
  5597  			"         │   │   │       ├─ t.id:16!null\n" +
  5598  			"         │   │   │       └─ mi.movie_id:2!null\n" +
  5599  			"         │   │   └─ Eq\n" +
  5600  			"         │   │       ├─ t.id:16!null\n" +
  5601  			"         │   │       └─ mk.movie_id:14!null\n" +
  5602  			"         │   └─ Eq\n" +
  5603  			"         │       ├─ t.id:16!null\n" +
  5604  			"         │       └─ mc.movie_id:8!null\n" +
  5605  			"         ├─ HashJoin\n" +
  5606  			"         │   ├─ Eq\n" +
  5607  			"         │   │   ├─ k.id:0!null\n" +
  5608  			"         │   │   └─ mk.keyword_id:15!null\n" +
  5609  			"         │   ├─ TableAlias(k)\n" +
  5610  			"         │   │   └─ ProcessTable\n" +
  5611  			"         │   │       └─ Table\n" +
  5612  			"         │   │           ├─ name: keyword\n" +
  5613  			"         │   │           └─ columns: [id]\n" +
  5614  			"         │   └─ HashLookup\n" +
  5615  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  5616  			"         │       ├─ right-key: TUPLE(mk.keyword_id:14!null)\n" +
  5617  			"         │       └─ HashJoin\n" +
  5618  			"         │           ├─ AND\n" +
  5619  			"         │           │   ├─ AND\n" +
  5620  			"         │           │   │   ├─ Eq\n" +
  5621  			"         │           │   │   │   ├─ mc.movie_id:8!null\n" +
  5622  			"         │           │   │   │   └─ at.movie_id:1!null\n" +
  5623  			"         │           │   │   └─ Eq\n" +
  5624  			"         │           │   │       ├─ mi.movie_id:2!null\n" +
  5625  			"         │           │   │       └─ at.movie_id:1!null\n" +
  5626  			"         │           │   └─ Eq\n" +
  5627  			"         │           │       ├─ mk.movie_id:14!null\n" +
  5628  			"         │           │       └─ at.movie_id:1!null\n" +
  5629  			"         │           ├─ TableAlias(at)\n" +
  5630  			"         │           │   └─ ProcessTable\n" +
  5631  			"         │           │       └─ Table\n" +
  5632  			"         │           │           ├─ name: aka_title\n" +
  5633  			"         │           │           └─ columns: [movie_id]\n" +
  5634  			"         │           └─ HashLookup\n" +
  5635  			"         │               ├─ left-key: TUPLE(at.movie_id:1!null, at.movie_id:1!null, at.movie_id:1!null)\n" +
  5636  			"         │               ├─ right-key: TUPLE(mc.movie_id:6!null, mi.movie_id:0!null, mk.movie_id:12!null)\n" +
  5637  			"         │               └─ LookupJoin\n" +
  5638  			"         │                   ├─ InnerJoin\n" +
  5639  			"         │                   │   ├─ Eq\n" +
  5640  			"         │                   │   │   ├─ mi.movie_id:2!null\n" +
  5641  			"         │                   │   │   └─ mc.movie_id:8!null\n" +
  5642  			"         │                   │   ├─ InnerJoin\n" +
  5643  			"         │                   │   │   ├─ Eq\n" +
  5644  			"         │                   │   │   │   ├─ it1.id:6!null\n" +
  5645  			"         │                   │   │   │   └─ mi.info_type_id:3!null\n" +
  5646  			"         │                   │   │   ├─ Filter\n" +
  5647  			"         │                   │   │   │   ├─ AND\n" +
  5648  			"         │                   │   │   │   │   ├─ AND\n" +
  5649  			"         │                   │   │   │   │   │   ├─ mi.note LIKE '%internet%'\n" +
  5650  			"         │                   │   │   │   │   │   └─ NOT\n" +
  5651  			"         │                   │   │   │   │   │       └─ mi.info:2!null IS NULL\n" +
  5652  			"         │                   │   │   │   │   └─ Or\n" +
  5653  			"         │                   │   │   │   │       ├─ mi.info LIKE 'USA:% 199%'\n" +
  5654  			"         │                   │   │   │   │       └─ mi.info LIKE 'USA:% 200%'\n" +
  5655  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5656  			"         │                   │   │   │       └─ ProcessTable\n" +
  5657  			"         │                   │   │   │           └─ Table\n" +
  5658  			"         │                   │   │   │               ├─ name: movie_info\n" +
  5659  			"         │                   │   │   │               └─ columns: [movie_id info_type_id info note]\n" +
  5660  			"         │                   │   │   └─ Filter\n" +
  5661  			"         │                   │   │       ├─ Eq\n" +
  5662  			"         │                   │   │       │   ├─ it1.info:1!null\n" +
  5663  			"         │                   │   │       │   └─ release dates (longtext)\n" +
  5664  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5665  			"         │                   │   │           └─ ProcessTable\n" +
  5666  			"         │                   │   │               └─ Table\n" +
  5667  			"         │                   │   │                   ├─ name: info_type\n" +
  5668  			"         │                   │   │                   └─ columns: [id info]\n" +
  5669  			"         │                   │   └─ InnerJoin\n" +
  5670  			"         │                   │       ├─ Eq\n" +
  5671  			"         │                   │       │   ├─ ct.id:13!null\n" +
  5672  			"         │                   │       │   └─ mc.company_type_id:10!null\n" +
  5673  			"         │                   │       ├─ InnerJoin\n" +
  5674  			"         │                   │       │   ├─ Eq\n" +
  5675  			"         │                   │       │   │   ├─ cn.id:11!null\n" +
  5676  			"         │                   │       │   │   └─ mc.company_id:9!null\n" +
  5677  			"         │                   │       │   ├─ TableAlias(mc)\n" +
  5678  			"         │                   │       │   │   └─ ProcessTable\n" +
  5679  			"         │                   │       │   │       └─ Table\n" +
  5680  			"         │                   │       │   │           ├─ name: movie_companies\n" +
  5681  			"         │                   │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  5682  			"         │                   │       │   └─ Filter\n" +
  5683  			"         │                   │       │       ├─ Eq\n" +
  5684  			"         │                   │       │       │   ├─ cn.country_code:1\n" +
  5685  			"         │                   │       │       │   └─ [us] (longtext)\n" +
  5686  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5687  			"         │                   │       │           └─ ProcessTable\n" +
  5688  			"         │                   │       │               └─ Table\n" +
  5689  			"         │                   │       │                   ├─ name: company_name\n" +
  5690  			"         │                   │       │                   └─ columns: [id country_code]\n" +
  5691  			"         │                   │       └─ TableAlias(ct)\n" +
  5692  			"         │                   │           └─ ProcessTable\n" +
  5693  			"         │                   │               └─ Table\n" +
  5694  			"         │                   │                   ├─ name: company_type\n" +
  5695  			"         │                   │                   └─ columns: [id]\n" +
  5696  			"         │                   └─ TableAlias(mk)\n" +
  5697  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5698  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5699  			"         │                           ├─ keys: [mi.movie_id:2!null]\n" +
  5700  			"         │                           ├─ colSet: (37-39)\n" +
  5701  			"         │                           ├─ tableId: 8\n" +
  5702  			"         │                           └─ Table\n" +
  5703  			"         │                               ├─ name: movie_keyword\n" +
  5704  			"         │                               └─ columns: [movie_id keyword_id]\n" +
  5705  			"         └─ HashLookup\n" +
  5706  			"             ├─ left-key: TUPLE(at.movie_id:1!null, mi.movie_id:2!null, mk.movie_id:14!null, mc.movie_id:8!null)\n" +
  5707  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  5708  			"             └─ Filter\n" +
  5709  			"                 ├─ GreaterThan\n" +
  5710  			"                 │   ├─ t.production_year:2\n" +
  5711  			"                 │   └─ 1990 (smallint)\n" +
  5712  			"                 └─ TableAlias(t)\n" +
  5713  			"                     └─ ProcessTable\n" +
  5714  			"                         └─ Table\n" +
  5715  			"                             ├─ name: title\n" +
  5716  			"                             └─ columns: [id title production_year]\n" +
  5717  			"",
  5718  		ExpectedEstimates: "Project\n" +
  5719  			" ├─ columns: [min(mi.info) as release_date, min(t.title) as modern_american_internet_movie]\n" +
  5720  			" └─ GroupBy\n" +
  5721  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  5722  			"     ├─ Grouping()\n" +
  5723  			"     └─ HashJoin\n" +
  5724  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  5725  			"         ├─ HashJoin\n" +
  5726  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  5727  			"         │   ├─ TableAlias(k)\n" +
  5728  			"         │   │   └─ Table\n" +
  5729  			"         │   │       ├─ name: keyword\n" +
  5730  			"         │   │       └─ columns: [id]\n" +
  5731  			"         │   └─ HashLookup\n" +
  5732  			"         │       ├─ left-key: (k.id)\n" +
  5733  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  5734  			"         │       └─ HashJoin\n" +
  5735  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  5736  			"         │           ├─ TableAlias(at)\n" +
  5737  			"         │           │   └─ Table\n" +
  5738  			"         │           │       ├─ name: aka_title\n" +
  5739  			"         │           │       └─ columns: [movie_id]\n" +
  5740  			"         │           └─ HashLookup\n" +
  5741  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  5742  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  5743  			"         │               └─ LookupJoin\n" +
  5744  			"         │                   ├─ InnerJoin\n" +
  5745  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  5746  			"         │                   │   ├─ InnerJoin\n" +
  5747  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  5748  			"         │                   │   │   ├─ Filter\n" +
  5749  			"         │                   │   │   │   ├─ ((mi.note LIKE '%internet%' AND (NOT(mi.info IS NULL))) AND (mi.info LIKE 'USA:% 199%' OR mi.info LIKE 'USA:% 200%'))\n" +
  5750  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5751  			"         │                   │   │   │       └─ Table\n" +
  5752  			"         │                   │   │   │           ├─ name: movie_info\n" +
  5753  			"         │                   │   │   │           └─ columns: [movie_id info_type_id info note]\n" +
  5754  			"         │                   │   │   └─ Filter\n" +
  5755  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  5756  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5757  			"         │                   │   │           └─ Table\n" +
  5758  			"         │                   │   │               ├─ name: info_type\n" +
  5759  			"         │                   │   │               └─ columns: [id info]\n" +
  5760  			"         │                   │   └─ InnerJoin\n" +
  5761  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  5762  			"         │                   │       ├─ InnerJoin\n" +
  5763  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  5764  			"         │                   │       │   ├─ TableAlias(mc)\n" +
  5765  			"         │                   │       │   │   └─ Table\n" +
  5766  			"         │                   │       │   │       ├─ name: movie_companies\n" +
  5767  			"         │                   │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  5768  			"         │                   │       │   └─ Filter\n" +
  5769  			"         │                   │       │       ├─ (cn.country_code = '[us]')\n" +
  5770  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5771  			"         │                   │       │           └─ Table\n" +
  5772  			"         │                   │       │               ├─ name: company_name\n" +
  5773  			"         │                   │       │               └─ columns: [id country_code]\n" +
  5774  			"         │                   │       └─ TableAlias(ct)\n" +
  5775  			"         │                   │           └─ Table\n" +
  5776  			"         │                   │               ├─ name: company_type\n" +
  5777  			"         │                   │               └─ columns: [id]\n" +
  5778  			"         │                   └─ TableAlias(mk)\n" +
  5779  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5780  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5781  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  5782  			"         │                           └─ keys: mi.movie_id\n" +
  5783  			"         └─ HashLookup\n" +
  5784  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  5785  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  5786  			"             └─ Filter\n" +
  5787  			"                 ├─ (t.production_year > 1990)\n" +
  5788  			"                 └─ TableAlias(t)\n" +
  5789  			"                     └─ Table\n" +
  5790  			"                         ├─ name: title\n" +
  5791  			"                         └─ columns: [id title production_year]\n" +
  5792  			"",
  5793  		ExpectedAnalysis: "Project\n" +
  5794  			" ├─ columns: [min(mi.info) as release_date, min(t.title) as modern_american_internet_movie]\n" +
  5795  			" └─ GroupBy\n" +
  5796  			"     ├─ SelectedExprs(MIN(mi.info), MIN(t.title))\n" +
  5797  			"     ├─ Grouping()\n" +
  5798  			"     └─ HashJoin\n" +
  5799  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  5800  			"         ├─ HashJoin\n" +
  5801  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  5802  			"         │   ├─ TableAlias(k)\n" +
  5803  			"         │   │   └─ Table\n" +
  5804  			"         │   │       ├─ name: keyword\n" +
  5805  			"         │   │       └─ columns: [id]\n" +
  5806  			"         │   └─ HashLookup\n" +
  5807  			"         │       ├─ left-key: (k.id)\n" +
  5808  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  5809  			"         │       └─ HashJoin\n" +
  5810  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  5811  			"         │           ├─ TableAlias(at)\n" +
  5812  			"         │           │   └─ Table\n" +
  5813  			"         │           │       ├─ name: aka_title\n" +
  5814  			"         │           │       └─ columns: [movie_id]\n" +
  5815  			"         │           └─ HashLookup\n" +
  5816  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  5817  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  5818  			"         │               └─ LookupJoin\n" +
  5819  			"         │                   ├─ InnerJoin\n" +
  5820  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  5821  			"         │                   │   ├─ InnerJoin\n" +
  5822  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  5823  			"         │                   │   │   ├─ Filter\n" +
  5824  			"         │                   │   │   │   ├─ ((mi.note LIKE '%internet%' AND (NOT(mi.info IS NULL))) AND (mi.info LIKE 'USA:% 199%' OR mi.info LIKE 'USA:% 200%'))\n" +
  5825  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5826  			"         │                   │   │   │       └─ Table\n" +
  5827  			"         │                   │   │   │           ├─ name: movie_info\n" +
  5828  			"         │                   │   │   │           └─ columns: [movie_id info_type_id info note]\n" +
  5829  			"         │                   │   │   └─ Filter\n" +
  5830  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  5831  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5832  			"         │                   │   │           └─ Table\n" +
  5833  			"         │                   │   │               ├─ name: info_type\n" +
  5834  			"         │                   │   │               └─ columns: [id info]\n" +
  5835  			"         │                   │   └─ InnerJoin\n" +
  5836  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  5837  			"         │                   │       ├─ InnerJoin\n" +
  5838  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  5839  			"         │                   │       │   ├─ TableAlias(mc)\n" +
  5840  			"         │                   │       │   │   └─ Table\n" +
  5841  			"         │                   │       │   │       ├─ name: movie_companies\n" +
  5842  			"         │                   │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  5843  			"         │                   │       │   └─ Filter\n" +
  5844  			"         │                   │       │       ├─ (cn.country_code = '[us]')\n" +
  5845  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5846  			"         │                   │       │           └─ Table\n" +
  5847  			"         │                   │       │               ├─ name: company_name\n" +
  5848  			"         │                   │       │               └─ columns: [id country_code]\n" +
  5849  			"         │                   │       └─ TableAlias(ct)\n" +
  5850  			"         │                   │           └─ Table\n" +
  5851  			"         │                   │               ├─ name: company_type\n" +
  5852  			"         │                   │               └─ columns: [id]\n" +
  5853  			"         │                   └─ TableAlias(mk)\n" +
  5854  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  5855  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  5856  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  5857  			"         │                           └─ keys: mi.movie_id\n" +
  5858  			"         └─ HashLookup\n" +
  5859  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  5860  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  5861  			"             └─ Filter\n" +
  5862  			"                 ├─ (t.production_year > 1990)\n" +
  5863  			"                 └─ TableAlias(t)\n" +
  5864  			"                     └─ Table\n" +
  5865  			"                         ├─ name: title\n" +
  5866  			"                         └─ columns: [id title production_year]\n" +
  5867  			"",
  5868  	},
  5869  	{
  5870  		Query: `
  5871  SELECT MIN(at.title) AS aka_title,
  5872         MIN(t.title) AS internet_movie_title
  5873  FROM aka_title AS at,
  5874       company_name AS cn,
  5875       company_type AS ct,
  5876       info_type AS it1,
  5877       keyword AS k,
  5878       movie_companies AS mc,
  5879       movie_info AS mi,
  5880       movie_keyword AS mk,
  5881       title AS t
  5882  WHERE cn.country_code = '[us]'
  5883    AND it1.info = 'release dates'
  5884    AND mi.note LIKE '%internet%'
  5885    AND t.production_year > 1990
  5886    AND t.id = at.movie_id
  5887    AND t.id = mi.movie_id
  5888    AND t.id = mk.movie_id
  5889    AND t.id = mc.movie_id
  5890    AND mk.movie_id = mi.movie_id
  5891    AND mk.movie_id = mc.movie_id
  5892    AND mk.movie_id = at.movie_id
  5893    AND mi.movie_id = mc.movie_id
  5894    AND mi.movie_id = at.movie_id
  5895    AND mc.movie_id = at.movie_id
  5896    AND k.id = mk.keyword_id
  5897    AND it1.id = mi.info_type_id
  5898    AND cn.id = mc.company_id
  5899    AND ct.id = mc.company_type_id;
  5900  
  5901  `,
  5902  		ExpectedPlan: "Project\n" +
  5903  			" ├─ columns: [min(at.title):0!null as aka_title, min(t.title):1!null as internet_movie_title]\n" +
  5904  			" └─ GroupBy\n" +
  5905  			"     ├─ select: MIN(at.title:2!null), MIN(t.title:17!null)\n" +
  5906  			"     ├─ group: \n" +
  5907  			"     └─ HashJoin\n" +
  5908  			"         ├─ AND\n" +
  5909  			"         │   ├─ AND\n" +
  5910  			"         │   │   ├─ AND\n" +
  5911  			"         │   │   │   ├─ Eq\n" +
  5912  			"         │   │   │   │   ├─ t.id:16!null\n" +
  5913  			"         │   │   │   │   └─ at.movie_id:1!null\n" +
  5914  			"         │   │   │   └─ Eq\n" +
  5915  			"         │   │   │       ├─ t.id:16!null\n" +
  5916  			"         │   │   │       └─ mi.movie_id:3!null\n" +
  5917  			"         │   │   └─ Eq\n" +
  5918  			"         │   │       ├─ t.id:16!null\n" +
  5919  			"         │   │       └─ mk.movie_id:14!null\n" +
  5920  			"         │   └─ Eq\n" +
  5921  			"         │       ├─ t.id:16!null\n" +
  5922  			"         │       └─ mc.movie_id:8!null\n" +
  5923  			"         ├─ HashJoin\n" +
  5924  			"         │   ├─ Eq\n" +
  5925  			"         │   │   ├─ k.id:0!null\n" +
  5926  			"         │   │   └─ mk.keyword_id:15!null\n" +
  5927  			"         │   ├─ TableAlias(k)\n" +
  5928  			"         │   │   └─ ProcessTable\n" +
  5929  			"         │   │       └─ Table\n" +
  5930  			"         │   │           ├─ name: keyword\n" +
  5931  			"         │   │           └─ columns: [id]\n" +
  5932  			"         │   └─ HashLookup\n" +
  5933  			"         │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  5934  			"         │       ├─ right-key: TUPLE(mk.keyword_id:14!null)\n" +
  5935  			"         │       └─ HashJoin\n" +
  5936  			"         │           ├─ AND\n" +
  5937  			"         │           │   ├─ AND\n" +
  5938  			"         │           │   │   ├─ Eq\n" +
  5939  			"         │           │   │   │   ├─ mc.movie_id:8!null\n" +
  5940  			"         │           │   │   │   └─ at.movie_id:1!null\n" +
  5941  			"         │           │   │   └─ Eq\n" +
  5942  			"         │           │   │       ├─ mi.movie_id:3!null\n" +
  5943  			"         │           │   │       └─ at.movie_id:1!null\n" +
  5944  			"         │           │   └─ Eq\n" +
  5945  			"         │           │       ├─ mk.movie_id:14!null\n" +
  5946  			"         │           │       └─ at.movie_id:1!null\n" +
  5947  			"         │           ├─ TableAlias(at)\n" +
  5948  			"         │           │   └─ ProcessTable\n" +
  5949  			"         │           │       └─ Table\n" +
  5950  			"         │           │           ├─ name: aka_title\n" +
  5951  			"         │           │           └─ columns: [movie_id title]\n" +
  5952  			"         │           └─ HashLookup\n" +
  5953  			"         │               ├─ left-key: TUPLE(at.movie_id:1!null, at.movie_id:1!null, at.movie_id:1!null)\n" +
  5954  			"         │               ├─ right-key: TUPLE(mc.movie_id:5!null, mi.movie_id:0!null, mk.movie_id:11!null)\n" +
  5955  			"         │               └─ LookupJoin\n" +
  5956  			"         │                   ├─ InnerJoin\n" +
  5957  			"         │                   │   ├─ Eq\n" +
  5958  			"         │                   │   │   ├─ mi.movie_id:3!null\n" +
  5959  			"         │                   │   │   └─ mc.movie_id:8!null\n" +
  5960  			"         │                   │   ├─ InnerJoin\n" +
  5961  			"         │                   │   │   ├─ Eq\n" +
  5962  			"         │                   │   │   │   ├─ it1.id:6!null\n" +
  5963  			"         │                   │   │   │   └─ mi.info_type_id:4!null\n" +
  5964  			"         │                   │   │   ├─ Filter\n" +
  5965  			"         │                   │   │   │   ├─ mi.note LIKE '%internet%'\n" +
  5966  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  5967  			"         │                   │   │   │       └─ ProcessTable\n" +
  5968  			"         │                   │   │   │           └─ Table\n" +
  5969  			"         │                   │   │   │               ├─ name: movie_info\n" +
  5970  			"         │                   │   │   │               └─ columns: [movie_id info_type_id note]\n" +
  5971  			"         │                   │   │   └─ Filter\n" +
  5972  			"         │                   │   │       ├─ Eq\n" +
  5973  			"         │                   │   │       │   ├─ it1.info:1!null\n" +
  5974  			"         │                   │   │       │   └─ release dates (longtext)\n" +
  5975  			"         │                   │   │       └─ TableAlias(it1)\n" +
  5976  			"         │                   │   │           └─ ProcessTable\n" +
  5977  			"         │                   │   │               └─ Table\n" +
  5978  			"         │                   │   │                   ├─ name: info_type\n" +
  5979  			"         │                   │   │                   └─ columns: [id info]\n" +
  5980  			"         │                   │   └─ InnerJoin\n" +
  5981  			"         │                   │       ├─ Eq\n" +
  5982  			"         │                   │       │   ├─ ct.id:13!null\n" +
  5983  			"         │                   │       │   └─ mc.company_type_id:10!null\n" +
  5984  			"         │                   │       ├─ InnerJoin\n" +
  5985  			"         │                   │       │   ├─ Eq\n" +
  5986  			"         │                   │       │   │   ├─ cn.id:11!null\n" +
  5987  			"         │                   │       │   │   └─ mc.company_id:9!null\n" +
  5988  			"         │                   │       │   ├─ TableAlias(mc)\n" +
  5989  			"         │                   │       │   │   └─ ProcessTable\n" +
  5990  			"         │                   │       │   │       └─ Table\n" +
  5991  			"         │                   │       │   │           ├─ name: movie_companies\n" +
  5992  			"         │                   │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
  5993  			"         │                   │       │   └─ Filter\n" +
  5994  			"         │                   │       │       ├─ Eq\n" +
  5995  			"         │                   │       │       │   ├─ cn.country_code:1\n" +
  5996  			"         │                   │       │       │   └─ [us] (longtext)\n" +
  5997  			"         │                   │       │       └─ TableAlias(cn)\n" +
  5998  			"         │                   │       │           └─ ProcessTable\n" +
  5999  			"         │                   │       │               └─ Table\n" +
  6000  			"         │                   │       │                   ├─ name: company_name\n" +
  6001  			"         │                   │       │                   └─ columns: [id country_code]\n" +
  6002  			"         │                   │       └─ TableAlias(ct)\n" +
  6003  			"         │                   │           └─ ProcessTable\n" +
  6004  			"         │                   │               └─ Table\n" +
  6005  			"         │                   │                   ├─ name: company_type\n" +
  6006  			"         │                   │                   └─ columns: [id]\n" +
  6007  			"         │                   └─ TableAlias(mk)\n" +
  6008  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  6009  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  6010  			"         │                           ├─ keys: [mi.movie_id:3!null]\n" +
  6011  			"         │                           ├─ colSet: (37-39)\n" +
  6012  			"         │                           ├─ tableId: 8\n" +
  6013  			"         │                           └─ Table\n" +
  6014  			"         │                               ├─ name: movie_keyword\n" +
  6015  			"         │                               └─ columns: [movie_id keyword_id]\n" +
  6016  			"         └─ HashLookup\n" +
  6017  			"             ├─ left-key: TUPLE(at.movie_id:1!null, mi.movie_id:3!null, mk.movie_id:14!null, mc.movie_id:8!null)\n" +
  6018  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  6019  			"             └─ Filter\n" +
  6020  			"                 ├─ GreaterThan\n" +
  6021  			"                 │   ├─ t.production_year:2\n" +
  6022  			"                 │   └─ 1990 (smallint)\n" +
  6023  			"                 └─ TableAlias(t)\n" +
  6024  			"                     └─ ProcessTable\n" +
  6025  			"                         └─ Table\n" +
  6026  			"                             ├─ name: title\n" +
  6027  			"                             └─ columns: [id title production_year]\n" +
  6028  			"",
  6029  		ExpectedEstimates: "Project\n" +
  6030  			" ├─ columns: [min(at.title) as aka_title, min(t.title) as internet_movie_title]\n" +
  6031  			" └─ GroupBy\n" +
  6032  			"     ├─ SelectedExprs(MIN(at.title), MIN(t.title))\n" +
  6033  			"     ├─ Grouping()\n" +
  6034  			"     └─ HashJoin\n" +
  6035  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6036  			"         ├─ HashJoin\n" +
  6037  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  6038  			"         │   ├─ TableAlias(k)\n" +
  6039  			"         │   │   └─ Table\n" +
  6040  			"         │   │       ├─ name: keyword\n" +
  6041  			"         │   │       └─ columns: [id]\n" +
  6042  			"         │   └─ HashLookup\n" +
  6043  			"         │       ├─ left-key: (k.id)\n" +
  6044  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  6045  			"         │       └─ HashJoin\n" +
  6046  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  6047  			"         │           ├─ TableAlias(at)\n" +
  6048  			"         │           │   └─ Table\n" +
  6049  			"         │           │       ├─ name: aka_title\n" +
  6050  			"         │           │       └─ columns: [movie_id title]\n" +
  6051  			"         │           └─ HashLookup\n" +
  6052  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  6053  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  6054  			"         │               └─ LookupJoin\n" +
  6055  			"         │                   ├─ InnerJoin\n" +
  6056  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  6057  			"         │                   │   ├─ InnerJoin\n" +
  6058  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  6059  			"         │                   │   │   ├─ Filter\n" +
  6060  			"         │                   │   │   │   ├─ mi.note LIKE '%internet%'\n" +
  6061  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  6062  			"         │                   │   │   │       └─ Table\n" +
  6063  			"         │                   │   │   │           ├─ name: movie_info\n" +
  6064  			"         │                   │   │   │           └─ columns: [movie_id info_type_id note]\n" +
  6065  			"         │                   │   │   └─ Filter\n" +
  6066  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  6067  			"         │                   │   │       └─ TableAlias(it1)\n" +
  6068  			"         │                   │   │           └─ Table\n" +
  6069  			"         │                   │   │               ├─ name: info_type\n" +
  6070  			"         │                   │   │               └─ columns: [id info]\n" +
  6071  			"         │                   │   └─ InnerJoin\n" +
  6072  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  6073  			"         │                   │       ├─ InnerJoin\n" +
  6074  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  6075  			"         │                   │       │   ├─ TableAlias(mc)\n" +
  6076  			"         │                   │       │   │   └─ Table\n" +
  6077  			"         │                   │       │   │       ├─ name: movie_companies\n" +
  6078  			"         │                   │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  6079  			"         │                   │       │   └─ Filter\n" +
  6080  			"         │                   │       │       ├─ (cn.country_code = '[us]')\n" +
  6081  			"         │                   │       │       └─ TableAlias(cn)\n" +
  6082  			"         │                   │       │           └─ Table\n" +
  6083  			"         │                   │       │               ├─ name: company_name\n" +
  6084  			"         │                   │       │               └─ columns: [id country_code]\n" +
  6085  			"         │                   │       └─ TableAlias(ct)\n" +
  6086  			"         │                   │           └─ Table\n" +
  6087  			"         │                   │               ├─ name: company_type\n" +
  6088  			"         │                   │               └─ columns: [id]\n" +
  6089  			"         │                   └─ TableAlias(mk)\n" +
  6090  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  6091  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  6092  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  6093  			"         │                           └─ keys: mi.movie_id\n" +
  6094  			"         └─ HashLookup\n" +
  6095  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  6096  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  6097  			"             └─ Filter\n" +
  6098  			"                 ├─ (t.production_year > 1990)\n" +
  6099  			"                 └─ TableAlias(t)\n" +
  6100  			"                     └─ Table\n" +
  6101  			"                         ├─ name: title\n" +
  6102  			"                         └─ columns: [id title production_year]\n" +
  6103  			"",
  6104  		ExpectedAnalysis: "Project\n" +
  6105  			" ├─ columns: [min(at.title) as aka_title, min(t.title) as internet_movie_title]\n" +
  6106  			" └─ GroupBy\n" +
  6107  			"     ├─ SelectedExprs(MIN(at.title), MIN(t.title))\n" +
  6108  			"     ├─ Grouping()\n" +
  6109  			"     └─ HashJoin\n" +
  6110  			"         ├─ ((((t.id = at.movie_id) AND (t.id = mi.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6111  			"         ├─ HashJoin\n" +
  6112  			"         │   ├─ (k.id = mk.keyword_id)\n" +
  6113  			"         │   ├─ TableAlias(k)\n" +
  6114  			"         │   │   └─ Table\n" +
  6115  			"         │   │       ├─ name: keyword\n" +
  6116  			"         │   │       └─ columns: [id]\n" +
  6117  			"         │   └─ HashLookup\n" +
  6118  			"         │       ├─ left-key: (k.id)\n" +
  6119  			"         │       ├─ right-key: (mk.keyword_id)\n" +
  6120  			"         │       └─ HashJoin\n" +
  6121  			"         │           ├─ (((mc.movie_id = at.movie_id) AND (mi.movie_id = at.movie_id)) AND (mk.movie_id = at.movie_id))\n" +
  6122  			"         │           ├─ TableAlias(at)\n" +
  6123  			"         │           │   └─ Table\n" +
  6124  			"         │           │       ├─ name: aka_title\n" +
  6125  			"         │           │       └─ columns: [movie_id title]\n" +
  6126  			"         │           └─ HashLookup\n" +
  6127  			"         │               ├─ left-key: (at.movie_id, at.movie_id, at.movie_id)\n" +
  6128  			"         │               ├─ right-key: (mc.movie_id, mi.movie_id, mk.movie_id)\n" +
  6129  			"         │               └─ LookupJoin\n" +
  6130  			"         │                   ├─ InnerJoin\n" +
  6131  			"         │                   │   ├─ (mi.movie_id = mc.movie_id)\n" +
  6132  			"         │                   │   ├─ InnerJoin\n" +
  6133  			"         │                   │   │   ├─ (it1.id = mi.info_type_id)\n" +
  6134  			"         │                   │   │   ├─ Filter\n" +
  6135  			"         │                   │   │   │   ├─ mi.note LIKE '%internet%'\n" +
  6136  			"         │                   │   │   │   └─ TableAlias(mi)\n" +
  6137  			"         │                   │   │   │       └─ Table\n" +
  6138  			"         │                   │   │   │           ├─ name: movie_info\n" +
  6139  			"         │                   │   │   │           └─ columns: [movie_id info_type_id note]\n" +
  6140  			"         │                   │   │   └─ Filter\n" +
  6141  			"         │                   │   │       ├─ (it1.info = 'release dates')\n" +
  6142  			"         │                   │   │       └─ TableAlias(it1)\n" +
  6143  			"         │                   │   │           └─ Table\n" +
  6144  			"         │                   │   │               ├─ name: info_type\n" +
  6145  			"         │                   │   │               └─ columns: [id info]\n" +
  6146  			"         │                   │   └─ InnerJoin\n" +
  6147  			"         │                   │       ├─ (ct.id = mc.company_type_id)\n" +
  6148  			"         │                   │       ├─ InnerJoin\n" +
  6149  			"         │                   │       │   ├─ (cn.id = mc.company_id)\n" +
  6150  			"         │                   │       │   ├─ TableAlias(mc)\n" +
  6151  			"         │                   │       │   │   └─ Table\n" +
  6152  			"         │                   │       │   │       ├─ name: movie_companies\n" +
  6153  			"         │                   │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
  6154  			"         │                   │       │   └─ Filter\n" +
  6155  			"         │                   │       │       ├─ (cn.country_code = '[us]')\n" +
  6156  			"         │                   │       │       └─ TableAlias(cn)\n" +
  6157  			"         │                   │       │           └─ Table\n" +
  6158  			"         │                   │       │               ├─ name: company_name\n" +
  6159  			"         │                   │       │               └─ columns: [id country_code]\n" +
  6160  			"         │                   │       └─ TableAlias(ct)\n" +
  6161  			"         │                   │           └─ Table\n" +
  6162  			"         │                   │               ├─ name: company_type\n" +
  6163  			"         │                   │               └─ columns: [id]\n" +
  6164  			"         │                   └─ TableAlias(mk)\n" +
  6165  			"         │                       └─ IndexedTableAccess(movie_keyword)\n" +
  6166  			"         │                           ├─ index: [movie_keyword.movie_id]\n" +
  6167  			"         │                           ├─ columns: [movie_id keyword_id]\n" +
  6168  			"         │                           └─ keys: mi.movie_id\n" +
  6169  			"         └─ HashLookup\n" +
  6170  			"             ├─ left-key: (at.movie_id, mi.movie_id, mk.movie_id, mc.movie_id)\n" +
  6171  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
  6172  			"             └─ Filter\n" +
  6173  			"                 ├─ (t.production_year > 1990)\n" +
  6174  			"                 └─ TableAlias(t)\n" +
  6175  			"                     └─ Table\n" +
  6176  			"                         ├─ name: title\n" +
  6177  			"                         └─ columns: [id title production_year]\n" +
  6178  			"",
  6179  	},
  6180  	{
  6181  		Query: `
  6182  SELECT MIN(an.name) AS cool_actor_pseudonym,
  6183         MIN(t.title) AS series_named_after_char
  6184  FROM aka_name AS an,
  6185       cast_info AS ci,
  6186       company_name AS cn,
  6187       keyword AS k,
  6188       movie_companies AS mc,
  6189       movie_keyword AS mk,
  6190       name AS n,
  6191       title AS t
  6192  WHERE cn.country_code ='[us]'
  6193    AND k.keyword ='character-name-in-title'
  6194    AND t.episode_nr >= 50
  6195    AND t.episode_nr < 100
  6196    AND an.person_id = n.id
  6197    AND n.id = ci.person_id
  6198    AND ci.movie_id = t.id
  6199    AND t.id = mk.movie_id
  6200    AND mk.keyword_id = k.id
  6201    AND t.id = mc.movie_id
  6202    AND mc.company_id = cn.id
  6203    AND an.person_id = ci.person_id
  6204    AND ci.movie_id = mc.movie_id
  6205    AND ci.movie_id = mk.movie_id
  6206    AND mc.movie_id = mk.movie_id;
  6207  
  6208  `,
  6209  		ExpectedPlan: "Project\n" +
  6210  			" ├─ columns: [min(an.name):0!null as cool_actor_pseudonym, min(t.title):1!null as series_named_after_char]\n" +
  6211  			" └─ GroupBy\n" +
  6212  			"     ├─ select: MIN(an.name:13!null), MIN(t.title:1!null)\n" +
  6213  			"     ├─ group: \n" +
  6214  			"     └─ InnerJoin\n" +
  6215  			"         ├─ AND\n" +
  6216  			"         │   ├─ AND\n" +
  6217  			"         │   │   ├─ Eq\n" +
  6218  			"         │   │   │   ├─ ci.movie_id:11!null\n" +
  6219  			"         │   │   │   └─ t.id:0!null\n" +
  6220  			"         │   │   └─ Eq\n" +
  6221  			"         │   │       ├─ t.id:0!null\n" +
  6222  			"         │   │       └─ mk.movie_id:4!null\n" +
  6223  			"         │   └─ Eq\n" +
  6224  			"         │       ├─ t.id:0!null\n" +
  6225  			"         │       └─ mc.movie_id:8!null\n" +
  6226  			"         ├─ Filter\n" +
  6227  			"         │   ├─ AND\n" +
  6228  			"         │   │   ├─ GreaterThanOrEqual\n" +
  6229  			"         │   │   │   ├─ t.episode_nr:2\n" +
  6230  			"         │   │   │   └─ 50 (tinyint)\n" +
  6231  			"         │   │   └─ LessThan\n" +
  6232  			"         │   │       ├─ t.episode_nr:2\n" +
  6233  			"         │   │       └─ 100 (tinyint)\n" +
  6234  			"         │   └─ TableAlias(t)\n" +
  6235  			"         │       └─ ProcessTable\n" +
  6236  			"         │           └─ Table\n" +
  6237  			"         │               ├─ name: title\n" +
  6238  			"         │               └─ columns: [id title episode_nr]\n" +
  6239  			"         └─ InnerJoin\n" +
  6240  			"             ├─ AND\n" +
  6241  			"             │   ├─ Eq\n" +
  6242  			"             │   │   ├─ an.person_id:12!null\n" +
  6243  			"             │   │   └─ n.id:3!null\n" +
  6244  			"             │   └─ Eq\n" +
  6245  			"             │       ├─ n.id:3!null\n" +
  6246  			"             │       └─ ci.person_id:10!null\n" +
  6247  			"             ├─ TableAlias(n)\n" +
  6248  			"             │   └─ ProcessTable\n" +
  6249  			"             │       └─ Table\n" +
  6250  			"             │           ├─ name: name\n" +
  6251  			"             │           └─ columns: [id]\n" +
  6252  			"             └─ InnerJoin\n" +
  6253  			"                 ├─ AND\n" +
  6254  			"                 │   ├─ Eq\n" +
  6255  			"                 │   │   ├─ ci.movie_id:11!null\n" +
  6256  			"                 │   │   └─ mk.movie_id:4!null\n" +
  6257  			"                 │   └─ Eq\n" +
  6258  			"                 │       ├─ mc.movie_id:8!null\n" +
  6259  			"                 │       └─ mk.movie_id:4!null\n" +
  6260  			"                 ├─ InnerJoin\n" +
  6261  			"                 │   ├─ Eq\n" +
  6262  			"                 │   │   ├─ mk.keyword_id:5!null\n" +
  6263  			"                 │   │   └─ k.id:6!null\n" +
  6264  			"                 │   ├─ TableAlias(mk)\n" +
  6265  			"                 │   │   └─ ProcessTable\n" +
  6266  			"                 │   │       └─ Table\n" +
  6267  			"                 │   │           ├─ name: movie_keyword\n" +
  6268  			"                 │   │           └─ columns: [movie_id keyword_id]\n" +
  6269  			"                 │   └─ Filter\n" +
  6270  			"                 │       ├─ Eq\n" +
  6271  			"                 │       │   ├─ k.keyword:1!null\n" +
  6272  			"                 │       │   └─ character-name-in-title (longtext)\n" +
  6273  			"                 │       └─ TableAlias(k)\n" +
  6274  			"                 │           └─ ProcessTable\n" +
  6275  			"                 │               └─ Table\n" +
  6276  			"                 │                   ├─ name: keyword\n" +
  6277  			"                 │                   └─ columns: [id keyword]\n" +
  6278  			"                 └─ InnerJoin\n" +
  6279  			"                     ├─ Eq\n" +
  6280  			"                     │   ├─ mc.company_id:9!null\n" +
  6281  			"                     │   └─ cn.id:14!null\n" +
  6282  			"                     ├─ InnerJoin\n" +
  6283  			"                     │   ├─ Eq\n" +
  6284  			"                     │   │   ├─ ci.movie_id:11!null\n" +
  6285  			"                     │   │   └─ mc.movie_id:8!null\n" +
  6286  			"                     │   ├─ TableAlias(mc)\n" +
  6287  			"                     │   │   └─ ProcessTable\n" +
  6288  			"                     │   │       └─ Table\n" +
  6289  			"                     │   │           ├─ name: movie_companies\n" +
  6290  			"                     │   │           └─ columns: [movie_id company_id]\n" +
  6291  			"                     │   └─ LookupJoin\n" +
  6292  			"                     │       ├─ TableAlias(ci)\n" +
  6293  			"                     │       │   └─ ProcessTable\n" +
  6294  			"                     │       │       └─ Table\n" +
  6295  			"                     │       │           ├─ name: cast_info\n" +
  6296  			"                     │       │           └─ columns: [person_id movie_id]\n" +
  6297  			"                     │       └─ TableAlias(an)\n" +
  6298  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6299  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6300  			"                     │               ├─ keys: [ci.person_id:10!null]\n" +
  6301  			"                     │               ├─ colSet: (1-8)\n" +
  6302  			"                     │               ├─ tableId: 1\n" +
  6303  			"                     │               └─ Table\n" +
  6304  			"                     │                   ├─ name: aka_name\n" +
  6305  			"                     │                   └─ columns: [person_id name]\n" +
  6306  			"                     └─ Filter\n" +
  6307  			"                         ├─ Eq\n" +
  6308  			"                         │   ├─ cn.country_code:1\n" +
  6309  			"                         │   └─ [us] (longtext)\n" +
  6310  			"                         └─ TableAlias(cn)\n" +
  6311  			"                             └─ ProcessTable\n" +
  6312  			"                                 └─ Table\n" +
  6313  			"                                     ├─ name: company_name\n" +
  6314  			"                                     └─ columns: [id country_code]\n" +
  6315  			"",
  6316  		ExpectedEstimates: "Project\n" +
  6317  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  6318  			" └─ GroupBy\n" +
  6319  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  6320  			"     ├─ Grouping()\n" +
  6321  			"     └─ InnerJoin\n" +
  6322  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6323  			"         ├─ Filter\n" +
  6324  			"         │   ├─ ((t.episode_nr >= 50) AND (t.episode_nr < 100))\n" +
  6325  			"         │   └─ TableAlias(t)\n" +
  6326  			"         │       └─ Table\n" +
  6327  			"         │           ├─ name: title\n" +
  6328  			"         │           └─ columns: [id title episode_nr]\n" +
  6329  			"         └─ InnerJoin\n" +
  6330  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  6331  			"             ├─ TableAlias(n)\n" +
  6332  			"             │   └─ Table\n" +
  6333  			"             │       ├─ name: name\n" +
  6334  			"             │       └─ columns: [id]\n" +
  6335  			"             └─ InnerJoin\n" +
  6336  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  6337  			"                 ├─ InnerJoin\n" +
  6338  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  6339  			"                 │   ├─ TableAlias(mk)\n" +
  6340  			"                 │   │   └─ Table\n" +
  6341  			"                 │   │       ├─ name: movie_keyword\n" +
  6342  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  6343  			"                 │   └─ Filter\n" +
  6344  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  6345  			"                 │       └─ TableAlias(k)\n" +
  6346  			"                 │           └─ Table\n" +
  6347  			"                 │               ├─ name: keyword\n" +
  6348  			"                 │               └─ columns: [id keyword]\n" +
  6349  			"                 └─ InnerJoin\n" +
  6350  			"                     ├─ (mc.company_id = cn.id)\n" +
  6351  			"                     ├─ InnerJoin\n" +
  6352  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  6353  			"                     │   ├─ TableAlias(mc)\n" +
  6354  			"                     │   │   └─ Table\n" +
  6355  			"                     │   │       ├─ name: movie_companies\n" +
  6356  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  6357  			"                     │   └─ LookupJoin\n" +
  6358  			"                     │       ├─ TableAlias(ci)\n" +
  6359  			"                     │       │   └─ Table\n" +
  6360  			"                     │       │       ├─ name: cast_info\n" +
  6361  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  6362  			"                     │       └─ TableAlias(an)\n" +
  6363  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6364  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6365  			"                     │               ├─ columns: [person_id name]\n" +
  6366  			"                     │               └─ keys: ci.person_id\n" +
  6367  			"                     └─ Filter\n" +
  6368  			"                         ├─ (cn.country_code = '[us]')\n" +
  6369  			"                         └─ TableAlias(cn)\n" +
  6370  			"                             └─ Table\n" +
  6371  			"                                 ├─ name: company_name\n" +
  6372  			"                                 └─ columns: [id country_code]\n" +
  6373  			"",
  6374  		ExpectedAnalysis: "Project\n" +
  6375  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  6376  			" └─ GroupBy\n" +
  6377  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  6378  			"     ├─ Grouping()\n" +
  6379  			"     └─ InnerJoin\n" +
  6380  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6381  			"         ├─ Filter\n" +
  6382  			"         │   ├─ ((t.episode_nr >= 50) AND (t.episode_nr < 100))\n" +
  6383  			"         │   └─ TableAlias(t)\n" +
  6384  			"         │       └─ Table\n" +
  6385  			"         │           ├─ name: title\n" +
  6386  			"         │           └─ columns: [id title episode_nr]\n" +
  6387  			"         └─ InnerJoin\n" +
  6388  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  6389  			"             ├─ TableAlias(n)\n" +
  6390  			"             │   └─ Table\n" +
  6391  			"             │       ├─ name: name\n" +
  6392  			"             │       └─ columns: [id]\n" +
  6393  			"             └─ InnerJoin\n" +
  6394  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  6395  			"                 ├─ InnerJoin\n" +
  6396  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  6397  			"                 │   ├─ TableAlias(mk)\n" +
  6398  			"                 │   │   └─ Table\n" +
  6399  			"                 │   │       ├─ name: movie_keyword\n" +
  6400  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  6401  			"                 │   └─ Filter\n" +
  6402  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  6403  			"                 │       └─ TableAlias(k)\n" +
  6404  			"                 │           └─ Table\n" +
  6405  			"                 │               ├─ name: keyword\n" +
  6406  			"                 │               └─ columns: [id keyword]\n" +
  6407  			"                 └─ InnerJoin\n" +
  6408  			"                     ├─ (mc.company_id = cn.id)\n" +
  6409  			"                     ├─ InnerJoin\n" +
  6410  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  6411  			"                     │   ├─ TableAlias(mc)\n" +
  6412  			"                     │   │   └─ Table\n" +
  6413  			"                     │   │       ├─ name: movie_companies\n" +
  6414  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  6415  			"                     │   └─ LookupJoin\n" +
  6416  			"                     │       ├─ TableAlias(ci)\n" +
  6417  			"                     │       │   └─ Table\n" +
  6418  			"                     │       │       ├─ name: cast_info\n" +
  6419  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  6420  			"                     │       └─ TableAlias(an)\n" +
  6421  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6422  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6423  			"                     │               ├─ columns: [person_id name]\n" +
  6424  			"                     │               └─ keys: ci.person_id\n" +
  6425  			"                     └─ Filter\n" +
  6426  			"                         ├─ (cn.country_code = '[us]')\n" +
  6427  			"                         └─ TableAlias(cn)\n" +
  6428  			"                             └─ Table\n" +
  6429  			"                                 ├─ name: company_name\n" +
  6430  			"                                 └─ columns: [id country_code]\n" +
  6431  			"",
  6432  	},
  6433  	{
  6434  		Query: `
  6435  SELECT MIN(an.name) AS cool_actor_pseudonym,
  6436         MIN(t.title) AS series_named_after_char
  6437  FROM aka_name AS an,
  6438       cast_info AS ci,
  6439       company_name AS cn,
  6440       keyword AS k,
  6441       movie_companies AS mc,
  6442       movie_keyword AS mk,
  6443       name AS n,
  6444       title AS t
  6445  WHERE cn.country_code ='[us]'
  6446    AND k.keyword ='character-name-in-title'
  6447    AND an.person_id = n.id
  6448    AND n.id = ci.person_id
  6449    AND ci.movie_id = t.id
  6450    AND t.id = mk.movie_id
  6451    AND mk.keyword_id = k.id
  6452    AND t.id = mc.movie_id
  6453    AND mc.company_id = cn.id
  6454    AND an.person_id = ci.person_id
  6455    AND ci.movie_id = mc.movie_id
  6456    AND ci.movie_id = mk.movie_id
  6457    AND mc.movie_id = mk.movie_id;
  6458  
  6459  `,
  6460  		ExpectedPlan: "Project\n" +
  6461  			" ├─ columns: [min(an.name):0!null as cool_actor_pseudonym, min(t.title):1!null as series_named_after_char]\n" +
  6462  			" └─ GroupBy\n" +
  6463  			"     ├─ select: MIN(an.name:12!null), MIN(t.title:1!null)\n" +
  6464  			"     ├─ group: \n" +
  6465  			"     └─ InnerJoin\n" +
  6466  			"         ├─ AND\n" +
  6467  			"         │   ├─ AND\n" +
  6468  			"         │   │   ├─ Eq\n" +
  6469  			"         │   │   │   ├─ ci.movie_id:10!null\n" +
  6470  			"         │   │   │   └─ t.id:0!null\n" +
  6471  			"         │   │   └─ Eq\n" +
  6472  			"         │   │       ├─ t.id:0!null\n" +
  6473  			"         │   │       └─ mk.movie_id:3!null\n" +
  6474  			"         │   └─ Eq\n" +
  6475  			"         │       ├─ t.id:0!null\n" +
  6476  			"         │       └─ mc.movie_id:7!null\n" +
  6477  			"         ├─ TableAlias(t)\n" +
  6478  			"         │   └─ ProcessTable\n" +
  6479  			"         │       └─ Table\n" +
  6480  			"         │           ├─ name: title\n" +
  6481  			"         │           └─ columns: [id title]\n" +
  6482  			"         └─ InnerJoin\n" +
  6483  			"             ├─ AND\n" +
  6484  			"             │   ├─ Eq\n" +
  6485  			"             │   │   ├─ an.person_id:11!null\n" +
  6486  			"             │   │   └─ n.id:2!null\n" +
  6487  			"             │   └─ Eq\n" +
  6488  			"             │       ├─ n.id:2!null\n" +
  6489  			"             │       └─ ci.person_id:9!null\n" +
  6490  			"             ├─ TableAlias(n)\n" +
  6491  			"             │   └─ ProcessTable\n" +
  6492  			"             │       └─ Table\n" +
  6493  			"             │           ├─ name: name\n" +
  6494  			"             │           └─ columns: [id]\n" +
  6495  			"             └─ InnerJoin\n" +
  6496  			"                 ├─ AND\n" +
  6497  			"                 │   ├─ Eq\n" +
  6498  			"                 │   │   ├─ ci.movie_id:10!null\n" +
  6499  			"                 │   │   └─ mk.movie_id:3!null\n" +
  6500  			"                 │   └─ Eq\n" +
  6501  			"                 │       ├─ mc.movie_id:7!null\n" +
  6502  			"                 │       └─ mk.movie_id:3!null\n" +
  6503  			"                 ├─ InnerJoin\n" +
  6504  			"                 │   ├─ Eq\n" +
  6505  			"                 │   │   ├─ mk.keyword_id:4!null\n" +
  6506  			"                 │   │   └─ k.id:5!null\n" +
  6507  			"                 │   ├─ TableAlias(mk)\n" +
  6508  			"                 │   │   └─ ProcessTable\n" +
  6509  			"                 │   │       └─ Table\n" +
  6510  			"                 │   │           ├─ name: movie_keyword\n" +
  6511  			"                 │   │           └─ columns: [movie_id keyword_id]\n" +
  6512  			"                 │   └─ Filter\n" +
  6513  			"                 │       ├─ Eq\n" +
  6514  			"                 │       │   ├─ k.keyword:1!null\n" +
  6515  			"                 │       │   └─ character-name-in-title (longtext)\n" +
  6516  			"                 │       └─ TableAlias(k)\n" +
  6517  			"                 │           └─ ProcessTable\n" +
  6518  			"                 │               └─ Table\n" +
  6519  			"                 │                   ├─ name: keyword\n" +
  6520  			"                 │                   └─ columns: [id keyword]\n" +
  6521  			"                 └─ InnerJoin\n" +
  6522  			"                     ├─ Eq\n" +
  6523  			"                     │   ├─ mc.company_id:8!null\n" +
  6524  			"                     │   └─ cn.id:13!null\n" +
  6525  			"                     ├─ InnerJoin\n" +
  6526  			"                     │   ├─ Eq\n" +
  6527  			"                     │   │   ├─ ci.movie_id:10!null\n" +
  6528  			"                     │   │   └─ mc.movie_id:7!null\n" +
  6529  			"                     │   ├─ TableAlias(mc)\n" +
  6530  			"                     │   │   └─ ProcessTable\n" +
  6531  			"                     │   │       └─ Table\n" +
  6532  			"                     │   │           ├─ name: movie_companies\n" +
  6533  			"                     │   │           └─ columns: [movie_id company_id]\n" +
  6534  			"                     │   └─ LookupJoin\n" +
  6535  			"                     │       ├─ TableAlias(ci)\n" +
  6536  			"                     │       │   └─ ProcessTable\n" +
  6537  			"                     │       │       └─ Table\n" +
  6538  			"                     │       │           ├─ name: cast_info\n" +
  6539  			"                     │       │           └─ columns: [person_id movie_id]\n" +
  6540  			"                     │       └─ TableAlias(an)\n" +
  6541  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6542  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6543  			"                     │               ├─ keys: [ci.person_id:9!null]\n" +
  6544  			"                     │               ├─ colSet: (1-8)\n" +
  6545  			"                     │               ├─ tableId: 1\n" +
  6546  			"                     │               └─ Table\n" +
  6547  			"                     │                   ├─ name: aka_name\n" +
  6548  			"                     │                   └─ columns: [person_id name]\n" +
  6549  			"                     └─ Filter\n" +
  6550  			"                         ├─ Eq\n" +
  6551  			"                         │   ├─ cn.country_code:1\n" +
  6552  			"                         │   └─ [us] (longtext)\n" +
  6553  			"                         └─ TableAlias(cn)\n" +
  6554  			"                             └─ ProcessTable\n" +
  6555  			"                                 └─ Table\n" +
  6556  			"                                     ├─ name: company_name\n" +
  6557  			"                                     └─ columns: [id country_code]\n" +
  6558  			"",
  6559  		ExpectedEstimates: "Project\n" +
  6560  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  6561  			" └─ GroupBy\n" +
  6562  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  6563  			"     ├─ Grouping()\n" +
  6564  			"     └─ InnerJoin\n" +
  6565  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6566  			"         ├─ TableAlias(t)\n" +
  6567  			"         │   └─ Table\n" +
  6568  			"         │       ├─ name: title\n" +
  6569  			"         │       └─ columns: [id title]\n" +
  6570  			"         └─ InnerJoin\n" +
  6571  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  6572  			"             ├─ TableAlias(n)\n" +
  6573  			"             │   └─ Table\n" +
  6574  			"             │       ├─ name: name\n" +
  6575  			"             │       └─ columns: [id]\n" +
  6576  			"             └─ InnerJoin\n" +
  6577  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  6578  			"                 ├─ InnerJoin\n" +
  6579  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  6580  			"                 │   ├─ TableAlias(mk)\n" +
  6581  			"                 │   │   └─ Table\n" +
  6582  			"                 │   │       ├─ name: movie_keyword\n" +
  6583  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  6584  			"                 │   └─ Filter\n" +
  6585  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  6586  			"                 │       └─ TableAlias(k)\n" +
  6587  			"                 │           └─ Table\n" +
  6588  			"                 │               ├─ name: keyword\n" +
  6589  			"                 │               └─ columns: [id keyword]\n" +
  6590  			"                 └─ InnerJoin\n" +
  6591  			"                     ├─ (mc.company_id = cn.id)\n" +
  6592  			"                     ├─ InnerJoin\n" +
  6593  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  6594  			"                     │   ├─ TableAlias(mc)\n" +
  6595  			"                     │   │   └─ Table\n" +
  6596  			"                     │   │       ├─ name: movie_companies\n" +
  6597  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  6598  			"                     │   └─ LookupJoin\n" +
  6599  			"                     │       ├─ TableAlias(ci)\n" +
  6600  			"                     │       │   └─ Table\n" +
  6601  			"                     │       │       ├─ name: cast_info\n" +
  6602  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  6603  			"                     │       └─ TableAlias(an)\n" +
  6604  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6605  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6606  			"                     │               ├─ columns: [person_id name]\n" +
  6607  			"                     │               └─ keys: ci.person_id\n" +
  6608  			"                     └─ Filter\n" +
  6609  			"                         ├─ (cn.country_code = '[us]')\n" +
  6610  			"                         └─ TableAlias(cn)\n" +
  6611  			"                             └─ Table\n" +
  6612  			"                                 ├─ name: company_name\n" +
  6613  			"                                 └─ columns: [id country_code]\n" +
  6614  			"",
  6615  		ExpectedAnalysis: "Project\n" +
  6616  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  6617  			" └─ GroupBy\n" +
  6618  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  6619  			"     ├─ Grouping()\n" +
  6620  			"     └─ InnerJoin\n" +
  6621  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6622  			"         ├─ TableAlias(t)\n" +
  6623  			"         │   └─ Table\n" +
  6624  			"         │       ├─ name: title\n" +
  6625  			"         │       └─ columns: [id title]\n" +
  6626  			"         └─ InnerJoin\n" +
  6627  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  6628  			"             ├─ TableAlias(n)\n" +
  6629  			"             │   └─ Table\n" +
  6630  			"             │       ├─ name: name\n" +
  6631  			"             │       └─ columns: [id]\n" +
  6632  			"             └─ InnerJoin\n" +
  6633  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  6634  			"                 ├─ InnerJoin\n" +
  6635  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  6636  			"                 │   ├─ TableAlias(mk)\n" +
  6637  			"                 │   │   └─ Table\n" +
  6638  			"                 │   │       ├─ name: movie_keyword\n" +
  6639  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  6640  			"                 │   └─ Filter\n" +
  6641  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  6642  			"                 │       └─ TableAlias(k)\n" +
  6643  			"                 │           └─ Table\n" +
  6644  			"                 │               ├─ name: keyword\n" +
  6645  			"                 │               └─ columns: [id keyword]\n" +
  6646  			"                 └─ InnerJoin\n" +
  6647  			"                     ├─ (mc.company_id = cn.id)\n" +
  6648  			"                     ├─ InnerJoin\n" +
  6649  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  6650  			"                     │   ├─ TableAlias(mc)\n" +
  6651  			"                     │   │   └─ Table\n" +
  6652  			"                     │   │       ├─ name: movie_companies\n" +
  6653  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  6654  			"                     │   └─ LookupJoin\n" +
  6655  			"                     │       ├─ TableAlias(ci)\n" +
  6656  			"                     │       │   └─ Table\n" +
  6657  			"                     │       │       ├─ name: cast_info\n" +
  6658  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  6659  			"                     │       └─ TableAlias(an)\n" +
  6660  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6661  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6662  			"                     │               ├─ columns: [person_id name]\n" +
  6663  			"                     │               └─ keys: ci.person_id\n" +
  6664  			"                     └─ Filter\n" +
  6665  			"                         ├─ (cn.country_code = '[us]')\n" +
  6666  			"                         └─ TableAlias(cn)\n" +
  6667  			"                             └─ Table\n" +
  6668  			"                                 ├─ name: company_name\n" +
  6669  			"                                 └─ columns: [id country_code]\n" +
  6670  			"",
  6671  	},
  6672  	{
  6673  		Query: `
  6674  SELECT MIN(an.name) AS cool_actor_pseudonym,
  6675         MIN(t.title) AS series_named_after_char
  6676  FROM aka_name AS an,
  6677       cast_info AS ci,
  6678       company_name AS cn,
  6679       keyword AS k,
  6680       movie_companies AS mc,
  6681       movie_keyword AS mk,
  6682       name AS n,
  6683       title AS t
  6684  WHERE cn.country_code ='[us]'
  6685    AND k.keyword ='character-name-in-title'
  6686    AND t.episode_nr < 100
  6687    AND an.person_id = n.id
  6688    AND n.id = ci.person_id
  6689    AND ci.movie_id = t.id
  6690    AND t.id = mk.movie_id
  6691    AND mk.keyword_id = k.id
  6692    AND t.id = mc.movie_id
  6693    AND mc.company_id = cn.id
  6694    AND an.person_id = ci.person_id
  6695    AND ci.movie_id = mc.movie_id
  6696    AND ci.movie_id = mk.movie_id
  6697    AND mc.movie_id = mk.movie_id;
  6698  
  6699  `,
  6700  		ExpectedPlan: "Project\n" +
  6701  			" ├─ columns: [min(an.name):0!null as cool_actor_pseudonym, min(t.title):1!null as series_named_after_char]\n" +
  6702  			" └─ GroupBy\n" +
  6703  			"     ├─ select: MIN(an.name:13!null), MIN(t.title:1!null)\n" +
  6704  			"     ├─ group: \n" +
  6705  			"     └─ InnerJoin\n" +
  6706  			"         ├─ AND\n" +
  6707  			"         │   ├─ AND\n" +
  6708  			"         │   │   ├─ Eq\n" +
  6709  			"         │   │   │   ├─ ci.movie_id:11!null\n" +
  6710  			"         │   │   │   └─ t.id:0!null\n" +
  6711  			"         │   │   └─ Eq\n" +
  6712  			"         │   │       ├─ t.id:0!null\n" +
  6713  			"         │   │       └─ mk.movie_id:4!null\n" +
  6714  			"         │   └─ Eq\n" +
  6715  			"         │       ├─ t.id:0!null\n" +
  6716  			"         │       └─ mc.movie_id:8!null\n" +
  6717  			"         ├─ Filter\n" +
  6718  			"         │   ├─ LessThan\n" +
  6719  			"         │   │   ├─ t.episode_nr:2\n" +
  6720  			"         │   │   └─ 100 (tinyint)\n" +
  6721  			"         │   └─ TableAlias(t)\n" +
  6722  			"         │       └─ ProcessTable\n" +
  6723  			"         │           └─ Table\n" +
  6724  			"         │               ├─ name: title\n" +
  6725  			"         │               └─ columns: [id title episode_nr]\n" +
  6726  			"         └─ InnerJoin\n" +
  6727  			"             ├─ AND\n" +
  6728  			"             │   ├─ Eq\n" +
  6729  			"             │   │   ├─ an.person_id:12!null\n" +
  6730  			"             │   │   └─ n.id:3!null\n" +
  6731  			"             │   └─ Eq\n" +
  6732  			"             │       ├─ n.id:3!null\n" +
  6733  			"             │       └─ ci.person_id:10!null\n" +
  6734  			"             ├─ TableAlias(n)\n" +
  6735  			"             │   └─ ProcessTable\n" +
  6736  			"             │       └─ Table\n" +
  6737  			"             │           ├─ name: name\n" +
  6738  			"             │           └─ columns: [id]\n" +
  6739  			"             └─ InnerJoin\n" +
  6740  			"                 ├─ AND\n" +
  6741  			"                 │   ├─ Eq\n" +
  6742  			"                 │   │   ├─ ci.movie_id:11!null\n" +
  6743  			"                 │   │   └─ mk.movie_id:4!null\n" +
  6744  			"                 │   └─ Eq\n" +
  6745  			"                 │       ├─ mc.movie_id:8!null\n" +
  6746  			"                 │       └─ mk.movie_id:4!null\n" +
  6747  			"                 ├─ InnerJoin\n" +
  6748  			"                 │   ├─ Eq\n" +
  6749  			"                 │   │   ├─ mk.keyword_id:5!null\n" +
  6750  			"                 │   │   └─ k.id:6!null\n" +
  6751  			"                 │   ├─ TableAlias(mk)\n" +
  6752  			"                 │   │   └─ ProcessTable\n" +
  6753  			"                 │   │       └─ Table\n" +
  6754  			"                 │   │           ├─ name: movie_keyword\n" +
  6755  			"                 │   │           └─ columns: [movie_id keyword_id]\n" +
  6756  			"                 │   └─ Filter\n" +
  6757  			"                 │       ├─ Eq\n" +
  6758  			"                 │       │   ├─ k.keyword:1!null\n" +
  6759  			"                 │       │   └─ character-name-in-title (longtext)\n" +
  6760  			"                 │       └─ TableAlias(k)\n" +
  6761  			"                 │           └─ ProcessTable\n" +
  6762  			"                 │               └─ Table\n" +
  6763  			"                 │                   ├─ name: keyword\n" +
  6764  			"                 │                   └─ columns: [id keyword]\n" +
  6765  			"                 └─ InnerJoin\n" +
  6766  			"                     ├─ Eq\n" +
  6767  			"                     │   ├─ mc.company_id:9!null\n" +
  6768  			"                     │   └─ cn.id:14!null\n" +
  6769  			"                     ├─ InnerJoin\n" +
  6770  			"                     │   ├─ Eq\n" +
  6771  			"                     │   │   ├─ ci.movie_id:11!null\n" +
  6772  			"                     │   │   └─ mc.movie_id:8!null\n" +
  6773  			"                     │   ├─ TableAlias(mc)\n" +
  6774  			"                     │   │   └─ ProcessTable\n" +
  6775  			"                     │   │       └─ Table\n" +
  6776  			"                     │   │           ├─ name: movie_companies\n" +
  6777  			"                     │   │           └─ columns: [movie_id company_id]\n" +
  6778  			"                     │   └─ LookupJoin\n" +
  6779  			"                     │       ├─ TableAlias(ci)\n" +
  6780  			"                     │       │   └─ ProcessTable\n" +
  6781  			"                     │       │       └─ Table\n" +
  6782  			"                     │       │           ├─ name: cast_info\n" +
  6783  			"                     │       │           └─ columns: [person_id movie_id]\n" +
  6784  			"                     │       └─ TableAlias(an)\n" +
  6785  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6786  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6787  			"                     │               ├─ keys: [ci.person_id:10!null]\n" +
  6788  			"                     │               ├─ colSet: (1-8)\n" +
  6789  			"                     │               ├─ tableId: 1\n" +
  6790  			"                     │               └─ Table\n" +
  6791  			"                     │                   ├─ name: aka_name\n" +
  6792  			"                     │                   └─ columns: [person_id name]\n" +
  6793  			"                     └─ Filter\n" +
  6794  			"                         ├─ Eq\n" +
  6795  			"                         │   ├─ cn.country_code:1\n" +
  6796  			"                         │   └─ [us] (longtext)\n" +
  6797  			"                         └─ TableAlias(cn)\n" +
  6798  			"                             └─ ProcessTable\n" +
  6799  			"                                 └─ Table\n" +
  6800  			"                                     ├─ name: company_name\n" +
  6801  			"                                     └─ columns: [id country_code]\n" +
  6802  			"",
  6803  		ExpectedEstimates: "Project\n" +
  6804  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  6805  			" └─ GroupBy\n" +
  6806  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  6807  			"     ├─ Grouping()\n" +
  6808  			"     └─ InnerJoin\n" +
  6809  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6810  			"         ├─ Filter\n" +
  6811  			"         │   ├─ (t.episode_nr < 100)\n" +
  6812  			"         │   └─ TableAlias(t)\n" +
  6813  			"         │       └─ Table\n" +
  6814  			"         │           ├─ name: title\n" +
  6815  			"         │           └─ columns: [id title episode_nr]\n" +
  6816  			"         └─ InnerJoin\n" +
  6817  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  6818  			"             ├─ TableAlias(n)\n" +
  6819  			"             │   └─ Table\n" +
  6820  			"             │       ├─ name: name\n" +
  6821  			"             │       └─ columns: [id]\n" +
  6822  			"             └─ InnerJoin\n" +
  6823  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  6824  			"                 ├─ InnerJoin\n" +
  6825  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  6826  			"                 │   ├─ TableAlias(mk)\n" +
  6827  			"                 │   │   └─ Table\n" +
  6828  			"                 │   │       ├─ name: movie_keyword\n" +
  6829  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  6830  			"                 │   └─ Filter\n" +
  6831  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  6832  			"                 │       └─ TableAlias(k)\n" +
  6833  			"                 │           └─ Table\n" +
  6834  			"                 │               ├─ name: keyword\n" +
  6835  			"                 │               └─ columns: [id keyword]\n" +
  6836  			"                 └─ InnerJoin\n" +
  6837  			"                     ├─ (mc.company_id = cn.id)\n" +
  6838  			"                     ├─ InnerJoin\n" +
  6839  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  6840  			"                     │   ├─ TableAlias(mc)\n" +
  6841  			"                     │   │   └─ Table\n" +
  6842  			"                     │   │       ├─ name: movie_companies\n" +
  6843  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  6844  			"                     │   └─ LookupJoin\n" +
  6845  			"                     │       ├─ TableAlias(ci)\n" +
  6846  			"                     │       │   └─ Table\n" +
  6847  			"                     │       │       ├─ name: cast_info\n" +
  6848  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  6849  			"                     │       └─ TableAlias(an)\n" +
  6850  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6851  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6852  			"                     │               ├─ columns: [person_id name]\n" +
  6853  			"                     │               └─ keys: ci.person_id\n" +
  6854  			"                     └─ Filter\n" +
  6855  			"                         ├─ (cn.country_code = '[us]')\n" +
  6856  			"                         └─ TableAlias(cn)\n" +
  6857  			"                             └─ Table\n" +
  6858  			"                                 ├─ name: company_name\n" +
  6859  			"                                 └─ columns: [id country_code]\n" +
  6860  			"",
  6861  		ExpectedAnalysis: "Project\n" +
  6862  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  6863  			" └─ GroupBy\n" +
  6864  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  6865  			"     ├─ Grouping()\n" +
  6866  			"     └─ InnerJoin\n" +
  6867  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  6868  			"         ├─ Filter\n" +
  6869  			"         │   ├─ (t.episode_nr < 100)\n" +
  6870  			"         │   └─ TableAlias(t)\n" +
  6871  			"         │       └─ Table\n" +
  6872  			"         │           ├─ name: title\n" +
  6873  			"         │           └─ columns: [id title episode_nr]\n" +
  6874  			"         └─ InnerJoin\n" +
  6875  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  6876  			"             ├─ TableAlias(n)\n" +
  6877  			"             │   └─ Table\n" +
  6878  			"             │       ├─ name: name\n" +
  6879  			"             │       └─ columns: [id]\n" +
  6880  			"             └─ InnerJoin\n" +
  6881  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  6882  			"                 ├─ InnerJoin\n" +
  6883  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  6884  			"                 │   ├─ TableAlias(mk)\n" +
  6885  			"                 │   │   └─ Table\n" +
  6886  			"                 │   │       ├─ name: movie_keyword\n" +
  6887  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  6888  			"                 │   └─ Filter\n" +
  6889  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  6890  			"                 │       └─ TableAlias(k)\n" +
  6891  			"                 │           └─ Table\n" +
  6892  			"                 │               ├─ name: keyword\n" +
  6893  			"                 │               └─ columns: [id keyword]\n" +
  6894  			"                 └─ InnerJoin\n" +
  6895  			"                     ├─ (mc.company_id = cn.id)\n" +
  6896  			"                     ├─ InnerJoin\n" +
  6897  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  6898  			"                     │   ├─ TableAlias(mc)\n" +
  6899  			"                     │   │   └─ Table\n" +
  6900  			"                     │   │       ├─ name: movie_companies\n" +
  6901  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  6902  			"                     │   └─ LookupJoin\n" +
  6903  			"                     │       ├─ TableAlias(ci)\n" +
  6904  			"                     │       │   └─ Table\n" +
  6905  			"                     │       │       ├─ name: cast_info\n" +
  6906  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  6907  			"                     │       └─ TableAlias(an)\n" +
  6908  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  6909  			"                     │               ├─ index: [aka_name.person_id]\n" +
  6910  			"                     │               ├─ columns: [person_id name]\n" +
  6911  			"                     │               └─ keys: ci.person_id\n" +
  6912  			"                     └─ Filter\n" +
  6913  			"                         ├─ (cn.country_code = '[us]')\n" +
  6914  			"                         └─ TableAlias(cn)\n" +
  6915  			"                             └─ Table\n" +
  6916  			"                                 ├─ name: company_name\n" +
  6917  			"                                 └─ columns: [id country_code]\n" +
  6918  			"",
  6919  	},
  6920  	{
  6921  		Query: `
  6922  SELECT MIN(an.name) AS cool_actor_pseudonym,
  6923         MIN(t.title) AS series_named_after_char
  6924  FROM aka_name AS an,
  6925       cast_info AS ci,
  6926       company_name AS cn,
  6927       keyword AS k,
  6928       movie_companies AS mc,
  6929       movie_keyword AS mk,
  6930       name AS n,
  6931       title AS t
  6932  WHERE cn.country_code ='[us]'
  6933    AND k.keyword ='character-name-in-title'
  6934    AND t.episode_nr >= 5
  6935    AND t.episode_nr < 100
  6936    AND an.person_id = n.id
  6937    AND n.id = ci.person_id
  6938    AND ci.movie_id = t.id
  6939    AND t.id = mk.movie_id
  6940    AND mk.keyword_id = k.id
  6941    AND t.id = mc.movie_id
  6942    AND mc.company_id = cn.id
  6943    AND an.person_id = ci.person_id
  6944    AND ci.movie_id = mc.movie_id
  6945    AND ci.movie_id = mk.movie_id
  6946    AND mc.movie_id = mk.movie_id;
  6947  
  6948  `,
  6949  		ExpectedPlan: "Project\n" +
  6950  			" ├─ columns: [min(an.name):0!null as cool_actor_pseudonym, min(t.title):1!null as series_named_after_char]\n" +
  6951  			" └─ GroupBy\n" +
  6952  			"     ├─ select: MIN(an.name:13!null), MIN(t.title:1!null)\n" +
  6953  			"     ├─ group: \n" +
  6954  			"     └─ InnerJoin\n" +
  6955  			"         ├─ AND\n" +
  6956  			"         │   ├─ AND\n" +
  6957  			"         │   │   ├─ Eq\n" +
  6958  			"         │   │   │   ├─ ci.movie_id:11!null\n" +
  6959  			"         │   │   │   └─ t.id:0!null\n" +
  6960  			"         │   │   └─ Eq\n" +
  6961  			"         │   │       ├─ t.id:0!null\n" +
  6962  			"         │   │       └─ mk.movie_id:4!null\n" +
  6963  			"         │   └─ Eq\n" +
  6964  			"         │       ├─ t.id:0!null\n" +
  6965  			"         │       └─ mc.movie_id:8!null\n" +
  6966  			"         ├─ Filter\n" +
  6967  			"         │   ├─ AND\n" +
  6968  			"         │   │   ├─ GreaterThanOrEqual\n" +
  6969  			"         │   │   │   ├─ t.episode_nr:2\n" +
  6970  			"         │   │   │   └─ 5 (tinyint)\n" +
  6971  			"         │   │   └─ LessThan\n" +
  6972  			"         │   │       ├─ t.episode_nr:2\n" +
  6973  			"         │   │       └─ 100 (tinyint)\n" +
  6974  			"         │   └─ TableAlias(t)\n" +
  6975  			"         │       └─ ProcessTable\n" +
  6976  			"         │           └─ Table\n" +
  6977  			"         │               ├─ name: title\n" +
  6978  			"         │               └─ columns: [id title episode_nr]\n" +
  6979  			"         └─ InnerJoin\n" +
  6980  			"             ├─ AND\n" +
  6981  			"             │   ├─ Eq\n" +
  6982  			"             │   │   ├─ an.person_id:12!null\n" +
  6983  			"             │   │   └─ n.id:3!null\n" +
  6984  			"             │   └─ Eq\n" +
  6985  			"             │       ├─ n.id:3!null\n" +
  6986  			"             │       └─ ci.person_id:10!null\n" +
  6987  			"             ├─ TableAlias(n)\n" +
  6988  			"             │   └─ ProcessTable\n" +
  6989  			"             │       └─ Table\n" +
  6990  			"             │           ├─ name: name\n" +
  6991  			"             │           └─ columns: [id]\n" +
  6992  			"             └─ InnerJoin\n" +
  6993  			"                 ├─ AND\n" +
  6994  			"                 │   ├─ Eq\n" +
  6995  			"                 │   │   ├─ ci.movie_id:11!null\n" +
  6996  			"                 │   │   └─ mk.movie_id:4!null\n" +
  6997  			"                 │   └─ Eq\n" +
  6998  			"                 │       ├─ mc.movie_id:8!null\n" +
  6999  			"                 │       └─ mk.movie_id:4!null\n" +
  7000  			"                 ├─ InnerJoin\n" +
  7001  			"                 │   ├─ Eq\n" +
  7002  			"                 │   │   ├─ mk.keyword_id:5!null\n" +
  7003  			"                 │   │   └─ k.id:6!null\n" +
  7004  			"                 │   ├─ TableAlias(mk)\n" +
  7005  			"                 │   │   └─ ProcessTable\n" +
  7006  			"                 │   │       └─ Table\n" +
  7007  			"                 │   │           ├─ name: movie_keyword\n" +
  7008  			"                 │   │           └─ columns: [movie_id keyword_id]\n" +
  7009  			"                 │   └─ Filter\n" +
  7010  			"                 │       ├─ Eq\n" +
  7011  			"                 │       │   ├─ k.keyword:1!null\n" +
  7012  			"                 │       │   └─ character-name-in-title (longtext)\n" +
  7013  			"                 │       └─ TableAlias(k)\n" +
  7014  			"                 │           └─ ProcessTable\n" +
  7015  			"                 │               └─ Table\n" +
  7016  			"                 │                   ├─ name: keyword\n" +
  7017  			"                 │                   └─ columns: [id keyword]\n" +
  7018  			"                 └─ InnerJoin\n" +
  7019  			"                     ├─ Eq\n" +
  7020  			"                     │   ├─ mc.company_id:9!null\n" +
  7021  			"                     │   └─ cn.id:14!null\n" +
  7022  			"                     ├─ InnerJoin\n" +
  7023  			"                     │   ├─ Eq\n" +
  7024  			"                     │   │   ├─ ci.movie_id:11!null\n" +
  7025  			"                     │   │   └─ mc.movie_id:8!null\n" +
  7026  			"                     │   ├─ TableAlias(mc)\n" +
  7027  			"                     │   │   └─ ProcessTable\n" +
  7028  			"                     │   │       └─ Table\n" +
  7029  			"                     │   │           ├─ name: movie_companies\n" +
  7030  			"                     │   │           └─ columns: [movie_id company_id]\n" +
  7031  			"                     │   └─ LookupJoin\n" +
  7032  			"                     │       ├─ TableAlias(ci)\n" +
  7033  			"                     │       │   └─ ProcessTable\n" +
  7034  			"                     │       │       └─ Table\n" +
  7035  			"                     │       │           ├─ name: cast_info\n" +
  7036  			"                     │       │           └─ columns: [person_id movie_id]\n" +
  7037  			"                     │       └─ TableAlias(an)\n" +
  7038  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  7039  			"                     │               ├─ index: [aka_name.person_id]\n" +
  7040  			"                     │               ├─ keys: [ci.person_id:10!null]\n" +
  7041  			"                     │               ├─ colSet: (1-8)\n" +
  7042  			"                     │               ├─ tableId: 1\n" +
  7043  			"                     │               └─ Table\n" +
  7044  			"                     │                   ├─ name: aka_name\n" +
  7045  			"                     │                   └─ columns: [person_id name]\n" +
  7046  			"                     └─ Filter\n" +
  7047  			"                         ├─ Eq\n" +
  7048  			"                         │   ├─ cn.country_code:1\n" +
  7049  			"                         │   └─ [us] (longtext)\n" +
  7050  			"                         └─ TableAlias(cn)\n" +
  7051  			"                             └─ ProcessTable\n" +
  7052  			"                                 └─ Table\n" +
  7053  			"                                     ├─ name: company_name\n" +
  7054  			"                                     └─ columns: [id country_code]\n" +
  7055  			"",
  7056  		ExpectedEstimates: "Project\n" +
  7057  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  7058  			" └─ GroupBy\n" +
  7059  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  7060  			"     ├─ Grouping()\n" +
  7061  			"     └─ InnerJoin\n" +
  7062  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7063  			"         ├─ Filter\n" +
  7064  			"         │   ├─ ((t.episode_nr >= 5) AND (t.episode_nr < 100))\n" +
  7065  			"         │   └─ TableAlias(t)\n" +
  7066  			"         │       └─ Table\n" +
  7067  			"         │           ├─ name: title\n" +
  7068  			"         │           └─ columns: [id title episode_nr]\n" +
  7069  			"         └─ InnerJoin\n" +
  7070  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  7071  			"             ├─ TableAlias(n)\n" +
  7072  			"             │   └─ Table\n" +
  7073  			"             │       ├─ name: name\n" +
  7074  			"             │       └─ columns: [id]\n" +
  7075  			"             └─ InnerJoin\n" +
  7076  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  7077  			"                 ├─ InnerJoin\n" +
  7078  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  7079  			"                 │   ├─ TableAlias(mk)\n" +
  7080  			"                 │   │   └─ Table\n" +
  7081  			"                 │   │       ├─ name: movie_keyword\n" +
  7082  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  7083  			"                 │   └─ Filter\n" +
  7084  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  7085  			"                 │       └─ TableAlias(k)\n" +
  7086  			"                 │           └─ Table\n" +
  7087  			"                 │               ├─ name: keyword\n" +
  7088  			"                 │               └─ columns: [id keyword]\n" +
  7089  			"                 └─ InnerJoin\n" +
  7090  			"                     ├─ (mc.company_id = cn.id)\n" +
  7091  			"                     ├─ InnerJoin\n" +
  7092  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  7093  			"                     │   ├─ TableAlias(mc)\n" +
  7094  			"                     │   │   └─ Table\n" +
  7095  			"                     │   │       ├─ name: movie_companies\n" +
  7096  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  7097  			"                     │   └─ LookupJoin\n" +
  7098  			"                     │       ├─ TableAlias(ci)\n" +
  7099  			"                     │       │   └─ Table\n" +
  7100  			"                     │       │       ├─ name: cast_info\n" +
  7101  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  7102  			"                     │       └─ TableAlias(an)\n" +
  7103  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  7104  			"                     │               ├─ index: [aka_name.person_id]\n" +
  7105  			"                     │               ├─ columns: [person_id name]\n" +
  7106  			"                     │               └─ keys: ci.person_id\n" +
  7107  			"                     └─ Filter\n" +
  7108  			"                         ├─ (cn.country_code = '[us]')\n" +
  7109  			"                         └─ TableAlias(cn)\n" +
  7110  			"                             └─ Table\n" +
  7111  			"                                 ├─ name: company_name\n" +
  7112  			"                                 └─ columns: [id country_code]\n" +
  7113  			"",
  7114  		ExpectedAnalysis: "Project\n" +
  7115  			" ├─ columns: [min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char]\n" +
  7116  			" └─ GroupBy\n" +
  7117  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
  7118  			"     ├─ Grouping()\n" +
  7119  			"     └─ InnerJoin\n" +
  7120  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7121  			"         ├─ Filter\n" +
  7122  			"         │   ├─ ((t.episode_nr >= 5) AND (t.episode_nr < 100))\n" +
  7123  			"         │   └─ TableAlias(t)\n" +
  7124  			"         │       └─ Table\n" +
  7125  			"         │           ├─ name: title\n" +
  7126  			"         │           └─ columns: [id title episode_nr]\n" +
  7127  			"         └─ InnerJoin\n" +
  7128  			"             ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
  7129  			"             ├─ TableAlias(n)\n" +
  7130  			"             │   └─ Table\n" +
  7131  			"             │       ├─ name: name\n" +
  7132  			"             │       └─ columns: [id]\n" +
  7133  			"             └─ InnerJoin\n" +
  7134  			"                 ├─ ((ci.movie_id = mk.movie_id) AND (mc.movie_id = mk.movie_id))\n" +
  7135  			"                 ├─ InnerJoin\n" +
  7136  			"                 │   ├─ (mk.keyword_id = k.id)\n" +
  7137  			"                 │   ├─ TableAlias(mk)\n" +
  7138  			"                 │   │   └─ Table\n" +
  7139  			"                 │   │       ├─ name: movie_keyword\n" +
  7140  			"                 │   │       └─ columns: [movie_id keyword_id]\n" +
  7141  			"                 │   └─ Filter\n" +
  7142  			"                 │       ├─ (k.keyword = 'character-name-in-title')\n" +
  7143  			"                 │       └─ TableAlias(k)\n" +
  7144  			"                 │           └─ Table\n" +
  7145  			"                 │               ├─ name: keyword\n" +
  7146  			"                 │               └─ columns: [id keyword]\n" +
  7147  			"                 └─ InnerJoin\n" +
  7148  			"                     ├─ (mc.company_id = cn.id)\n" +
  7149  			"                     ├─ InnerJoin\n" +
  7150  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
  7151  			"                     │   ├─ TableAlias(mc)\n" +
  7152  			"                     │   │   └─ Table\n" +
  7153  			"                     │   │       ├─ name: movie_companies\n" +
  7154  			"                     │   │       └─ columns: [movie_id company_id]\n" +
  7155  			"                     │   └─ LookupJoin\n" +
  7156  			"                     │       ├─ TableAlias(ci)\n" +
  7157  			"                     │       │   └─ Table\n" +
  7158  			"                     │       │       ├─ name: cast_info\n" +
  7159  			"                     │       │       └─ columns: [person_id movie_id]\n" +
  7160  			"                     │       └─ TableAlias(an)\n" +
  7161  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
  7162  			"                     │               ├─ index: [aka_name.person_id]\n" +
  7163  			"                     │               ├─ columns: [person_id name]\n" +
  7164  			"                     │               └─ keys: ci.person_id\n" +
  7165  			"                     └─ Filter\n" +
  7166  			"                         ├─ (cn.country_code = '[us]')\n" +
  7167  			"                         └─ TableAlias(cn)\n" +
  7168  			"                             └─ Table\n" +
  7169  			"                                 ├─ name: company_name\n" +
  7170  			"                                 └─ columns: [id country_code]\n" +
  7171  			"",
  7172  	},
  7173  	{
  7174  		Query: `
  7175  SELECT MIN(n.name) AS member_in_charnamed_american_movie,
  7176         MIN(n.name) AS a1
  7177  FROM cast_info AS ci,
  7178       company_name AS cn,
  7179       keyword AS k,
  7180       movie_companies AS mc,
  7181       movie_keyword AS mk,
  7182       name AS n,
  7183       title AS t
  7184  WHERE cn.country_code ='[us]'
  7185    AND k.keyword ='character-name-in-title'
  7186    AND n.name LIKE 'B%'
  7187    AND n.id = ci.person_id
  7188    AND ci.movie_id = t.id
  7189    AND t.id = mk.movie_id
  7190    AND mk.keyword_id = k.id
  7191    AND t.id = mc.movie_id
  7192    AND mc.company_id = cn.id
  7193    AND ci.movie_id = mc.movie_id
  7194    AND ci.movie_id = mk.movie_id
  7195    AND mc.movie_id = mk.movie_id;
  7196  
  7197  `,
  7198  		ExpectedPlan: "Project\n" +
  7199  			" ├─ columns: [min(n.name):0!null as member_in_charnamed_american_movie, min(n.name):0!null as a1]\n" +
  7200  			" └─ GroupBy\n" +
  7201  			"     ├─ select: MIN(n.name:11!null)\n" +
  7202  			"     ├─ group: \n" +
  7203  			"     └─ HashJoin\n" +
  7204  			"         ├─ AND\n" +
  7205  			"         │   ├─ AND\n" +
  7206  			"         │   │   ├─ Eq\n" +
  7207  			"         │   │   │   ├─ ci.movie_id:9!null\n" +
  7208  			"         │   │   │   └─ t.id:12!null\n" +
  7209  			"         │   │   └─ Eq\n" +
  7210  			"         │   │       ├─ t.id:12!null\n" +
  7211  			"         │   │       └─ mk.movie_id:4!null\n" +
  7212  			"         │   └─ Eq\n" +
  7213  			"         │       ├─ t.id:12!null\n" +
  7214  			"         │       └─ mc.movie_id:6!null\n" +
  7215  			"         ├─ HashJoin\n" +
  7216  			"         │   ├─ Eq\n" +
  7217  			"         │   │   ├─ n.id:10!null\n" +
  7218  			"         │   │   └─ ci.person_id:8!null\n" +
  7219  			"         │   ├─ HashJoin\n" +
  7220  			"         │   │   ├─ Eq\n" +
  7221  			"         │   │   │   ├─ mk.keyword_id:5!null\n" +
  7222  			"         │   │   │   └─ k.id:0!null\n" +
  7223  			"         │   │   ├─ Filter\n" +
  7224  			"         │   │   │   ├─ Eq\n" +
  7225  			"         │   │   │   │   ├─ k.keyword:1!null\n" +
  7226  			"         │   │   │   │   └─ character-name-in-title (longtext)\n" +
  7227  			"         │   │   │   └─ TableAlias(k)\n" +
  7228  			"         │   │   │       └─ ProcessTable\n" +
  7229  			"         │   │   │           └─ Table\n" +
  7230  			"         │   │   │               ├─ name: keyword\n" +
  7231  			"         │   │   │               └─ columns: [id keyword]\n" +
  7232  			"         │   │   └─ HashLookup\n" +
  7233  			"         │   │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  7234  			"         │   │       ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
  7235  			"         │   │       └─ HashJoin\n" +
  7236  			"         │   │           ├─ Eq\n" +
  7237  			"         │   │           │   ├─ mc.company_id:7!null\n" +
  7238  			"         │   │           │   └─ cn.id:2!null\n" +
  7239  			"         │   │           ├─ Filter\n" +
  7240  			"         │   │           │   ├─ Eq\n" +
  7241  			"         │   │           │   │   ├─ cn.country_code:1\n" +
  7242  			"         │   │           │   │   └─ [us] (longtext)\n" +
  7243  			"         │   │           │   └─ TableAlias(cn)\n" +
  7244  			"         │   │           │       └─ ProcessTable\n" +
  7245  			"         │   │           │           └─ Table\n" +
  7246  			"         │   │           │               ├─ name: company_name\n" +
  7247  			"         │   │           │               └─ columns: [id country_code]\n" +
  7248  			"         │   │           └─ HashLookup\n" +
  7249  			"         │   │               ├─ left-key: TUPLE(cn.id:2!null)\n" +
  7250  			"         │   │               ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
  7251  			"         │   │               └─ LookupJoin\n" +
  7252  			"         │   │                   ├─ InnerJoin\n" +
  7253  			"         │   │                   │   ├─ Eq\n" +
  7254  			"         │   │                   │   │   ├─ mc.movie_id:6!null\n" +
  7255  			"         │   │                   │   │   └─ mk.movie_id:4!null\n" +
  7256  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7257  			"         │   │                   │   │   └─ ProcessTable\n" +
  7258  			"         │   │                   │   │       └─ Table\n" +
  7259  			"         │   │                   │   │           ├─ name: movie_keyword\n" +
  7260  			"         │   │                   │   │           └─ columns: [movie_id keyword_id]\n" +
  7261  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7262  			"         │   │                   │       └─ ProcessTable\n" +
  7263  			"         │   │                   │           └─ Table\n" +
  7264  			"         │   │                   │               ├─ name: movie_companies\n" +
  7265  			"         │   │                   │               └─ columns: [movie_id company_id]\n" +
  7266  			"         │   │                   └─ TableAlias(ci)\n" +
  7267  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7268  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7269  			"         │   │                           ├─ keys: [mc.movie_id:6!null]\n" +
  7270  			"         │   │                           ├─ colSet: (1-7)\n" +
  7271  			"         │   │                           ├─ tableId: 1\n" +
  7272  			"         │   │                           └─ Table\n" +
  7273  			"         │   │                               ├─ name: cast_info\n" +
  7274  			"         │   │                               └─ columns: [person_id movie_id]\n" +
  7275  			"         │   └─ HashLookup\n" +
  7276  			"         │       ├─ left-key: TUPLE(ci.person_id:8!null)\n" +
  7277  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  7278  			"         │       └─ Filter\n" +
  7279  			"         │           ├─ AND\n" +
  7280  			"         │           │   ├─ GreaterThanOrEqual\n" +
  7281  			"         │           │   │   ├─ n.name:1!null\n" +
  7282  			"         │           │   │   └─ B (longtext)\n" +
  7283  			"         │           │   └─ LessThanOrEqual\n" +
  7284  			"         │           │       ├─ n.name:1!null\n" +
  7285  			"         │           │       └─ Bÿ (longtext)\n" +
  7286  			"         │           └─ TableAlias(n)\n" +
  7287  			"         │               └─ ProcessTable\n" +
  7288  			"         │                   └─ Table\n" +
  7289  			"         │                       ├─ name: name\n" +
  7290  			"         │                       └─ columns: [id name]\n" +
  7291  			"         └─ HashLookup\n" +
  7292  			"             ├─ left-key: TUPLE(ci.movie_id:9!null, mk.movie_id:4!null, mc.movie_id:6!null)\n" +
  7293  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  7294  			"             └─ TableAlias(t)\n" +
  7295  			"                 └─ ProcessTable\n" +
  7296  			"                     └─ Table\n" +
  7297  			"                         ├─ name: title\n" +
  7298  			"                         └─ columns: [id]\n" +
  7299  			"",
  7300  		ExpectedEstimates: "Project\n" +
  7301  			" ├─ columns: [min(n.name) as member_in_charnamed_american_movie, min(n.name) as a1]\n" +
  7302  			" └─ GroupBy\n" +
  7303  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  7304  			"     ├─ Grouping()\n" +
  7305  			"     └─ HashJoin\n" +
  7306  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7307  			"         ├─ HashJoin\n" +
  7308  			"         │   ├─ (n.id = ci.person_id)\n" +
  7309  			"         │   ├─ HashJoin\n" +
  7310  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  7311  			"         │   │   ├─ Filter\n" +
  7312  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  7313  			"         │   │   │   └─ TableAlias(k)\n" +
  7314  			"         │   │   │       └─ Table\n" +
  7315  			"         │   │   │           ├─ name: keyword\n" +
  7316  			"         │   │   │           └─ columns: [id keyword]\n" +
  7317  			"         │   │   └─ HashLookup\n" +
  7318  			"         │   │       ├─ left-key: (k.id)\n" +
  7319  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  7320  			"         │   │       └─ HashJoin\n" +
  7321  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  7322  			"         │   │           ├─ Filter\n" +
  7323  			"         │   │           │   ├─ (cn.country_code = '[us]')\n" +
  7324  			"         │   │           │   └─ TableAlias(cn)\n" +
  7325  			"         │   │           │       └─ Table\n" +
  7326  			"         │   │           │           ├─ name: company_name\n" +
  7327  			"         │   │           │           └─ columns: [id country_code]\n" +
  7328  			"         │   │           └─ HashLookup\n" +
  7329  			"         │   │               ├─ left-key: (cn.id)\n" +
  7330  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  7331  			"         │   │               └─ LookupJoin\n" +
  7332  			"         │   │                   ├─ InnerJoin\n" +
  7333  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  7334  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7335  			"         │   │                   │   │   └─ Table\n" +
  7336  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  7337  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  7338  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7339  			"         │   │                   │       └─ Table\n" +
  7340  			"         │   │                   │           ├─ name: movie_companies\n" +
  7341  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  7342  			"         │   │                   └─ TableAlias(ci)\n" +
  7343  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7344  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7345  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  7346  			"         │   │                           └─ keys: mc.movie_id\n" +
  7347  			"         │   └─ HashLookup\n" +
  7348  			"         │       ├─ left-key: (ci.person_id)\n" +
  7349  			"         │       ├─ right-key: (n.id)\n" +
  7350  			"         │       └─ Filter\n" +
  7351  			"         │           ├─ ((n.name >= 'B') AND (n.name <= 'Bÿ'))\n" +
  7352  			"         │           └─ TableAlias(n)\n" +
  7353  			"         │               └─ Table\n" +
  7354  			"         │                   ├─ name: name\n" +
  7355  			"         │                   └─ columns: [id name]\n" +
  7356  			"         └─ HashLookup\n" +
  7357  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  7358  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  7359  			"             └─ TableAlias(t)\n" +
  7360  			"                 └─ Table\n" +
  7361  			"                     ├─ name: title\n" +
  7362  			"                     └─ columns: [id]\n" +
  7363  			"",
  7364  		ExpectedAnalysis: "Project\n" +
  7365  			" ├─ columns: [min(n.name) as member_in_charnamed_american_movie, min(n.name) as a1]\n" +
  7366  			" └─ GroupBy\n" +
  7367  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  7368  			"     ├─ Grouping()\n" +
  7369  			"     └─ HashJoin\n" +
  7370  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7371  			"         ├─ HashJoin\n" +
  7372  			"         │   ├─ (n.id = ci.person_id)\n" +
  7373  			"         │   ├─ HashJoin\n" +
  7374  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  7375  			"         │   │   ├─ Filter\n" +
  7376  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  7377  			"         │   │   │   └─ TableAlias(k)\n" +
  7378  			"         │   │   │       └─ Table\n" +
  7379  			"         │   │   │           ├─ name: keyword\n" +
  7380  			"         │   │   │           └─ columns: [id keyword]\n" +
  7381  			"         │   │   └─ HashLookup\n" +
  7382  			"         │   │       ├─ left-key: (k.id)\n" +
  7383  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  7384  			"         │   │       └─ HashJoin\n" +
  7385  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  7386  			"         │   │           ├─ Filter\n" +
  7387  			"         │   │           │   ├─ (cn.country_code = '[us]')\n" +
  7388  			"         │   │           │   └─ TableAlias(cn)\n" +
  7389  			"         │   │           │       └─ Table\n" +
  7390  			"         │   │           │           ├─ name: company_name\n" +
  7391  			"         │   │           │           └─ columns: [id country_code]\n" +
  7392  			"         │   │           └─ HashLookup\n" +
  7393  			"         │   │               ├─ left-key: (cn.id)\n" +
  7394  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  7395  			"         │   │               └─ LookupJoin\n" +
  7396  			"         │   │                   ├─ InnerJoin\n" +
  7397  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  7398  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7399  			"         │   │                   │   │   └─ Table\n" +
  7400  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  7401  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  7402  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7403  			"         │   │                   │       └─ Table\n" +
  7404  			"         │   │                   │           ├─ name: movie_companies\n" +
  7405  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  7406  			"         │   │                   └─ TableAlias(ci)\n" +
  7407  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7408  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7409  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  7410  			"         │   │                           └─ keys: mc.movie_id\n" +
  7411  			"         │   └─ HashLookup\n" +
  7412  			"         │       ├─ left-key: (ci.person_id)\n" +
  7413  			"         │       ├─ right-key: (n.id)\n" +
  7414  			"         │       └─ Filter\n" +
  7415  			"         │           ├─ ((n.name >= 'B') AND (n.name <= 'Bÿ'))\n" +
  7416  			"         │           └─ TableAlias(n)\n" +
  7417  			"         │               └─ Table\n" +
  7418  			"         │                   ├─ name: name\n" +
  7419  			"         │                   └─ columns: [id name]\n" +
  7420  			"         └─ HashLookup\n" +
  7421  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  7422  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  7423  			"             └─ TableAlias(t)\n" +
  7424  			"                 └─ Table\n" +
  7425  			"                     ├─ name: title\n" +
  7426  			"                     └─ columns: [id]\n" +
  7427  			"",
  7428  	},
  7429  	{
  7430  		Query: `
  7431  SELECT MIN(n.name) AS member_in_charnamed_movie,
  7432         MIN(n.name) AS a1
  7433  FROM cast_info AS ci,
  7434       company_name AS cn,
  7435       keyword AS k,
  7436       movie_companies AS mc,
  7437       movie_keyword AS mk,
  7438       name AS n,
  7439       title AS t
  7440  WHERE k.keyword ='character-name-in-title'
  7441    AND n.name LIKE 'Z%'
  7442    AND n.id = ci.person_id
  7443    AND ci.movie_id = t.id
  7444    AND t.id = mk.movie_id
  7445    AND mk.keyword_id = k.id
  7446    AND t.id = mc.movie_id
  7447    AND mc.company_id = cn.id
  7448    AND ci.movie_id = mc.movie_id
  7449    AND ci.movie_id = mk.movie_id
  7450    AND mc.movie_id = mk.movie_id;
  7451  
  7452  `,
  7453  		ExpectedPlan: "Project\n" +
  7454  			" ├─ columns: [min(n.name):0!null as member_in_charnamed_movie, min(n.name):0!null as a1]\n" +
  7455  			" └─ GroupBy\n" +
  7456  			"     ├─ select: MIN(n.name:10!null)\n" +
  7457  			"     ├─ group: \n" +
  7458  			"     └─ HashJoin\n" +
  7459  			"         ├─ AND\n" +
  7460  			"         │   ├─ AND\n" +
  7461  			"         │   │   ├─ Eq\n" +
  7462  			"         │   │   │   ├─ ci.movie_id:8!null\n" +
  7463  			"         │   │   │   └─ t.id:11!null\n" +
  7464  			"         │   │   └─ Eq\n" +
  7465  			"         │   │       ├─ t.id:11!null\n" +
  7466  			"         │   │       └─ mk.movie_id:3!null\n" +
  7467  			"         │   └─ Eq\n" +
  7468  			"         │       ├─ t.id:11!null\n" +
  7469  			"         │       └─ mc.movie_id:5!null\n" +
  7470  			"         ├─ HashJoin\n" +
  7471  			"         │   ├─ Eq\n" +
  7472  			"         │   │   ├─ n.id:9!null\n" +
  7473  			"         │   │   └─ ci.person_id:7!null\n" +
  7474  			"         │   ├─ HashJoin\n" +
  7475  			"         │   │   ├─ Eq\n" +
  7476  			"         │   │   │   ├─ mk.keyword_id:4!null\n" +
  7477  			"         │   │   │   └─ k.id:0!null\n" +
  7478  			"         │   │   ├─ Filter\n" +
  7479  			"         │   │   │   ├─ Eq\n" +
  7480  			"         │   │   │   │   ├─ k.keyword:1!null\n" +
  7481  			"         │   │   │   │   └─ character-name-in-title (longtext)\n" +
  7482  			"         │   │   │   └─ TableAlias(k)\n" +
  7483  			"         │   │   │       └─ ProcessTable\n" +
  7484  			"         │   │   │           └─ Table\n" +
  7485  			"         │   │   │               ├─ name: keyword\n" +
  7486  			"         │   │   │               └─ columns: [id keyword]\n" +
  7487  			"         │   │   └─ HashLookup\n" +
  7488  			"         │   │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  7489  			"         │   │       ├─ right-key: TUPLE(mk.keyword_id:2!null)\n" +
  7490  			"         │   │       └─ HashJoin\n" +
  7491  			"         │   │           ├─ Eq\n" +
  7492  			"         │   │           │   ├─ mc.company_id:6!null\n" +
  7493  			"         │   │           │   └─ cn.id:2!null\n" +
  7494  			"         │   │           ├─ TableAlias(cn)\n" +
  7495  			"         │   │           │   └─ ProcessTable\n" +
  7496  			"         │   │           │       └─ Table\n" +
  7497  			"         │   │           │           ├─ name: company_name\n" +
  7498  			"         │   │           │           └─ columns: [id]\n" +
  7499  			"         │   │           └─ HashLookup\n" +
  7500  			"         │   │               ├─ left-key: TUPLE(cn.id:2!null)\n" +
  7501  			"         │   │               ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
  7502  			"         │   │               └─ LookupJoin\n" +
  7503  			"         │   │                   ├─ InnerJoin\n" +
  7504  			"         │   │                   │   ├─ Eq\n" +
  7505  			"         │   │                   │   │   ├─ mc.movie_id:5!null\n" +
  7506  			"         │   │                   │   │   └─ mk.movie_id:3!null\n" +
  7507  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7508  			"         │   │                   │   │   └─ ProcessTable\n" +
  7509  			"         │   │                   │   │       └─ Table\n" +
  7510  			"         │   │                   │   │           ├─ name: movie_keyword\n" +
  7511  			"         │   │                   │   │           └─ columns: [movie_id keyword_id]\n" +
  7512  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7513  			"         │   │                   │       └─ ProcessTable\n" +
  7514  			"         │   │                   │           └─ Table\n" +
  7515  			"         │   │                   │               ├─ name: movie_companies\n" +
  7516  			"         │   │                   │               └─ columns: [movie_id company_id]\n" +
  7517  			"         │   │                   └─ TableAlias(ci)\n" +
  7518  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7519  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7520  			"         │   │                           ├─ keys: [mc.movie_id:5!null]\n" +
  7521  			"         │   │                           ├─ colSet: (1-7)\n" +
  7522  			"         │   │                           ├─ tableId: 1\n" +
  7523  			"         │   │                           └─ Table\n" +
  7524  			"         │   │                               ├─ name: cast_info\n" +
  7525  			"         │   │                               └─ columns: [person_id movie_id]\n" +
  7526  			"         │   └─ HashLookup\n" +
  7527  			"         │       ├─ left-key: TUPLE(ci.person_id:7!null)\n" +
  7528  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  7529  			"         │       └─ Filter\n" +
  7530  			"         │           ├─ AND\n" +
  7531  			"         │           │   ├─ GreaterThanOrEqual\n" +
  7532  			"         │           │   │   ├─ n.name:1!null\n" +
  7533  			"         │           │   │   └─ Z (longtext)\n" +
  7534  			"         │           │   └─ LessThanOrEqual\n" +
  7535  			"         │           │       ├─ n.name:1!null\n" +
  7536  			"         │           │       └─ Zÿ (longtext)\n" +
  7537  			"         │           └─ TableAlias(n)\n" +
  7538  			"         │               └─ ProcessTable\n" +
  7539  			"         │                   └─ Table\n" +
  7540  			"         │                       ├─ name: name\n" +
  7541  			"         │                       └─ columns: [id name]\n" +
  7542  			"         └─ HashLookup\n" +
  7543  			"             ├─ left-key: TUPLE(ci.movie_id:8!null, mk.movie_id:3!null, mc.movie_id:5!null)\n" +
  7544  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  7545  			"             └─ TableAlias(t)\n" +
  7546  			"                 └─ ProcessTable\n" +
  7547  			"                     └─ Table\n" +
  7548  			"                         ├─ name: title\n" +
  7549  			"                         └─ columns: [id]\n" +
  7550  			"",
  7551  		ExpectedEstimates: "Project\n" +
  7552  			" ├─ columns: [min(n.name) as member_in_charnamed_movie, min(n.name) as a1]\n" +
  7553  			" └─ GroupBy\n" +
  7554  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  7555  			"     ├─ Grouping()\n" +
  7556  			"     └─ HashJoin\n" +
  7557  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7558  			"         ├─ HashJoin\n" +
  7559  			"         │   ├─ (n.id = ci.person_id)\n" +
  7560  			"         │   ├─ HashJoin\n" +
  7561  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  7562  			"         │   │   ├─ Filter\n" +
  7563  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  7564  			"         │   │   │   └─ TableAlias(k)\n" +
  7565  			"         │   │   │       └─ Table\n" +
  7566  			"         │   │   │           ├─ name: keyword\n" +
  7567  			"         │   │   │           └─ columns: [id keyword]\n" +
  7568  			"         │   │   └─ HashLookup\n" +
  7569  			"         │   │       ├─ left-key: (k.id)\n" +
  7570  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  7571  			"         │   │       └─ HashJoin\n" +
  7572  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  7573  			"         │   │           ├─ TableAlias(cn)\n" +
  7574  			"         │   │           │   └─ Table\n" +
  7575  			"         │   │           │       ├─ name: company_name\n" +
  7576  			"         │   │           │       └─ columns: [id]\n" +
  7577  			"         │   │           └─ HashLookup\n" +
  7578  			"         │   │               ├─ left-key: (cn.id)\n" +
  7579  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  7580  			"         │   │               └─ LookupJoin\n" +
  7581  			"         │   │                   ├─ InnerJoin\n" +
  7582  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  7583  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7584  			"         │   │                   │   │   └─ Table\n" +
  7585  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  7586  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  7587  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7588  			"         │   │                   │       └─ Table\n" +
  7589  			"         │   │                   │           ├─ name: movie_companies\n" +
  7590  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  7591  			"         │   │                   └─ TableAlias(ci)\n" +
  7592  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7593  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7594  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  7595  			"         │   │                           └─ keys: mc.movie_id\n" +
  7596  			"         │   └─ HashLookup\n" +
  7597  			"         │       ├─ left-key: (ci.person_id)\n" +
  7598  			"         │       ├─ right-key: (n.id)\n" +
  7599  			"         │       └─ Filter\n" +
  7600  			"         │           ├─ ((n.name >= 'Z') AND (n.name <= 'Zÿ'))\n" +
  7601  			"         │           └─ TableAlias(n)\n" +
  7602  			"         │               └─ Table\n" +
  7603  			"         │                   ├─ name: name\n" +
  7604  			"         │                   └─ columns: [id name]\n" +
  7605  			"         └─ HashLookup\n" +
  7606  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  7607  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  7608  			"             └─ TableAlias(t)\n" +
  7609  			"                 └─ Table\n" +
  7610  			"                     ├─ name: title\n" +
  7611  			"                     └─ columns: [id]\n" +
  7612  			"",
  7613  		ExpectedAnalysis: "Project\n" +
  7614  			" ├─ columns: [min(n.name) as member_in_charnamed_movie, min(n.name) as a1]\n" +
  7615  			" └─ GroupBy\n" +
  7616  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  7617  			"     ├─ Grouping()\n" +
  7618  			"     └─ HashJoin\n" +
  7619  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7620  			"         ├─ HashJoin\n" +
  7621  			"         │   ├─ (n.id = ci.person_id)\n" +
  7622  			"         │   ├─ HashJoin\n" +
  7623  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  7624  			"         │   │   ├─ Filter\n" +
  7625  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  7626  			"         │   │   │   └─ TableAlias(k)\n" +
  7627  			"         │   │   │       └─ Table\n" +
  7628  			"         │   │   │           ├─ name: keyword\n" +
  7629  			"         │   │   │           └─ columns: [id keyword]\n" +
  7630  			"         │   │   └─ HashLookup\n" +
  7631  			"         │   │       ├─ left-key: (k.id)\n" +
  7632  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  7633  			"         │   │       └─ HashJoin\n" +
  7634  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  7635  			"         │   │           ├─ TableAlias(cn)\n" +
  7636  			"         │   │           │   └─ Table\n" +
  7637  			"         │   │           │       ├─ name: company_name\n" +
  7638  			"         │   │           │       └─ columns: [id]\n" +
  7639  			"         │   │           └─ HashLookup\n" +
  7640  			"         │   │               ├─ left-key: (cn.id)\n" +
  7641  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  7642  			"         │   │               └─ LookupJoin\n" +
  7643  			"         │   │                   ├─ InnerJoin\n" +
  7644  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  7645  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7646  			"         │   │                   │   │   └─ Table\n" +
  7647  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  7648  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  7649  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7650  			"         │   │                   │       └─ Table\n" +
  7651  			"         │   │                   │           ├─ name: movie_companies\n" +
  7652  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  7653  			"         │   │                   └─ TableAlias(ci)\n" +
  7654  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7655  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7656  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  7657  			"         │   │                           └─ keys: mc.movie_id\n" +
  7658  			"         │   └─ HashLookup\n" +
  7659  			"         │       ├─ left-key: (ci.person_id)\n" +
  7660  			"         │       ├─ right-key: (n.id)\n" +
  7661  			"         │       └─ Filter\n" +
  7662  			"         │           ├─ ((n.name >= 'Z') AND (n.name <= 'Zÿ'))\n" +
  7663  			"         │           └─ TableAlias(n)\n" +
  7664  			"         │               └─ Table\n" +
  7665  			"         │                   ├─ name: name\n" +
  7666  			"         │                   └─ columns: [id name]\n" +
  7667  			"         └─ HashLookup\n" +
  7668  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  7669  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  7670  			"             └─ TableAlias(t)\n" +
  7671  			"                 └─ Table\n" +
  7672  			"                     ├─ name: title\n" +
  7673  			"                     └─ columns: [id]\n" +
  7674  			"",
  7675  	},
  7676  	{
  7677  		Query: `
  7678  SELECT MIN(n.name) AS member_in_charnamed_movie,
  7679         MIN(n.name) AS a1
  7680  FROM cast_info AS ci,
  7681       company_name AS cn,
  7682       keyword AS k,
  7683       movie_companies AS mc,
  7684       movie_keyword AS mk,
  7685       name AS n,
  7686       title AS t
  7687  WHERE k.keyword ='character-name-in-title'
  7688    AND n.name LIKE 'X%'
  7689    AND n.id = ci.person_id
  7690    AND ci.movie_id = t.id
  7691    AND t.id = mk.movie_id
  7692    AND mk.keyword_id = k.id
  7693    AND t.id = mc.movie_id
  7694    AND mc.company_id = cn.id
  7695    AND ci.movie_id = mc.movie_id
  7696    AND ci.movie_id = mk.movie_id
  7697    AND mc.movie_id = mk.movie_id;
  7698  
  7699  `,
  7700  		ExpectedPlan: "Project\n" +
  7701  			" ├─ columns: [min(n.name):0!null as member_in_charnamed_movie, min(n.name):0!null as a1]\n" +
  7702  			" └─ GroupBy\n" +
  7703  			"     ├─ select: MIN(n.name:10!null)\n" +
  7704  			"     ├─ group: \n" +
  7705  			"     └─ HashJoin\n" +
  7706  			"         ├─ AND\n" +
  7707  			"         │   ├─ AND\n" +
  7708  			"         │   │   ├─ Eq\n" +
  7709  			"         │   │   │   ├─ ci.movie_id:8!null\n" +
  7710  			"         │   │   │   └─ t.id:11!null\n" +
  7711  			"         │   │   └─ Eq\n" +
  7712  			"         │   │       ├─ t.id:11!null\n" +
  7713  			"         │   │       └─ mk.movie_id:3!null\n" +
  7714  			"         │   └─ Eq\n" +
  7715  			"         │       ├─ t.id:11!null\n" +
  7716  			"         │       └─ mc.movie_id:5!null\n" +
  7717  			"         ├─ HashJoin\n" +
  7718  			"         │   ├─ Eq\n" +
  7719  			"         │   │   ├─ n.id:9!null\n" +
  7720  			"         │   │   └─ ci.person_id:7!null\n" +
  7721  			"         │   ├─ HashJoin\n" +
  7722  			"         │   │   ├─ Eq\n" +
  7723  			"         │   │   │   ├─ mk.keyword_id:4!null\n" +
  7724  			"         │   │   │   └─ k.id:0!null\n" +
  7725  			"         │   │   ├─ Filter\n" +
  7726  			"         │   │   │   ├─ Eq\n" +
  7727  			"         │   │   │   │   ├─ k.keyword:1!null\n" +
  7728  			"         │   │   │   │   └─ character-name-in-title (longtext)\n" +
  7729  			"         │   │   │   └─ TableAlias(k)\n" +
  7730  			"         │   │   │       └─ ProcessTable\n" +
  7731  			"         │   │   │           └─ Table\n" +
  7732  			"         │   │   │               ├─ name: keyword\n" +
  7733  			"         │   │   │               └─ columns: [id keyword]\n" +
  7734  			"         │   │   └─ HashLookup\n" +
  7735  			"         │   │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  7736  			"         │   │       ├─ right-key: TUPLE(mk.keyword_id:2!null)\n" +
  7737  			"         │   │       └─ HashJoin\n" +
  7738  			"         │   │           ├─ Eq\n" +
  7739  			"         │   │           │   ├─ mc.company_id:6!null\n" +
  7740  			"         │   │           │   └─ cn.id:2!null\n" +
  7741  			"         │   │           ├─ TableAlias(cn)\n" +
  7742  			"         │   │           │   └─ ProcessTable\n" +
  7743  			"         │   │           │       └─ Table\n" +
  7744  			"         │   │           │           ├─ name: company_name\n" +
  7745  			"         │   │           │           └─ columns: [id]\n" +
  7746  			"         │   │           └─ HashLookup\n" +
  7747  			"         │   │               ├─ left-key: TUPLE(cn.id:2!null)\n" +
  7748  			"         │   │               ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
  7749  			"         │   │               └─ LookupJoin\n" +
  7750  			"         │   │                   ├─ InnerJoin\n" +
  7751  			"         │   │                   │   ├─ Eq\n" +
  7752  			"         │   │                   │   │   ├─ mc.movie_id:5!null\n" +
  7753  			"         │   │                   │   │   └─ mk.movie_id:3!null\n" +
  7754  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7755  			"         │   │                   │   │   └─ ProcessTable\n" +
  7756  			"         │   │                   │   │       └─ Table\n" +
  7757  			"         │   │                   │   │           ├─ name: movie_keyword\n" +
  7758  			"         │   │                   │   │           └─ columns: [movie_id keyword_id]\n" +
  7759  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7760  			"         │   │                   │       └─ ProcessTable\n" +
  7761  			"         │   │                   │           └─ Table\n" +
  7762  			"         │   │                   │               ├─ name: movie_companies\n" +
  7763  			"         │   │                   │               └─ columns: [movie_id company_id]\n" +
  7764  			"         │   │                   └─ TableAlias(ci)\n" +
  7765  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7766  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7767  			"         │   │                           ├─ keys: [mc.movie_id:5!null]\n" +
  7768  			"         │   │                           ├─ colSet: (1-7)\n" +
  7769  			"         │   │                           ├─ tableId: 1\n" +
  7770  			"         │   │                           └─ Table\n" +
  7771  			"         │   │                               ├─ name: cast_info\n" +
  7772  			"         │   │                               └─ columns: [person_id movie_id]\n" +
  7773  			"         │   └─ HashLookup\n" +
  7774  			"         │       ├─ left-key: TUPLE(ci.person_id:7!null)\n" +
  7775  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  7776  			"         │       └─ Filter\n" +
  7777  			"         │           ├─ AND\n" +
  7778  			"         │           │   ├─ GreaterThanOrEqual\n" +
  7779  			"         │           │   │   ├─ n.name:1!null\n" +
  7780  			"         │           │   │   └─ X (longtext)\n" +
  7781  			"         │           │   └─ LessThanOrEqual\n" +
  7782  			"         │           │       ├─ n.name:1!null\n" +
  7783  			"         │           │       └─ Xÿ (longtext)\n" +
  7784  			"         │           └─ TableAlias(n)\n" +
  7785  			"         │               └─ ProcessTable\n" +
  7786  			"         │                   └─ Table\n" +
  7787  			"         │                       ├─ name: name\n" +
  7788  			"         │                       └─ columns: [id name]\n" +
  7789  			"         └─ HashLookup\n" +
  7790  			"             ├─ left-key: TUPLE(ci.movie_id:8!null, mk.movie_id:3!null, mc.movie_id:5!null)\n" +
  7791  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  7792  			"             └─ TableAlias(t)\n" +
  7793  			"                 └─ ProcessTable\n" +
  7794  			"                     └─ Table\n" +
  7795  			"                         ├─ name: title\n" +
  7796  			"                         └─ columns: [id]\n" +
  7797  			"",
  7798  		ExpectedEstimates: "Project\n" +
  7799  			" ├─ columns: [min(n.name) as member_in_charnamed_movie, min(n.name) as a1]\n" +
  7800  			" └─ GroupBy\n" +
  7801  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  7802  			"     ├─ Grouping()\n" +
  7803  			"     └─ HashJoin\n" +
  7804  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7805  			"         ├─ HashJoin\n" +
  7806  			"         │   ├─ (n.id = ci.person_id)\n" +
  7807  			"         │   ├─ HashJoin\n" +
  7808  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  7809  			"         │   │   ├─ Filter\n" +
  7810  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  7811  			"         │   │   │   └─ TableAlias(k)\n" +
  7812  			"         │   │   │       └─ Table\n" +
  7813  			"         │   │   │           ├─ name: keyword\n" +
  7814  			"         │   │   │           └─ columns: [id keyword]\n" +
  7815  			"         │   │   └─ HashLookup\n" +
  7816  			"         │   │       ├─ left-key: (k.id)\n" +
  7817  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  7818  			"         │   │       └─ HashJoin\n" +
  7819  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  7820  			"         │   │           ├─ TableAlias(cn)\n" +
  7821  			"         │   │           │   └─ Table\n" +
  7822  			"         │   │           │       ├─ name: company_name\n" +
  7823  			"         │   │           │       └─ columns: [id]\n" +
  7824  			"         │   │           └─ HashLookup\n" +
  7825  			"         │   │               ├─ left-key: (cn.id)\n" +
  7826  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  7827  			"         │   │               └─ LookupJoin\n" +
  7828  			"         │   │                   ├─ InnerJoin\n" +
  7829  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  7830  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7831  			"         │   │                   │   │   └─ Table\n" +
  7832  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  7833  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  7834  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7835  			"         │   │                   │       └─ Table\n" +
  7836  			"         │   │                   │           ├─ name: movie_companies\n" +
  7837  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  7838  			"         │   │                   └─ TableAlias(ci)\n" +
  7839  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7840  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7841  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  7842  			"         │   │                           └─ keys: mc.movie_id\n" +
  7843  			"         │   └─ HashLookup\n" +
  7844  			"         │       ├─ left-key: (ci.person_id)\n" +
  7845  			"         │       ├─ right-key: (n.id)\n" +
  7846  			"         │       └─ Filter\n" +
  7847  			"         │           ├─ ((n.name >= 'X') AND (n.name <= 'Xÿ'))\n" +
  7848  			"         │           └─ TableAlias(n)\n" +
  7849  			"         │               └─ Table\n" +
  7850  			"         │                   ├─ name: name\n" +
  7851  			"         │                   └─ columns: [id name]\n" +
  7852  			"         └─ HashLookup\n" +
  7853  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  7854  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  7855  			"             └─ TableAlias(t)\n" +
  7856  			"                 └─ Table\n" +
  7857  			"                     ├─ name: title\n" +
  7858  			"                     └─ columns: [id]\n" +
  7859  			"",
  7860  		ExpectedAnalysis: "Project\n" +
  7861  			" ├─ columns: [min(n.name) as member_in_charnamed_movie, min(n.name) as a1]\n" +
  7862  			" └─ GroupBy\n" +
  7863  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  7864  			"     ├─ Grouping()\n" +
  7865  			"     └─ HashJoin\n" +
  7866  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  7867  			"         ├─ HashJoin\n" +
  7868  			"         │   ├─ (n.id = ci.person_id)\n" +
  7869  			"         │   ├─ HashJoin\n" +
  7870  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  7871  			"         │   │   ├─ Filter\n" +
  7872  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  7873  			"         │   │   │   └─ TableAlias(k)\n" +
  7874  			"         │   │   │       └─ Table\n" +
  7875  			"         │   │   │           ├─ name: keyword\n" +
  7876  			"         │   │   │           └─ columns: [id keyword]\n" +
  7877  			"         │   │   └─ HashLookup\n" +
  7878  			"         │   │       ├─ left-key: (k.id)\n" +
  7879  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  7880  			"         │   │       └─ HashJoin\n" +
  7881  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  7882  			"         │   │           ├─ TableAlias(cn)\n" +
  7883  			"         │   │           │   └─ Table\n" +
  7884  			"         │   │           │       ├─ name: company_name\n" +
  7885  			"         │   │           │       └─ columns: [id]\n" +
  7886  			"         │   │           └─ HashLookup\n" +
  7887  			"         │   │               ├─ left-key: (cn.id)\n" +
  7888  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  7889  			"         │   │               └─ LookupJoin\n" +
  7890  			"         │   │                   ├─ InnerJoin\n" +
  7891  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  7892  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  7893  			"         │   │                   │   │   └─ Table\n" +
  7894  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  7895  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  7896  			"         │   │                   │   └─ TableAlias(mc)\n" +
  7897  			"         │   │                   │       └─ Table\n" +
  7898  			"         │   │                   │           ├─ name: movie_companies\n" +
  7899  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  7900  			"         │   │                   └─ TableAlias(ci)\n" +
  7901  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  7902  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  7903  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  7904  			"         │   │                           └─ keys: mc.movie_id\n" +
  7905  			"         │   └─ HashLookup\n" +
  7906  			"         │       ├─ left-key: (ci.person_id)\n" +
  7907  			"         │       ├─ right-key: (n.id)\n" +
  7908  			"         │       └─ Filter\n" +
  7909  			"         │           ├─ ((n.name >= 'X') AND (n.name <= 'Xÿ'))\n" +
  7910  			"         │           └─ TableAlias(n)\n" +
  7911  			"         │               └─ Table\n" +
  7912  			"         │                   ├─ name: name\n" +
  7913  			"         │                   └─ columns: [id name]\n" +
  7914  			"         └─ HashLookup\n" +
  7915  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  7916  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  7917  			"             └─ TableAlias(t)\n" +
  7918  			"                 └─ Table\n" +
  7919  			"                     ├─ name: title\n" +
  7920  			"                     └─ columns: [id]\n" +
  7921  			"",
  7922  	},
  7923  	{
  7924  		Query: `
  7925  SELECT MIN(n.name) AS member_in_charnamed_movie
  7926  FROM cast_info AS ci,
  7927       company_name AS cn,
  7928       keyword AS k,
  7929       movie_companies AS mc,
  7930       movie_keyword AS mk,
  7931       name AS n,
  7932       title AS t
  7933  WHERE k.keyword ='character-name-in-title'
  7934    AND n.name LIKE '%Bert%'
  7935    AND n.id = ci.person_id
  7936    AND ci.movie_id = t.id
  7937    AND t.id = mk.movie_id
  7938    AND mk.keyword_id = k.id
  7939    AND t.id = mc.movie_id
  7940    AND mc.company_id = cn.id
  7941    AND ci.movie_id = mc.movie_id
  7942    AND ci.movie_id = mk.movie_id
  7943    AND mc.movie_id = mk.movie_id;
  7944  
  7945  `,
  7946  		ExpectedPlan: "Project\n" +
  7947  			" ├─ columns: [min(n.name):0!null as member_in_charnamed_movie]\n" +
  7948  			" └─ GroupBy\n" +
  7949  			"     ├─ select: MIN(n.name:10!null)\n" +
  7950  			"     ├─ group: \n" +
  7951  			"     └─ HashJoin\n" +
  7952  			"         ├─ AND\n" +
  7953  			"         │   ├─ AND\n" +
  7954  			"         │   │   ├─ Eq\n" +
  7955  			"         │   │   │   ├─ ci.movie_id:8!null\n" +
  7956  			"         │   │   │   └─ t.id:11!null\n" +
  7957  			"         │   │   └─ Eq\n" +
  7958  			"         │   │       ├─ t.id:11!null\n" +
  7959  			"         │   │       └─ mk.movie_id:3!null\n" +
  7960  			"         │   └─ Eq\n" +
  7961  			"         │       ├─ t.id:11!null\n" +
  7962  			"         │       └─ mc.movie_id:5!null\n" +
  7963  			"         ├─ HashJoin\n" +
  7964  			"         │   ├─ Eq\n" +
  7965  			"         │   │   ├─ n.id:9!null\n" +
  7966  			"         │   │   └─ ci.person_id:7!null\n" +
  7967  			"         │   ├─ HashJoin\n" +
  7968  			"         │   │   ├─ Eq\n" +
  7969  			"         │   │   │   ├─ mk.keyword_id:4!null\n" +
  7970  			"         │   │   │   └─ k.id:0!null\n" +
  7971  			"         │   │   ├─ Filter\n" +
  7972  			"         │   │   │   ├─ Eq\n" +
  7973  			"         │   │   │   │   ├─ k.keyword:1!null\n" +
  7974  			"         │   │   │   │   └─ character-name-in-title (longtext)\n" +
  7975  			"         │   │   │   └─ TableAlias(k)\n" +
  7976  			"         │   │   │       └─ ProcessTable\n" +
  7977  			"         │   │   │           └─ Table\n" +
  7978  			"         │   │   │               ├─ name: keyword\n" +
  7979  			"         │   │   │               └─ columns: [id keyword]\n" +
  7980  			"         │   │   └─ HashLookup\n" +
  7981  			"         │   │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  7982  			"         │   │       ├─ right-key: TUPLE(mk.keyword_id:2!null)\n" +
  7983  			"         │   │       └─ HashJoin\n" +
  7984  			"         │   │           ├─ Eq\n" +
  7985  			"         │   │           │   ├─ mc.company_id:6!null\n" +
  7986  			"         │   │           │   └─ cn.id:2!null\n" +
  7987  			"         │   │           ├─ TableAlias(cn)\n" +
  7988  			"         │   │           │   └─ ProcessTable\n" +
  7989  			"         │   │           │       └─ Table\n" +
  7990  			"         │   │           │           ├─ name: company_name\n" +
  7991  			"         │   │           │           └─ columns: [id]\n" +
  7992  			"         │   │           └─ HashLookup\n" +
  7993  			"         │   │               ├─ left-key: TUPLE(cn.id:2!null)\n" +
  7994  			"         │   │               ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
  7995  			"         │   │               └─ LookupJoin\n" +
  7996  			"         │   │                   ├─ InnerJoin\n" +
  7997  			"         │   │                   │   ├─ Eq\n" +
  7998  			"         │   │                   │   │   ├─ mc.movie_id:5!null\n" +
  7999  			"         │   │                   │   │   └─ mk.movie_id:3!null\n" +
  8000  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8001  			"         │   │                   │   │   └─ ProcessTable\n" +
  8002  			"         │   │                   │   │       └─ Table\n" +
  8003  			"         │   │                   │   │           ├─ name: movie_keyword\n" +
  8004  			"         │   │                   │   │           └─ columns: [movie_id keyword_id]\n" +
  8005  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8006  			"         │   │                   │       └─ ProcessTable\n" +
  8007  			"         │   │                   │           └─ Table\n" +
  8008  			"         │   │                   │               ├─ name: movie_companies\n" +
  8009  			"         │   │                   │               └─ columns: [movie_id company_id]\n" +
  8010  			"         │   │                   └─ TableAlias(ci)\n" +
  8011  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8012  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8013  			"         │   │                           ├─ keys: [mc.movie_id:5!null]\n" +
  8014  			"         │   │                           ├─ colSet: (1-7)\n" +
  8015  			"         │   │                           ├─ tableId: 1\n" +
  8016  			"         │   │                           └─ Table\n" +
  8017  			"         │   │                               ├─ name: cast_info\n" +
  8018  			"         │   │                               └─ columns: [person_id movie_id]\n" +
  8019  			"         │   └─ HashLookup\n" +
  8020  			"         │       ├─ left-key: TUPLE(ci.person_id:7!null)\n" +
  8021  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  8022  			"         │       └─ Filter\n" +
  8023  			"         │           ├─ n.name LIKE '%Bert%'\n" +
  8024  			"         │           └─ TableAlias(n)\n" +
  8025  			"         │               └─ ProcessTable\n" +
  8026  			"         │                   └─ Table\n" +
  8027  			"         │                       ├─ name: name\n" +
  8028  			"         │                       └─ columns: [id name]\n" +
  8029  			"         └─ HashLookup\n" +
  8030  			"             ├─ left-key: TUPLE(ci.movie_id:8!null, mk.movie_id:3!null, mc.movie_id:5!null)\n" +
  8031  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  8032  			"             └─ TableAlias(t)\n" +
  8033  			"                 └─ ProcessTable\n" +
  8034  			"                     └─ Table\n" +
  8035  			"                         ├─ name: title\n" +
  8036  			"                         └─ columns: [id]\n" +
  8037  			"",
  8038  		ExpectedEstimates: "Project\n" +
  8039  			" ├─ columns: [min(n.name) as member_in_charnamed_movie]\n" +
  8040  			" └─ GroupBy\n" +
  8041  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  8042  			"     ├─ Grouping()\n" +
  8043  			"     └─ HashJoin\n" +
  8044  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  8045  			"         ├─ HashJoin\n" +
  8046  			"         │   ├─ (n.id = ci.person_id)\n" +
  8047  			"         │   ├─ HashJoin\n" +
  8048  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  8049  			"         │   │   ├─ Filter\n" +
  8050  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  8051  			"         │   │   │   └─ TableAlias(k)\n" +
  8052  			"         │   │   │       └─ Table\n" +
  8053  			"         │   │   │           ├─ name: keyword\n" +
  8054  			"         │   │   │           └─ columns: [id keyword]\n" +
  8055  			"         │   │   └─ HashLookup\n" +
  8056  			"         │   │       ├─ left-key: (k.id)\n" +
  8057  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  8058  			"         │   │       └─ HashJoin\n" +
  8059  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  8060  			"         │   │           ├─ TableAlias(cn)\n" +
  8061  			"         │   │           │   └─ Table\n" +
  8062  			"         │   │           │       ├─ name: company_name\n" +
  8063  			"         │   │           │       └─ columns: [id]\n" +
  8064  			"         │   │           └─ HashLookup\n" +
  8065  			"         │   │               ├─ left-key: (cn.id)\n" +
  8066  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  8067  			"         │   │               └─ LookupJoin\n" +
  8068  			"         │   │                   ├─ InnerJoin\n" +
  8069  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  8070  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8071  			"         │   │                   │   │   └─ Table\n" +
  8072  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  8073  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  8074  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8075  			"         │   │                   │       └─ Table\n" +
  8076  			"         │   │                   │           ├─ name: movie_companies\n" +
  8077  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  8078  			"         │   │                   └─ TableAlias(ci)\n" +
  8079  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8080  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8081  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  8082  			"         │   │                           └─ keys: mc.movie_id\n" +
  8083  			"         │   └─ HashLookup\n" +
  8084  			"         │       ├─ left-key: (ci.person_id)\n" +
  8085  			"         │       ├─ right-key: (n.id)\n" +
  8086  			"         │       └─ Filter\n" +
  8087  			"         │           ├─ n.name LIKE '%Bert%'\n" +
  8088  			"         │           └─ TableAlias(n)\n" +
  8089  			"         │               └─ Table\n" +
  8090  			"         │                   ├─ name: name\n" +
  8091  			"         │                   └─ columns: [id name]\n" +
  8092  			"         └─ HashLookup\n" +
  8093  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  8094  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8095  			"             └─ TableAlias(t)\n" +
  8096  			"                 └─ Table\n" +
  8097  			"                     ├─ name: title\n" +
  8098  			"                     └─ columns: [id]\n" +
  8099  			"",
  8100  		ExpectedAnalysis: "Project\n" +
  8101  			" ├─ columns: [min(n.name) as member_in_charnamed_movie]\n" +
  8102  			" └─ GroupBy\n" +
  8103  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  8104  			"     ├─ Grouping()\n" +
  8105  			"     └─ HashJoin\n" +
  8106  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  8107  			"         ├─ HashJoin\n" +
  8108  			"         │   ├─ (n.id = ci.person_id)\n" +
  8109  			"         │   ├─ HashJoin\n" +
  8110  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  8111  			"         │   │   ├─ Filter\n" +
  8112  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  8113  			"         │   │   │   └─ TableAlias(k)\n" +
  8114  			"         │   │   │       └─ Table\n" +
  8115  			"         │   │   │           ├─ name: keyword\n" +
  8116  			"         │   │   │           └─ columns: [id keyword]\n" +
  8117  			"         │   │   └─ HashLookup\n" +
  8118  			"         │   │       ├─ left-key: (k.id)\n" +
  8119  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  8120  			"         │   │       └─ HashJoin\n" +
  8121  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  8122  			"         │   │           ├─ TableAlias(cn)\n" +
  8123  			"         │   │           │   └─ Table\n" +
  8124  			"         │   │           │       ├─ name: company_name\n" +
  8125  			"         │   │           │       └─ columns: [id]\n" +
  8126  			"         │   │           └─ HashLookup\n" +
  8127  			"         │   │               ├─ left-key: (cn.id)\n" +
  8128  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  8129  			"         │   │               └─ LookupJoin\n" +
  8130  			"         │   │                   ├─ InnerJoin\n" +
  8131  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  8132  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8133  			"         │   │                   │   │   └─ Table\n" +
  8134  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  8135  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  8136  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8137  			"         │   │                   │       └─ Table\n" +
  8138  			"         │   │                   │           ├─ name: movie_companies\n" +
  8139  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  8140  			"         │   │                   └─ TableAlias(ci)\n" +
  8141  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8142  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8143  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  8144  			"         │   │                           └─ keys: mc.movie_id\n" +
  8145  			"         │   └─ HashLookup\n" +
  8146  			"         │       ├─ left-key: (ci.person_id)\n" +
  8147  			"         │       ├─ right-key: (n.id)\n" +
  8148  			"         │       └─ Filter\n" +
  8149  			"         │           ├─ n.name LIKE '%Bert%'\n" +
  8150  			"         │           └─ TableAlias(n)\n" +
  8151  			"         │               └─ Table\n" +
  8152  			"         │                   ├─ name: name\n" +
  8153  			"         │                   └─ columns: [id name]\n" +
  8154  			"         └─ HashLookup\n" +
  8155  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  8156  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8157  			"             └─ TableAlias(t)\n" +
  8158  			"                 └─ Table\n" +
  8159  			"                     ├─ name: title\n" +
  8160  			"                     └─ columns: [id]\n" +
  8161  			"",
  8162  	},
  8163  	{
  8164  		Query: `
  8165  SELECT MIN(n.name) AS member_in_charnamed_movie
  8166  FROM cast_info AS ci,
  8167       company_name AS cn,
  8168       keyword AS k,
  8169       movie_companies AS mc,
  8170       movie_keyword AS mk,
  8171       name AS n,
  8172       title AS t
  8173  WHERE cn.country_code ='[us]'
  8174    AND k.keyword ='character-name-in-title'
  8175    AND n.id = ci.person_id
  8176    AND ci.movie_id = t.id
  8177    AND t.id = mk.movie_id
  8178    AND mk.keyword_id = k.id
  8179    AND t.id = mc.movie_id
  8180    AND mc.company_id = cn.id
  8181    AND ci.movie_id = mc.movie_id
  8182    AND ci.movie_id = mk.movie_id
  8183    AND mc.movie_id = mk.movie_id;
  8184  
  8185  `,
  8186  		ExpectedPlan: "Project\n" +
  8187  			" ├─ columns: [min(n.name):0!null as member_in_charnamed_movie]\n" +
  8188  			" └─ GroupBy\n" +
  8189  			"     ├─ select: MIN(n.name:11!null)\n" +
  8190  			"     ├─ group: \n" +
  8191  			"     └─ HashJoin\n" +
  8192  			"         ├─ AND\n" +
  8193  			"         │   ├─ AND\n" +
  8194  			"         │   │   ├─ Eq\n" +
  8195  			"         │   │   │   ├─ ci.movie_id:9!null\n" +
  8196  			"         │   │   │   └─ t.id:12!null\n" +
  8197  			"         │   │   └─ Eq\n" +
  8198  			"         │   │       ├─ t.id:12!null\n" +
  8199  			"         │   │       └─ mk.movie_id:4!null\n" +
  8200  			"         │   └─ Eq\n" +
  8201  			"         │       ├─ t.id:12!null\n" +
  8202  			"         │       └─ mc.movie_id:6!null\n" +
  8203  			"         ├─ HashJoin\n" +
  8204  			"         │   ├─ Eq\n" +
  8205  			"         │   │   ├─ n.id:10!null\n" +
  8206  			"         │   │   └─ ci.person_id:8!null\n" +
  8207  			"         │   ├─ HashJoin\n" +
  8208  			"         │   │   ├─ Eq\n" +
  8209  			"         │   │   │   ├─ mk.keyword_id:5!null\n" +
  8210  			"         │   │   │   └─ k.id:0!null\n" +
  8211  			"         │   │   ├─ Filter\n" +
  8212  			"         │   │   │   ├─ Eq\n" +
  8213  			"         │   │   │   │   ├─ k.keyword:1!null\n" +
  8214  			"         │   │   │   │   └─ character-name-in-title (longtext)\n" +
  8215  			"         │   │   │   └─ TableAlias(k)\n" +
  8216  			"         │   │   │       └─ ProcessTable\n" +
  8217  			"         │   │   │           └─ Table\n" +
  8218  			"         │   │   │               ├─ name: keyword\n" +
  8219  			"         │   │   │               └─ columns: [id keyword]\n" +
  8220  			"         │   │   └─ HashLookup\n" +
  8221  			"         │   │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  8222  			"         │   │       ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
  8223  			"         │   │       └─ HashJoin\n" +
  8224  			"         │   │           ├─ Eq\n" +
  8225  			"         │   │           │   ├─ mc.company_id:7!null\n" +
  8226  			"         │   │           │   └─ cn.id:2!null\n" +
  8227  			"         │   │           ├─ Filter\n" +
  8228  			"         │   │           │   ├─ Eq\n" +
  8229  			"         │   │           │   │   ├─ cn.country_code:1\n" +
  8230  			"         │   │           │   │   └─ [us] (longtext)\n" +
  8231  			"         │   │           │   └─ TableAlias(cn)\n" +
  8232  			"         │   │           │       └─ ProcessTable\n" +
  8233  			"         │   │           │           └─ Table\n" +
  8234  			"         │   │           │               ├─ name: company_name\n" +
  8235  			"         │   │           │               └─ columns: [id country_code]\n" +
  8236  			"         │   │           └─ HashLookup\n" +
  8237  			"         │   │               ├─ left-key: TUPLE(cn.id:2!null)\n" +
  8238  			"         │   │               ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
  8239  			"         │   │               └─ LookupJoin\n" +
  8240  			"         │   │                   ├─ InnerJoin\n" +
  8241  			"         │   │                   │   ├─ Eq\n" +
  8242  			"         │   │                   │   │   ├─ mc.movie_id:6!null\n" +
  8243  			"         │   │                   │   │   └─ mk.movie_id:4!null\n" +
  8244  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8245  			"         │   │                   │   │   └─ ProcessTable\n" +
  8246  			"         │   │                   │   │       └─ Table\n" +
  8247  			"         │   │                   │   │           ├─ name: movie_keyword\n" +
  8248  			"         │   │                   │   │           └─ columns: [movie_id keyword_id]\n" +
  8249  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8250  			"         │   │                   │       └─ ProcessTable\n" +
  8251  			"         │   │                   │           └─ Table\n" +
  8252  			"         │   │                   │               ├─ name: movie_companies\n" +
  8253  			"         │   │                   │               └─ columns: [movie_id company_id]\n" +
  8254  			"         │   │                   └─ TableAlias(ci)\n" +
  8255  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8256  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8257  			"         │   │                           ├─ keys: [mc.movie_id:6!null]\n" +
  8258  			"         │   │                           ├─ colSet: (1-7)\n" +
  8259  			"         │   │                           ├─ tableId: 1\n" +
  8260  			"         │   │                           └─ Table\n" +
  8261  			"         │   │                               ├─ name: cast_info\n" +
  8262  			"         │   │                               └─ columns: [person_id movie_id]\n" +
  8263  			"         │   └─ HashLookup\n" +
  8264  			"         │       ├─ left-key: TUPLE(ci.person_id:8!null)\n" +
  8265  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  8266  			"         │       └─ TableAlias(n)\n" +
  8267  			"         │           └─ ProcessTable\n" +
  8268  			"         │               └─ Table\n" +
  8269  			"         │                   ├─ name: name\n" +
  8270  			"         │                   └─ columns: [id name]\n" +
  8271  			"         └─ HashLookup\n" +
  8272  			"             ├─ left-key: TUPLE(ci.movie_id:9!null, mk.movie_id:4!null, mc.movie_id:6!null)\n" +
  8273  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  8274  			"             └─ TableAlias(t)\n" +
  8275  			"                 └─ ProcessTable\n" +
  8276  			"                     └─ Table\n" +
  8277  			"                         ├─ name: title\n" +
  8278  			"                         └─ columns: [id]\n" +
  8279  			"",
  8280  		ExpectedEstimates: "Project\n" +
  8281  			" ├─ columns: [min(n.name) as member_in_charnamed_movie]\n" +
  8282  			" └─ GroupBy\n" +
  8283  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  8284  			"     ├─ Grouping()\n" +
  8285  			"     └─ HashJoin\n" +
  8286  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  8287  			"         ├─ HashJoin\n" +
  8288  			"         │   ├─ (n.id = ci.person_id)\n" +
  8289  			"         │   ├─ HashJoin\n" +
  8290  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  8291  			"         │   │   ├─ Filter\n" +
  8292  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  8293  			"         │   │   │   └─ TableAlias(k)\n" +
  8294  			"         │   │   │       └─ Table\n" +
  8295  			"         │   │   │           ├─ name: keyword\n" +
  8296  			"         │   │   │           └─ columns: [id keyword]\n" +
  8297  			"         │   │   └─ HashLookup\n" +
  8298  			"         │   │       ├─ left-key: (k.id)\n" +
  8299  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  8300  			"         │   │       └─ HashJoin\n" +
  8301  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  8302  			"         │   │           ├─ Filter\n" +
  8303  			"         │   │           │   ├─ (cn.country_code = '[us]')\n" +
  8304  			"         │   │           │   └─ TableAlias(cn)\n" +
  8305  			"         │   │           │       └─ Table\n" +
  8306  			"         │   │           │           ├─ name: company_name\n" +
  8307  			"         │   │           │           └─ columns: [id country_code]\n" +
  8308  			"         │   │           └─ HashLookup\n" +
  8309  			"         │   │               ├─ left-key: (cn.id)\n" +
  8310  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  8311  			"         │   │               └─ LookupJoin\n" +
  8312  			"         │   │                   ├─ InnerJoin\n" +
  8313  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  8314  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8315  			"         │   │                   │   │   └─ Table\n" +
  8316  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  8317  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  8318  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8319  			"         │   │                   │       └─ Table\n" +
  8320  			"         │   │                   │           ├─ name: movie_companies\n" +
  8321  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  8322  			"         │   │                   └─ TableAlias(ci)\n" +
  8323  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8324  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8325  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  8326  			"         │   │                           └─ keys: mc.movie_id\n" +
  8327  			"         │   └─ HashLookup\n" +
  8328  			"         │       ├─ left-key: (ci.person_id)\n" +
  8329  			"         │       ├─ right-key: (n.id)\n" +
  8330  			"         │       └─ TableAlias(n)\n" +
  8331  			"         │           └─ Table\n" +
  8332  			"         │               ├─ name: name\n" +
  8333  			"         │               └─ columns: [id name]\n" +
  8334  			"         └─ HashLookup\n" +
  8335  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  8336  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8337  			"             └─ TableAlias(t)\n" +
  8338  			"                 └─ Table\n" +
  8339  			"                     ├─ name: title\n" +
  8340  			"                     └─ columns: [id]\n" +
  8341  			"",
  8342  		ExpectedAnalysis: "Project\n" +
  8343  			" ├─ columns: [min(n.name) as member_in_charnamed_movie]\n" +
  8344  			" └─ GroupBy\n" +
  8345  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  8346  			"     ├─ Grouping()\n" +
  8347  			"     └─ HashJoin\n" +
  8348  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  8349  			"         ├─ HashJoin\n" +
  8350  			"         │   ├─ (n.id = ci.person_id)\n" +
  8351  			"         │   ├─ HashJoin\n" +
  8352  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  8353  			"         │   │   ├─ Filter\n" +
  8354  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  8355  			"         │   │   │   └─ TableAlias(k)\n" +
  8356  			"         │   │   │       └─ Table\n" +
  8357  			"         │   │   │           ├─ name: keyword\n" +
  8358  			"         │   │   │           └─ columns: [id keyword]\n" +
  8359  			"         │   │   └─ HashLookup\n" +
  8360  			"         │   │       ├─ left-key: (k.id)\n" +
  8361  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  8362  			"         │   │       └─ HashJoin\n" +
  8363  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  8364  			"         │   │           ├─ Filter\n" +
  8365  			"         │   │           │   ├─ (cn.country_code = '[us]')\n" +
  8366  			"         │   │           │   └─ TableAlias(cn)\n" +
  8367  			"         │   │           │       └─ Table\n" +
  8368  			"         │   │           │           ├─ name: company_name\n" +
  8369  			"         │   │           │           └─ columns: [id country_code]\n" +
  8370  			"         │   │           └─ HashLookup\n" +
  8371  			"         │   │               ├─ left-key: (cn.id)\n" +
  8372  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  8373  			"         │   │               └─ LookupJoin\n" +
  8374  			"         │   │                   ├─ InnerJoin\n" +
  8375  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  8376  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8377  			"         │   │                   │   │   └─ Table\n" +
  8378  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  8379  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  8380  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8381  			"         │   │                   │       └─ Table\n" +
  8382  			"         │   │                   │           ├─ name: movie_companies\n" +
  8383  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  8384  			"         │   │                   └─ TableAlias(ci)\n" +
  8385  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8386  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8387  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  8388  			"         │   │                           └─ keys: mc.movie_id\n" +
  8389  			"         │   └─ HashLookup\n" +
  8390  			"         │       ├─ left-key: (ci.person_id)\n" +
  8391  			"         │       ├─ right-key: (n.id)\n" +
  8392  			"         │       └─ TableAlias(n)\n" +
  8393  			"         │           └─ Table\n" +
  8394  			"         │               ├─ name: name\n" +
  8395  			"         │               └─ columns: [id name]\n" +
  8396  			"         └─ HashLookup\n" +
  8397  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  8398  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8399  			"             └─ TableAlias(t)\n" +
  8400  			"                 └─ Table\n" +
  8401  			"                     ├─ name: title\n" +
  8402  			"                     └─ columns: [id]\n" +
  8403  			"",
  8404  	},
  8405  	{
  8406  		Query: `
  8407  SELECT MIN(n.name) AS member_in_charnamed_movie
  8408  FROM cast_info AS ci,
  8409       company_name AS cn,
  8410       keyword AS k,
  8411       movie_companies AS mc,
  8412       movie_keyword AS mk,
  8413       name AS n,
  8414       title AS t
  8415  WHERE k.keyword ='character-name-in-title'
  8416    AND n.name LIKE '%B%'
  8417    AND n.id = ci.person_id
  8418    AND ci.movie_id = t.id
  8419    AND t.id = mk.movie_id
  8420    AND mk.keyword_id = k.id
  8421    AND t.id = mc.movie_id
  8422    AND mc.company_id = cn.id
  8423    AND ci.movie_id = mc.movie_id
  8424    AND ci.movie_id = mk.movie_id
  8425    AND mc.movie_id = mk.movie_id;
  8426  
  8427  `,
  8428  		ExpectedPlan: "Project\n" +
  8429  			" ├─ columns: [min(n.name):0!null as member_in_charnamed_movie]\n" +
  8430  			" └─ GroupBy\n" +
  8431  			"     ├─ select: MIN(n.name:10!null)\n" +
  8432  			"     ├─ group: \n" +
  8433  			"     └─ HashJoin\n" +
  8434  			"         ├─ AND\n" +
  8435  			"         │   ├─ AND\n" +
  8436  			"         │   │   ├─ Eq\n" +
  8437  			"         │   │   │   ├─ ci.movie_id:8!null\n" +
  8438  			"         │   │   │   └─ t.id:11!null\n" +
  8439  			"         │   │   └─ Eq\n" +
  8440  			"         │   │       ├─ t.id:11!null\n" +
  8441  			"         │   │       └─ mk.movie_id:3!null\n" +
  8442  			"         │   └─ Eq\n" +
  8443  			"         │       ├─ t.id:11!null\n" +
  8444  			"         │       └─ mc.movie_id:5!null\n" +
  8445  			"         ├─ HashJoin\n" +
  8446  			"         │   ├─ Eq\n" +
  8447  			"         │   │   ├─ n.id:9!null\n" +
  8448  			"         │   │   └─ ci.person_id:7!null\n" +
  8449  			"         │   ├─ HashJoin\n" +
  8450  			"         │   │   ├─ Eq\n" +
  8451  			"         │   │   │   ├─ mk.keyword_id:4!null\n" +
  8452  			"         │   │   │   └─ k.id:0!null\n" +
  8453  			"         │   │   ├─ Filter\n" +
  8454  			"         │   │   │   ├─ Eq\n" +
  8455  			"         │   │   │   │   ├─ k.keyword:1!null\n" +
  8456  			"         │   │   │   │   └─ character-name-in-title (longtext)\n" +
  8457  			"         │   │   │   └─ TableAlias(k)\n" +
  8458  			"         │   │   │       └─ ProcessTable\n" +
  8459  			"         │   │   │           └─ Table\n" +
  8460  			"         │   │   │               ├─ name: keyword\n" +
  8461  			"         │   │   │               └─ columns: [id keyword]\n" +
  8462  			"         │   │   └─ HashLookup\n" +
  8463  			"         │   │       ├─ left-key: TUPLE(k.id:0!null)\n" +
  8464  			"         │   │       ├─ right-key: TUPLE(mk.keyword_id:2!null)\n" +
  8465  			"         │   │       └─ HashJoin\n" +
  8466  			"         │   │           ├─ Eq\n" +
  8467  			"         │   │           │   ├─ mc.company_id:6!null\n" +
  8468  			"         │   │           │   └─ cn.id:2!null\n" +
  8469  			"         │   │           ├─ TableAlias(cn)\n" +
  8470  			"         │   │           │   └─ ProcessTable\n" +
  8471  			"         │   │           │       └─ Table\n" +
  8472  			"         │   │           │           ├─ name: company_name\n" +
  8473  			"         │   │           │           └─ columns: [id]\n" +
  8474  			"         │   │           └─ HashLookup\n" +
  8475  			"         │   │               ├─ left-key: TUPLE(cn.id:2!null)\n" +
  8476  			"         │   │               ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
  8477  			"         │   │               └─ LookupJoin\n" +
  8478  			"         │   │                   ├─ InnerJoin\n" +
  8479  			"         │   │                   │   ├─ Eq\n" +
  8480  			"         │   │                   │   │   ├─ mc.movie_id:5!null\n" +
  8481  			"         │   │                   │   │   └─ mk.movie_id:3!null\n" +
  8482  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8483  			"         │   │                   │   │   └─ ProcessTable\n" +
  8484  			"         │   │                   │   │       └─ Table\n" +
  8485  			"         │   │                   │   │           ├─ name: movie_keyword\n" +
  8486  			"         │   │                   │   │           └─ columns: [movie_id keyword_id]\n" +
  8487  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8488  			"         │   │                   │       └─ ProcessTable\n" +
  8489  			"         │   │                   │           └─ Table\n" +
  8490  			"         │   │                   │               ├─ name: movie_companies\n" +
  8491  			"         │   │                   │               └─ columns: [movie_id company_id]\n" +
  8492  			"         │   │                   └─ TableAlias(ci)\n" +
  8493  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8494  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8495  			"         │   │                           ├─ keys: [mc.movie_id:5!null]\n" +
  8496  			"         │   │                           ├─ colSet: (1-7)\n" +
  8497  			"         │   │                           ├─ tableId: 1\n" +
  8498  			"         │   │                           └─ Table\n" +
  8499  			"         │   │                               ├─ name: cast_info\n" +
  8500  			"         │   │                               └─ columns: [person_id movie_id]\n" +
  8501  			"         │   └─ HashLookup\n" +
  8502  			"         │       ├─ left-key: TUPLE(ci.person_id:7!null)\n" +
  8503  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  8504  			"         │       └─ Filter\n" +
  8505  			"         │           ├─ n.name LIKE '%B%'\n" +
  8506  			"         │           └─ TableAlias(n)\n" +
  8507  			"         │               └─ ProcessTable\n" +
  8508  			"         │                   └─ Table\n" +
  8509  			"         │                       ├─ name: name\n" +
  8510  			"         │                       └─ columns: [id name]\n" +
  8511  			"         └─ HashLookup\n" +
  8512  			"             ├─ left-key: TUPLE(ci.movie_id:8!null, mk.movie_id:3!null, mc.movie_id:5!null)\n" +
  8513  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  8514  			"             └─ TableAlias(t)\n" +
  8515  			"                 └─ ProcessTable\n" +
  8516  			"                     └─ Table\n" +
  8517  			"                         ├─ name: title\n" +
  8518  			"                         └─ columns: [id]\n" +
  8519  			"",
  8520  		ExpectedEstimates: "Project\n" +
  8521  			" ├─ columns: [min(n.name) as member_in_charnamed_movie]\n" +
  8522  			" └─ GroupBy\n" +
  8523  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  8524  			"     ├─ Grouping()\n" +
  8525  			"     └─ HashJoin\n" +
  8526  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  8527  			"         ├─ HashJoin\n" +
  8528  			"         │   ├─ (n.id = ci.person_id)\n" +
  8529  			"         │   ├─ HashJoin\n" +
  8530  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  8531  			"         │   │   ├─ Filter\n" +
  8532  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  8533  			"         │   │   │   └─ TableAlias(k)\n" +
  8534  			"         │   │   │       └─ Table\n" +
  8535  			"         │   │   │           ├─ name: keyword\n" +
  8536  			"         │   │   │           └─ columns: [id keyword]\n" +
  8537  			"         │   │   └─ HashLookup\n" +
  8538  			"         │   │       ├─ left-key: (k.id)\n" +
  8539  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  8540  			"         │   │       └─ HashJoin\n" +
  8541  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  8542  			"         │   │           ├─ TableAlias(cn)\n" +
  8543  			"         │   │           │   └─ Table\n" +
  8544  			"         │   │           │       ├─ name: company_name\n" +
  8545  			"         │   │           │       └─ columns: [id]\n" +
  8546  			"         │   │           └─ HashLookup\n" +
  8547  			"         │   │               ├─ left-key: (cn.id)\n" +
  8548  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  8549  			"         │   │               └─ LookupJoin\n" +
  8550  			"         │   │                   ├─ InnerJoin\n" +
  8551  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  8552  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8553  			"         │   │                   │   │   └─ Table\n" +
  8554  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  8555  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  8556  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8557  			"         │   │                   │       └─ Table\n" +
  8558  			"         │   │                   │           ├─ name: movie_companies\n" +
  8559  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  8560  			"         │   │                   └─ TableAlias(ci)\n" +
  8561  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8562  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8563  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  8564  			"         │   │                           └─ keys: mc.movie_id\n" +
  8565  			"         │   └─ HashLookup\n" +
  8566  			"         │       ├─ left-key: (ci.person_id)\n" +
  8567  			"         │       ├─ right-key: (n.id)\n" +
  8568  			"         │       └─ Filter\n" +
  8569  			"         │           ├─ n.name LIKE '%B%'\n" +
  8570  			"         │           └─ TableAlias(n)\n" +
  8571  			"         │               └─ Table\n" +
  8572  			"         │                   ├─ name: name\n" +
  8573  			"         │                   └─ columns: [id name]\n" +
  8574  			"         └─ HashLookup\n" +
  8575  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  8576  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8577  			"             └─ TableAlias(t)\n" +
  8578  			"                 └─ Table\n" +
  8579  			"                     ├─ name: title\n" +
  8580  			"                     └─ columns: [id]\n" +
  8581  			"",
  8582  		ExpectedAnalysis: "Project\n" +
  8583  			" ├─ columns: [min(n.name) as member_in_charnamed_movie]\n" +
  8584  			" └─ GroupBy\n" +
  8585  			"     ├─ SelectedExprs(MIN(n.name))\n" +
  8586  			"     ├─ Grouping()\n" +
  8587  			"     └─ HashJoin\n" +
  8588  			"         ├─ (((ci.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
  8589  			"         ├─ HashJoin\n" +
  8590  			"         │   ├─ (n.id = ci.person_id)\n" +
  8591  			"         │   ├─ HashJoin\n" +
  8592  			"         │   │   ├─ (mk.keyword_id = k.id)\n" +
  8593  			"         │   │   ├─ Filter\n" +
  8594  			"         │   │   │   ├─ (k.keyword = 'character-name-in-title')\n" +
  8595  			"         │   │   │   └─ TableAlias(k)\n" +
  8596  			"         │   │   │       └─ Table\n" +
  8597  			"         │   │   │           ├─ name: keyword\n" +
  8598  			"         │   │   │           └─ columns: [id keyword]\n" +
  8599  			"         │   │   └─ HashLookup\n" +
  8600  			"         │   │       ├─ left-key: (k.id)\n" +
  8601  			"         │   │       ├─ right-key: (mk.keyword_id)\n" +
  8602  			"         │   │       └─ HashJoin\n" +
  8603  			"         │   │           ├─ (mc.company_id = cn.id)\n" +
  8604  			"         │   │           ├─ TableAlias(cn)\n" +
  8605  			"         │   │           │   └─ Table\n" +
  8606  			"         │   │           │       ├─ name: company_name\n" +
  8607  			"         │   │           │       └─ columns: [id]\n" +
  8608  			"         │   │           └─ HashLookup\n" +
  8609  			"         │   │               ├─ left-key: (cn.id)\n" +
  8610  			"         │   │               ├─ right-key: (mc.company_id)\n" +
  8611  			"         │   │               └─ LookupJoin\n" +
  8612  			"         │   │                   ├─ InnerJoin\n" +
  8613  			"         │   │                   │   ├─ (mc.movie_id = mk.movie_id)\n" +
  8614  			"         │   │                   │   ├─ TableAlias(mk)\n" +
  8615  			"         │   │                   │   │   └─ Table\n" +
  8616  			"         │   │                   │   │       ├─ name: movie_keyword\n" +
  8617  			"         │   │                   │   │       └─ columns: [movie_id keyword_id]\n" +
  8618  			"         │   │                   │   └─ TableAlias(mc)\n" +
  8619  			"         │   │                   │       └─ Table\n" +
  8620  			"         │   │                   │           ├─ name: movie_companies\n" +
  8621  			"         │   │                   │           └─ columns: [movie_id company_id]\n" +
  8622  			"         │   │                   └─ TableAlias(ci)\n" +
  8623  			"         │   │                       └─ IndexedTableAccess(cast_info)\n" +
  8624  			"         │   │                           ├─ index: [cast_info.movie_id]\n" +
  8625  			"         │   │                           ├─ columns: [person_id movie_id]\n" +
  8626  			"         │   │                           └─ keys: mc.movie_id\n" +
  8627  			"         │   └─ HashLookup\n" +
  8628  			"         │       ├─ left-key: (ci.person_id)\n" +
  8629  			"         │       ├─ right-key: (n.id)\n" +
  8630  			"         │       └─ Filter\n" +
  8631  			"         │           ├─ n.name LIKE '%B%'\n" +
  8632  			"         │           └─ TableAlias(n)\n" +
  8633  			"         │               └─ Table\n" +
  8634  			"         │                   ├─ name: name\n" +
  8635  			"         │                   └─ columns: [id name]\n" +
  8636  			"         └─ HashLookup\n" +
  8637  			"             ├─ left-key: (ci.movie_id, mk.movie_id, mc.movie_id)\n" +
  8638  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8639  			"             └─ TableAlias(t)\n" +
  8640  			"                 └─ Table\n" +
  8641  			"                     ├─ name: title\n" +
  8642  			"                     └─ columns: [id]\n" +
  8643  			"",
  8644  	},
  8645  	{
  8646  		Query: `
  8647  SELECT MIN(mi.info) AS movie_budget,
  8648         MIN(mi_idx.info) AS movie_votes,
  8649         MIN(t.title) AS movie_title
  8650  FROM cast_info AS ci,
  8651       info_type AS it1,
  8652       info_type AS it2,
  8653       movie_info AS mi,
  8654       movie_info_idx AS mi_idx,
  8655       name AS n,
  8656       title AS t
  8657  WHERE ci.note IN ('(producer)',
  8658                    '(executive producer)')
  8659    AND it1.info = 'budget'
  8660    AND it2.info = 'votes'
  8661    AND n.gender = 'm'
  8662    AND n.name LIKE '%Tim%'
  8663    AND t.id = mi.movie_id
  8664    AND t.id = mi_idx.movie_id
  8665    AND t.id = ci.movie_id
  8666    AND ci.movie_id = mi.movie_id
  8667    AND ci.movie_id = mi_idx.movie_id
  8668    AND mi.movie_id = mi_idx.movie_id
  8669    AND n.id = ci.person_id
  8670    AND it1.id = mi.info_type_id
  8671    AND it2.id = mi_idx.info_type_id;
  8672  
  8673  `,
  8674  		ExpectedPlan: "Project\n" +
  8675  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(t.title):2!null as movie_title]\n" +
  8676  			" └─ GroupBy\n" +
  8677  			"     ├─ select: MIN(mi.info:9!null), MIN(mi_idx.info:6!null), MIN(t.title:17!null)\n" +
  8678  			"     ├─ group: \n" +
  8679  			"     └─ HashJoin\n" +
  8680  			"         ├─ AND\n" +
  8681  			"         │   ├─ AND\n" +
  8682  			"         │   │   ├─ Eq\n" +
  8683  			"         │   │   │   ├─ t.id:16!null\n" +
  8684  			"         │   │   │   └─ mi.movie_id:7!null\n" +
  8685  			"         │   │   └─ Eq\n" +
  8686  			"         │   │       ├─ t.id:16!null\n" +
  8687  			"         │   │       └─ mi_idx.movie_id:4!null\n" +
  8688  			"         │   └─ Eq\n" +
  8689  			"         │       ├─ t.id:16!null\n" +
  8690  			"         │       └─ ci.movie_id:11!null\n" +
  8691  			"         ├─ HashJoin\n" +
  8692  			"         │   ├─ Eq\n" +
  8693  			"         │   │   ├─ n.id:13!null\n" +
  8694  			"         │   │   └─ ci.person_id:10!null\n" +
  8695  			"         │   ├─ HashJoin\n" +
  8696  			"         │   │   ├─ Eq\n" +
  8697  			"         │   │   │   ├─ it2.id:0!null\n" +
  8698  			"         │   │   │   └─ mi_idx.info_type_id:5!null\n" +
  8699  			"         │   │   ├─ Filter\n" +
  8700  			"         │   │   │   ├─ Eq\n" +
  8701  			"         │   │   │   │   ├─ it2.info:1!null\n" +
  8702  			"         │   │   │   │   └─ votes (longtext)\n" +
  8703  			"         │   │   │   └─ TableAlias(it2)\n" +
  8704  			"         │   │   │       └─ ProcessTable\n" +
  8705  			"         │   │   │           └─ Table\n" +
  8706  			"         │   │   │               ├─ name: info_type\n" +
  8707  			"         │   │   │               └─ columns: [id info]\n" +
  8708  			"         │   │   └─ HashLookup\n" +
  8709  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
  8710  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:3!null)\n" +
  8711  			"         │   │       └─ HashJoin\n" +
  8712  			"         │   │           ├─ Eq\n" +
  8713  			"         │   │           │   ├─ it1.id:2!null\n" +
  8714  			"         │   │           │   └─ mi.info_type_id:8!null\n" +
  8715  			"         │   │           ├─ Filter\n" +
  8716  			"         │   │           │   ├─ Eq\n" +
  8717  			"         │   │           │   │   ├─ it1.info:1!null\n" +
  8718  			"         │   │           │   │   └─ budget (longtext)\n" +
  8719  			"         │   │           │   └─ TableAlias(it1)\n" +
  8720  			"         │   │           │       └─ Table\n" +
  8721  			"         │   │           │           ├─ name: info_type\n" +
  8722  			"         │   │           │           ├─ columns: [id info]\n" +
  8723  			"         │   │           │           ├─ colSet: (8,9)\n" +
  8724  			"         │   │           │           └─ tableId: 2\n" +
  8725  			"         │   │           └─ HashLookup\n" +
  8726  			"         │   │               ├─ left-key: TUPLE(it1.id:2!null)\n" +
  8727  			"         │   │               ├─ right-key: TUPLE(mi.info_type_id:4!null)\n" +
  8728  			"         │   │               └─ LookupJoin\n" +
  8729  			"         │   │                   ├─ InnerJoin\n" +
  8730  			"         │   │                   │   ├─ Eq\n" +
  8731  			"         │   │                   │   │   ├─ mi.movie_id:7!null\n" +
  8732  			"         │   │                   │   │   └─ mi_idx.movie_id:4!null\n" +
  8733  			"         │   │                   │   ├─ TableAlias(mi_idx)\n" +
  8734  			"         │   │                   │   │   └─ ProcessTable\n" +
  8735  			"         │   │                   │   │       └─ Table\n" +
  8736  			"         │   │                   │   │           ├─ name: movie_info_idx\n" +
  8737  			"         │   │                   │   │           └─ columns: [movie_id info_type_id info]\n" +
  8738  			"         │   │                   │   └─ TableAlias(mi)\n" +
  8739  			"         │   │                   │       └─ ProcessTable\n" +
  8740  			"         │   │                   │           └─ Table\n" +
  8741  			"         │   │                   │               ├─ name: movie_info\n" +
  8742  			"         │   │                   │               └─ columns: [movie_id info_type_id info]\n" +
  8743  			"         │   │                   └─ Filter\n" +
  8744  			"         │   │                       ├─ HashIn\n" +
  8745  			"         │   │                       │   ├─ ci.note:2\n" +
  8746  			"         │   │                       │   └─ TUPLE((producer) (longtext), (executive producer) (longtext))\n" +
  8747  			"         │   │                       └─ TableAlias(ci)\n" +
  8748  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  8749  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  8750  			"         │   │                               ├─ keys: [mi.movie_id:7!null]\n" +
  8751  			"         │   │                               ├─ colSet: (1-7)\n" +
  8752  			"         │   │                               ├─ tableId: 1\n" +
  8753  			"         │   │                               └─ Table\n" +
  8754  			"         │   │                                   ├─ name: cast_info\n" +
  8755  			"         │   │                                   └─ columns: [person_id movie_id note]\n" +
  8756  			"         │   └─ HashLookup\n" +
  8757  			"         │       ├─ left-key: TUPLE(ci.person_id:10!null)\n" +
  8758  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  8759  			"         │       └─ Filter\n" +
  8760  			"         │           ├─ AND\n" +
  8761  			"         │           │   ├─ Eq\n" +
  8762  			"         │           │   │   ├─ n.gender:2\n" +
  8763  			"         │           │   │   └─ m (longtext)\n" +
  8764  			"         │           │   └─ n.name LIKE '%Tim%'\n" +
  8765  			"         │           └─ TableAlias(n)\n" +
  8766  			"         │               └─ ProcessTable\n" +
  8767  			"         │                   └─ Table\n" +
  8768  			"         │                       ├─ name: name\n" +
  8769  			"         │                       └─ columns: [id name gender]\n" +
  8770  			"         └─ HashLookup\n" +
  8771  			"             ├─ left-key: TUPLE(mi.movie_id:7!null, mi_idx.movie_id:4!null, ci.movie_id:11!null)\n" +
  8772  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  8773  			"             └─ TableAlias(t)\n" +
  8774  			"                 └─ ProcessTable\n" +
  8775  			"                     └─ Table\n" +
  8776  			"                         ├─ name: title\n" +
  8777  			"                         └─ columns: [id title]\n" +
  8778  			"",
  8779  		ExpectedEstimates: "Project\n" +
  8780  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(t.title) as movie_title]\n" +
  8781  			" └─ GroupBy\n" +
  8782  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(t.title))\n" +
  8783  			"     ├─ Grouping()\n" +
  8784  			"     └─ HashJoin\n" +
  8785  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id))\n" +
  8786  			"         ├─ HashJoin\n" +
  8787  			"         │   ├─ (n.id = ci.person_id)\n" +
  8788  			"         │   ├─ HashJoin\n" +
  8789  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  8790  			"         │   │   ├─ Filter\n" +
  8791  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
  8792  			"         │   │   │   └─ TableAlias(it2)\n" +
  8793  			"         │   │   │       └─ Table\n" +
  8794  			"         │   │   │           ├─ name: info_type\n" +
  8795  			"         │   │   │           └─ columns: [id info]\n" +
  8796  			"         │   │   └─ HashLookup\n" +
  8797  			"         │   │       ├─ left-key: (it2.id)\n" +
  8798  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
  8799  			"         │   │       └─ HashJoin\n" +
  8800  			"         │   │           ├─ (it1.id = mi.info_type_id)\n" +
  8801  			"         │   │           ├─ Filter\n" +
  8802  			"         │   │           │   ├─ (it1.info = 'budget')\n" +
  8803  			"         │   │           │   └─ TableAlias(it1)\n" +
  8804  			"         │   │           │       └─ Table\n" +
  8805  			"         │   │           │           ├─ name: info_type\n" +
  8806  			"         │   │           │           └─ columns: [id info]\n" +
  8807  			"         │   │           └─ HashLookup\n" +
  8808  			"         │   │               ├─ left-key: (it1.id)\n" +
  8809  			"         │   │               ├─ right-key: (mi.info_type_id)\n" +
  8810  			"         │   │               └─ LookupJoin\n" +
  8811  			"         │   │                   ├─ InnerJoin\n" +
  8812  			"         │   │                   │   ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  8813  			"         │   │                   │   ├─ TableAlias(mi_idx)\n" +
  8814  			"         │   │                   │   │   └─ Table\n" +
  8815  			"         │   │                   │   │       ├─ name: movie_info_idx\n" +
  8816  			"         │   │                   │   │       └─ columns: [movie_id info_type_id info]\n" +
  8817  			"         │   │                   │   └─ TableAlias(mi)\n" +
  8818  			"         │   │                   │       └─ Table\n" +
  8819  			"         │   │                   │           ├─ name: movie_info\n" +
  8820  			"         │   │                   │           └─ columns: [movie_id info_type_id info]\n" +
  8821  			"         │   │                   └─ Filter\n" +
  8822  			"         │   │                       ├─ (ci.note HASH IN ('(producer)', '(executive producer)'))\n" +
  8823  			"         │   │                       └─ TableAlias(ci)\n" +
  8824  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  8825  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  8826  			"         │   │                               ├─ columns: [person_id movie_id note]\n" +
  8827  			"         │   │                               └─ keys: mi.movie_id\n" +
  8828  			"         │   └─ HashLookup\n" +
  8829  			"         │       ├─ left-key: (ci.person_id)\n" +
  8830  			"         │       ├─ right-key: (n.id)\n" +
  8831  			"         │       └─ Filter\n" +
  8832  			"         │           ├─ ((n.gender = 'm') AND n.name LIKE '%Tim%')\n" +
  8833  			"         │           └─ TableAlias(n)\n" +
  8834  			"         │               └─ Table\n" +
  8835  			"         │                   ├─ name: name\n" +
  8836  			"         │                   └─ columns: [id name gender]\n" +
  8837  			"         └─ HashLookup\n" +
  8838  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id)\n" +
  8839  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8840  			"             └─ TableAlias(t)\n" +
  8841  			"                 └─ Table\n" +
  8842  			"                     ├─ name: title\n" +
  8843  			"                     └─ columns: [id title]\n" +
  8844  			"",
  8845  		ExpectedAnalysis: "Project\n" +
  8846  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(t.title) as movie_title]\n" +
  8847  			" └─ GroupBy\n" +
  8848  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(t.title))\n" +
  8849  			"     ├─ Grouping()\n" +
  8850  			"     └─ HashJoin\n" +
  8851  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id))\n" +
  8852  			"         ├─ HashJoin\n" +
  8853  			"         │   ├─ (n.id = ci.person_id)\n" +
  8854  			"         │   ├─ HashJoin\n" +
  8855  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  8856  			"         │   │   ├─ Filter\n" +
  8857  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
  8858  			"         │   │   │   └─ TableAlias(it2)\n" +
  8859  			"         │   │   │       └─ Table\n" +
  8860  			"         │   │   │           ├─ name: info_type\n" +
  8861  			"         │   │   │           └─ columns: [id info]\n" +
  8862  			"         │   │   └─ HashLookup\n" +
  8863  			"         │   │       ├─ left-key: (it2.id)\n" +
  8864  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
  8865  			"         │   │       └─ HashJoin\n" +
  8866  			"         │   │           ├─ (it1.id = mi.info_type_id)\n" +
  8867  			"         │   │           ├─ Filter\n" +
  8868  			"         │   │           │   ├─ (it1.info = 'budget')\n" +
  8869  			"         │   │           │   └─ TableAlias(it1)\n" +
  8870  			"         │   │           │       └─ Table\n" +
  8871  			"         │   │           │           ├─ name: info_type\n" +
  8872  			"         │   │           │           └─ columns: [id info]\n" +
  8873  			"         │   │           └─ HashLookup\n" +
  8874  			"         │   │               ├─ left-key: (it1.id)\n" +
  8875  			"         │   │               ├─ right-key: (mi.info_type_id)\n" +
  8876  			"         │   │               └─ LookupJoin\n" +
  8877  			"         │   │                   ├─ InnerJoin\n" +
  8878  			"         │   │                   │   ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  8879  			"         │   │                   │   ├─ TableAlias(mi_idx)\n" +
  8880  			"         │   │                   │   │   └─ Table\n" +
  8881  			"         │   │                   │   │       ├─ name: movie_info_idx\n" +
  8882  			"         │   │                   │   │       └─ columns: [movie_id info_type_id info]\n" +
  8883  			"         │   │                   │   └─ TableAlias(mi)\n" +
  8884  			"         │   │                   │       └─ Table\n" +
  8885  			"         │   │                   │           ├─ name: movie_info\n" +
  8886  			"         │   │                   │           └─ columns: [movie_id info_type_id info]\n" +
  8887  			"         │   │                   └─ Filter\n" +
  8888  			"         │   │                       ├─ (ci.note HASH IN ('(producer)', '(executive producer)'))\n" +
  8889  			"         │   │                       └─ TableAlias(ci)\n" +
  8890  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  8891  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  8892  			"         │   │                               ├─ columns: [person_id movie_id note]\n" +
  8893  			"         │   │                               └─ keys: mi.movie_id\n" +
  8894  			"         │   └─ HashLookup\n" +
  8895  			"         │       ├─ left-key: (ci.person_id)\n" +
  8896  			"         │       ├─ right-key: (n.id)\n" +
  8897  			"         │       └─ Filter\n" +
  8898  			"         │           ├─ ((n.gender = 'm') AND n.name LIKE '%Tim%')\n" +
  8899  			"         │           └─ TableAlias(n)\n" +
  8900  			"         │               └─ Table\n" +
  8901  			"         │                   ├─ name: name\n" +
  8902  			"         │                   └─ columns: [id name gender]\n" +
  8903  			"         └─ HashLookup\n" +
  8904  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id)\n" +
  8905  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  8906  			"             └─ TableAlias(t)\n" +
  8907  			"                 └─ Table\n" +
  8908  			"                     ├─ name: title\n" +
  8909  			"                     └─ columns: [id title]\n" +
  8910  			"",
  8911  	},
  8912  	{
  8913  		Query: `
  8914  SELECT MIN(mi.info) AS movie_budget,
  8915         MIN(mi_idx.info) AS movie_votes,
  8916         MIN(t.title) AS movie_title
  8917  FROM cast_info AS ci,
  8918       info_type AS it1,
  8919       info_type AS it2,
  8920       movie_info AS mi,
  8921       movie_info_idx AS mi_idx,
  8922       name AS n,
  8923       title AS t
  8924  WHERE ci.note IN ('(writer)',
  8925                    '(head writer)',
  8926                    '(written by)',
  8927                    '(story)',
  8928                    '(story editor)')
  8929    AND it1.info = 'genres'
  8930    AND it2.info = 'rating'
  8931    AND mi.info IN ('Horror',
  8932                    'Thriller')
  8933    AND mi.note IS NULL
  8934    AND mi_idx.info > '8.0'
  8935    AND n.gender IS NOT NULL
  8936    AND n.gender = 'f'
  8937    AND t.production_year BETWEEN 2008 AND 2014
  8938    AND t.id = mi.movie_id
  8939    AND t.id = mi_idx.movie_id
  8940    AND t.id = ci.movie_id
  8941    AND ci.movie_id = mi.movie_id
  8942    AND ci.movie_id = mi_idx.movie_id
  8943    AND mi.movie_id = mi_idx.movie_id
  8944    AND n.id = ci.person_id
  8945    AND it1.id = mi.info_type_id
  8946    AND it2.id = mi_idx.info_type_id;
  8947  
  8948  `,
  8949  		ExpectedPlan: "Project\n" +
  8950  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(t.title):2!null as movie_title]\n" +
  8951  			" └─ GroupBy\n" +
  8952  			"     ├─ select: MIN(mi.info:9!null), MIN(mi_idx.info:6!null), MIN(t.title:17!null)\n" +
  8953  			"     ├─ group: \n" +
  8954  			"     └─ HashJoin\n" +
  8955  			"         ├─ AND\n" +
  8956  			"         │   ├─ AND\n" +
  8957  			"         │   │   ├─ Eq\n" +
  8958  			"         │   │   │   ├─ t.id:16!null\n" +
  8959  			"         │   │   │   └─ mi.movie_id:7!null\n" +
  8960  			"         │   │   └─ Eq\n" +
  8961  			"         │   │       ├─ t.id:16!null\n" +
  8962  			"         │   │       └─ mi_idx.movie_id:4!null\n" +
  8963  			"         │   └─ Eq\n" +
  8964  			"         │       ├─ t.id:16!null\n" +
  8965  			"         │       └─ ci.movie_id:12!null\n" +
  8966  			"         ├─ HashJoin\n" +
  8967  			"         │   ├─ Eq\n" +
  8968  			"         │   │   ├─ n.id:14!null\n" +
  8969  			"         │   │   └─ ci.person_id:11!null\n" +
  8970  			"         │   ├─ HashJoin\n" +
  8971  			"         │   │   ├─ Eq\n" +
  8972  			"         │   │   │   ├─ it2.id:0!null\n" +
  8973  			"         │   │   │   └─ mi_idx.info_type_id:5!null\n" +
  8974  			"         │   │   ├─ Filter\n" +
  8975  			"         │   │   │   ├─ Eq\n" +
  8976  			"         │   │   │   │   ├─ it2.info:1!null\n" +
  8977  			"         │   │   │   │   └─ rating (longtext)\n" +
  8978  			"         │   │   │   └─ TableAlias(it2)\n" +
  8979  			"         │   │   │       └─ ProcessTable\n" +
  8980  			"         │   │   │           └─ Table\n" +
  8981  			"         │   │   │               ├─ name: info_type\n" +
  8982  			"         │   │   │               └─ columns: [id info]\n" +
  8983  			"         │   │   └─ HashLookup\n" +
  8984  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
  8985  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:3!null)\n" +
  8986  			"         │   │       └─ HashJoin\n" +
  8987  			"         │   │           ├─ Eq\n" +
  8988  			"         │   │           │   ├─ it1.id:2!null\n" +
  8989  			"         │   │           │   └─ mi.info_type_id:8!null\n" +
  8990  			"         │   │           ├─ Filter\n" +
  8991  			"         │   │           │   ├─ Eq\n" +
  8992  			"         │   │           │   │   ├─ it1.info:1!null\n" +
  8993  			"         │   │           │   │   └─ genres (longtext)\n" +
  8994  			"         │   │           │   └─ TableAlias(it1)\n" +
  8995  			"         │   │           │       └─ Table\n" +
  8996  			"         │   │           │           ├─ name: info_type\n" +
  8997  			"         │   │           │           ├─ columns: [id info]\n" +
  8998  			"         │   │           │           ├─ colSet: (8,9)\n" +
  8999  			"         │   │           │           └─ tableId: 2\n" +
  9000  			"         │   │           └─ HashLookup\n" +
  9001  			"         │   │               ├─ left-key: TUPLE(it1.id:2!null)\n" +
  9002  			"         │   │               ├─ right-key: TUPLE(mi.info_type_id:4!null)\n" +
  9003  			"         │   │               └─ LookupJoin\n" +
  9004  			"         │   │                   ├─ InnerJoin\n" +
  9005  			"         │   │                   │   ├─ Eq\n" +
  9006  			"         │   │                   │   │   ├─ mi.movie_id:7!null\n" +
  9007  			"         │   │                   │   │   └─ mi_idx.movie_id:4!null\n" +
  9008  			"         │   │                   │   ├─ Filter\n" +
  9009  			"         │   │                   │   │   ├─ GreaterThan\n" +
  9010  			"         │   │                   │   │   │   ├─ mi_idx.info:2!null\n" +
  9011  			"         │   │                   │   │   │   └─ 8.0 (longtext)\n" +
  9012  			"         │   │                   │   │   └─ TableAlias(mi_idx)\n" +
  9013  			"         │   │                   │   │       └─ ProcessTable\n" +
  9014  			"         │   │                   │   │           └─ Table\n" +
  9015  			"         │   │                   │   │               ├─ name: movie_info_idx\n" +
  9016  			"         │   │                   │   │               └─ columns: [movie_id info_type_id info]\n" +
  9017  			"         │   │                   │   └─ Filter\n" +
  9018  			"         │   │                   │       ├─ AND\n" +
  9019  			"         │   │                   │       │   ├─ HashIn\n" +
  9020  			"         │   │                   │       │   │   ├─ mi.info:2!null\n" +
  9021  			"         │   │                   │       │   │   └─ TUPLE(Horror (longtext), Thriller (longtext))\n" +
  9022  			"         │   │                   │       │   └─ mi.note:3 IS NULL\n" +
  9023  			"         │   │                   │       └─ TableAlias(mi)\n" +
  9024  			"         │   │                   │           └─ ProcessTable\n" +
  9025  			"         │   │                   │               └─ Table\n" +
  9026  			"         │   │                   │                   ├─ name: movie_info\n" +
  9027  			"         │   │                   │                   └─ columns: [movie_id info_type_id info note]\n" +
  9028  			"         │   │                   └─ Filter\n" +
  9029  			"         │   │                       ├─ HashIn\n" +
  9030  			"         │   │                       │   ├─ ci.note:2\n" +
  9031  			"         │   │                       │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
  9032  			"         │   │                       └─ TableAlias(ci)\n" +
  9033  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  9034  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  9035  			"         │   │                               ├─ keys: [mi.movie_id:7!null]\n" +
  9036  			"         │   │                               ├─ colSet: (1-7)\n" +
  9037  			"         │   │                               ├─ tableId: 1\n" +
  9038  			"         │   │                               └─ Table\n" +
  9039  			"         │   │                                   ├─ name: cast_info\n" +
  9040  			"         │   │                                   └─ columns: [person_id movie_id note]\n" +
  9041  			"         │   └─ HashLookup\n" +
  9042  			"         │       ├─ left-key: TUPLE(ci.person_id:11!null)\n" +
  9043  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  9044  			"         │       └─ Filter\n" +
  9045  			"         │           ├─ AND\n" +
  9046  			"         │           │   ├─ NOT\n" +
  9047  			"         │           │   │   └─ n.gender:1 IS NULL\n" +
  9048  			"         │           │   └─ Eq\n" +
  9049  			"         │           │       ├─ n.gender:1\n" +
  9050  			"         │           │       └─ f (longtext)\n" +
  9051  			"         │           └─ TableAlias(n)\n" +
  9052  			"         │               └─ ProcessTable\n" +
  9053  			"         │                   └─ Table\n" +
  9054  			"         │                       ├─ name: name\n" +
  9055  			"         │                       └─ columns: [id gender]\n" +
  9056  			"         └─ HashLookup\n" +
  9057  			"             ├─ left-key: TUPLE(mi.movie_id:7!null, mi_idx.movie_id:4!null, ci.movie_id:12!null)\n" +
  9058  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  9059  			"             └─ Filter\n" +
  9060  			"                 ├─ AND\n" +
  9061  			"                 │   ├─ GreaterThanOrEqual\n" +
  9062  			"                 │   │   ├─ t.production_year:2\n" +
  9063  			"                 │   │   └─ 2008 (smallint)\n" +
  9064  			"                 │   └─ LessThanOrEqual\n" +
  9065  			"                 │       ├─ t.production_year:2\n" +
  9066  			"                 │       └─ 2014 (smallint)\n" +
  9067  			"                 └─ TableAlias(t)\n" +
  9068  			"                     └─ ProcessTable\n" +
  9069  			"                         └─ Table\n" +
  9070  			"                             ├─ name: title\n" +
  9071  			"                             └─ columns: [id title production_year]\n" +
  9072  			"",
  9073  		ExpectedEstimates: "Project\n" +
  9074  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(t.title) as movie_title]\n" +
  9075  			" └─ GroupBy\n" +
  9076  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(t.title))\n" +
  9077  			"     ├─ Grouping()\n" +
  9078  			"     └─ HashJoin\n" +
  9079  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id))\n" +
  9080  			"         ├─ HashJoin\n" +
  9081  			"         │   ├─ (n.id = ci.person_id)\n" +
  9082  			"         │   ├─ HashJoin\n" +
  9083  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  9084  			"         │   │   ├─ Filter\n" +
  9085  			"         │   │   │   ├─ (it2.info = 'rating')\n" +
  9086  			"         │   │   │   └─ TableAlias(it2)\n" +
  9087  			"         │   │   │       └─ Table\n" +
  9088  			"         │   │   │           ├─ name: info_type\n" +
  9089  			"         │   │   │           └─ columns: [id info]\n" +
  9090  			"         │   │   └─ HashLookup\n" +
  9091  			"         │   │       ├─ left-key: (it2.id)\n" +
  9092  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
  9093  			"         │   │       └─ HashJoin\n" +
  9094  			"         │   │           ├─ (it1.id = mi.info_type_id)\n" +
  9095  			"         │   │           ├─ Filter\n" +
  9096  			"         │   │           │   ├─ (it1.info = 'genres')\n" +
  9097  			"         │   │           │   └─ TableAlias(it1)\n" +
  9098  			"         │   │           │       └─ Table\n" +
  9099  			"         │   │           │           ├─ name: info_type\n" +
  9100  			"         │   │           │           └─ columns: [id info]\n" +
  9101  			"         │   │           └─ HashLookup\n" +
  9102  			"         │   │               ├─ left-key: (it1.id)\n" +
  9103  			"         │   │               ├─ right-key: (mi.info_type_id)\n" +
  9104  			"         │   │               └─ LookupJoin\n" +
  9105  			"         │   │                   ├─ InnerJoin\n" +
  9106  			"         │   │                   │   ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  9107  			"         │   │                   │   ├─ Filter\n" +
  9108  			"         │   │                   │   │   ├─ (mi_idx.info > '8.0')\n" +
  9109  			"         │   │                   │   │   └─ TableAlias(mi_idx)\n" +
  9110  			"         │   │                   │   │       └─ Table\n" +
  9111  			"         │   │                   │   │           ├─ name: movie_info_idx\n" +
  9112  			"         │   │                   │   │           └─ columns: [movie_id info_type_id info]\n" +
  9113  			"         │   │                   │   └─ Filter\n" +
  9114  			"         │   │                   │       ├─ ((mi.info HASH IN ('Horror', 'Thriller')) AND mi.note IS NULL)\n" +
  9115  			"         │   │                   │       └─ TableAlias(mi)\n" +
  9116  			"         │   │                   │           └─ Table\n" +
  9117  			"         │   │                   │               ├─ name: movie_info\n" +
  9118  			"         │   │                   │               └─ columns: [movie_id info_type_id info note]\n" +
  9119  			"         │   │                   └─ Filter\n" +
  9120  			"         │   │                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
  9121  			"         │   │                       └─ TableAlias(ci)\n" +
  9122  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  9123  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  9124  			"         │   │                               ├─ columns: [person_id movie_id note]\n" +
  9125  			"         │   │                               └─ keys: mi.movie_id\n" +
  9126  			"         │   └─ HashLookup\n" +
  9127  			"         │       ├─ left-key: (ci.person_id)\n" +
  9128  			"         │       ├─ right-key: (n.id)\n" +
  9129  			"         │       └─ Filter\n" +
  9130  			"         │           ├─ ((NOT(n.gender IS NULL)) AND (n.gender = 'f'))\n" +
  9131  			"         │           └─ TableAlias(n)\n" +
  9132  			"         │               └─ Table\n" +
  9133  			"         │                   ├─ name: name\n" +
  9134  			"         │                   └─ columns: [id gender]\n" +
  9135  			"         └─ HashLookup\n" +
  9136  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id)\n" +
  9137  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  9138  			"             └─ Filter\n" +
  9139  			"                 ├─ ((t.production_year >= 2008) AND (t.production_year <= 2014))\n" +
  9140  			"                 └─ TableAlias(t)\n" +
  9141  			"                     └─ Table\n" +
  9142  			"                         ├─ name: title\n" +
  9143  			"                         └─ columns: [id title production_year]\n" +
  9144  			"",
  9145  		ExpectedAnalysis: "Project\n" +
  9146  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(t.title) as movie_title]\n" +
  9147  			" └─ GroupBy\n" +
  9148  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(t.title))\n" +
  9149  			"     ├─ Grouping()\n" +
  9150  			"     └─ HashJoin\n" +
  9151  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id))\n" +
  9152  			"         ├─ HashJoin\n" +
  9153  			"         │   ├─ (n.id = ci.person_id)\n" +
  9154  			"         │   ├─ HashJoin\n" +
  9155  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  9156  			"         │   │   ├─ Filter\n" +
  9157  			"         │   │   │   ├─ (it2.info = 'rating')\n" +
  9158  			"         │   │   │   └─ TableAlias(it2)\n" +
  9159  			"         │   │   │       └─ Table\n" +
  9160  			"         │   │   │           ├─ name: info_type\n" +
  9161  			"         │   │   │           └─ columns: [id info]\n" +
  9162  			"         │   │   └─ HashLookup\n" +
  9163  			"         │   │       ├─ left-key: (it2.id)\n" +
  9164  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
  9165  			"         │   │       └─ HashJoin\n" +
  9166  			"         │   │           ├─ (it1.id = mi.info_type_id)\n" +
  9167  			"         │   │           ├─ Filter\n" +
  9168  			"         │   │           │   ├─ (it1.info = 'genres')\n" +
  9169  			"         │   │           │   └─ TableAlias(it1)\n" +
  9170  			"         │   │           │       └─ Table\n" +
  9171  			"         │   │           │           ├─ name: info_type\n" +
  9172  			"         │   │           │           └─ columns: [id info]\n" +
  9173  			"         │   │           └─ HashLookup\n" +
  9174  			"         │   │               ├─ left-key: (it1.id)\n" +
  9175  			"         │   │               ├─ right-key: (mi.info_type_id)\n" +
  9176  			"         │   │               └─ LookupJoin\n" +
  9177  			"         │   │                   ├─ InnerJoin\n" +
  9178  			"         │   │                   │   ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  9179  			"         │   │                   │   ├─ Filter\n" +
  9180  			"         │   │                   │   │   ├─ (mi_idx.info > '8.0')\n" +
  9181  			"         │   │                   │   │   └─ TableAlias(mi_idx)\n" +
  9182  			"         │   │                   │   │       └─ Table\n" +
  9183  			"         │   │                   │   │           ├─ name: movie_info_idx\n" +
  9184  			"         │   │                   │   │           └─ columns: [movie_id info_type_id info]\n" +
  9185  			"         │   │                   │   └─ Filter\n" +
  9186  			"         │   │                   │       ├─ ((mi.info HASH IN ('Horror', 'Thriller')) AND mi.note IS NULL)\n" +
  9187  			"         │   │                   │       └─ TableAlias(mi)\n" +
  9188  			"         │   │                   │           └─ Table\n" +
  9189  			"         │   │                   │               ├─ name: movie_info\n" +
  9190  			"         │   │                   │               └─ columns: [movie_id info_type_id info note]\n" +
  9191  			"         │   │                   └─ Filter\n" +
  9192  			"         │   │                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
  9193  			"         │   │                       └─ TableAlias(ci)\n" +
  9194  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  9195  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  9196  			"         │   │                               ├─ columns: [person_id movie_id note]\n" +
  9197  			"         │   │                               └─ keys: mi.movie_id\n" +
  9198  			"         │   └─ HashLookup\n" +
  9199  			"         │       ├─ left-key: (ci.person_id)\n" +
  9200  			"         │       ├─ right-key: (n.id)\n" +
  9201  			"         │       └─ Filter\n" +
  9202  			"         │           ├─ ((NOT(n.gender IS NULL)) AND (n.gender = 'f'))\n" +
  9203  			"         │           └─ TableAlias(n)\n" +
  9204  			"         │               └─ Table\n" +
  9205  			"         │                   ├─ name: name\n" +
  9206  			"         │                   └─ columns: [id gender]\n" +
  9207  			"         └─ HashLookup\n" +
  9208  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id)\n" +
  9209  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  9210  			"             └─ Filter\n" +
  9211  			"                 ├─ ((t.production_year >= 2008) AND (t.production_year <= 2014))\n" +
  9212  			"                 └─ TableAlias(t)\n" +
  9213  			"                     └─ Table\n" +
  9214  			"                         ├─ name: title\n" +
  9215  			"                         └─ columns: [id title production_year]\n" +
  9216  			"",
  9217  	},
  9218  	{
  9219  		Query: `
  9220  SELECT MIN(mi.info) AS movie_budget,
  9221         MIN(mi_idx.info) AS movie_votes,
  9222         MIN(t.title) AS movie_title
  9223  FROM cast_info AS ci,
  9224       info_type AS it1,
  9225       info_type AS it2,
  9226       movie_info AS mi,
  9227       movie_info_idx AS mi_idx,
  9228       name AS n,
  9229       title AS t
  9230  WHERE ci.note IN ('(writer)',
  9231                    '(head writer)',
  9232                    '(written by)',
  9233                    '(story)',
  9234                    '(story editor)')
  9235    AND it1.info = 'genres'
  9236    AND it2.info = 'votes'
  9237    AND mi.info IN ('Horror',
  9238                    'Action',
  9239                    'Sci-Fi',
  9240                    'Thriller',
  9241                    'Crime',
  9242                    'War')
  9243    AND n.gender = 'm'
  9244    AND t.id = mi.movie_id
  9245    AND t.id = mi_idx.movie_id
  9246    AND t.id = ci.movie_id
  9247    AND ci.movie_id = mi.movie_id
  9248    AND ci.movie_id = mi_idx.movie_id
  9249    AND mi.movie_id = mi_idx.movie_id
  9250    AND n.id = ci.person_id
  9251    AND it1.id = mi.info_type_id
  9252    AND it2.id = mi_idx.info_type_id;
  9253  
  9254  `,
  9255  		ExpectedPlan: "Project\n" +
  9256  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(t.title):2!null as movie_title]\n" +
  9257  			" └─ GroupBy\n" +
  9258  			"     ├─ select: MIN(mi.info:9!null), MIN(mi_idx.info:6!null), MIN(t.title:16!null)\n" +
  9259  			"     ├─ group: \n" +
  9260  			"     └─ HashJoin\n" +
  9261  			"         ├─ AND\n" +
  9262  			"         │   ├─ AND\n" +
  9263  			"         │   │   ├─ Eq\n" +
  9264  			"         │   │   │   ├─ t.id:15!null\n" +
  9265  			"         │   │   │   └─ mi.movie_id:7!null\n" +
  9266  			"         │   │   └─ Eq\n" +
  9267  			"         │   │       ├─ t.id:15!null\n" +
  9268  			"         │   │       └─ mi_idx.movie_id:4!null\n" +
  9269  			"         │   └─ Eq\n" +
  9270  			"         │       ├─ t.id:15!null\n" +
  9271  			"         │       └─ ci.movie_id:11!null\n" +
  9272  			"         ├─ HashJoin\n" +
  9273  			"         │   ├─ Eq\n" +
  9274  			"         │   │   ├─ n.id:13!null\n" +
  9275  			"         │   │   └─ ci.person_id:10!null\n" +
  9276  			"         │   ├─ HashJoin\n" +
  9277  			"         │   │   ├─ Eq\n" +
  9278  			"         │   │   │   ├─ it2.id:0!null\n" +
  9279  			"         │   │   │   └─ mi_idx.info_type_id:5!null\n" +
  9280  			"         │   │   ├─ Filter\n" +
  9281  			"         │   │   │   ├─ Eq\n" +
  9282  			"         │   │   │   │   ├─ it2.info:1!null\n" +
  9283  			"         │   │   │   │   └─ votes (longtext)\n" +
  9284  			"         │   │   │   └─ TableAlias(it2)\n" +
  9285  			"         │   │   │       └─ ProcessTable\n" +
  9286  			"         │   │   │           └─ Table\n" +
  9287  			"         │   │   │               ├─ name: info_type\n" +
  9288  			"         │   │   │               └─ columns: [id info]\n" +
  9289  			"         │   │   └─ HashLookup\n" +
  9290  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
  9291  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:3!null)\n" +
  9292  			"         │   │       └─ HashJoin\n" +
  9293  			"         │   │           ├─ Eq\n" +
  9294  			"         │   │           │   ├─ it1.id:2!null\n" +
  9295  			"         │   │           │   └─ mi.info_type_id:8!null\n" +
  9296  			"         │   │           ├─ Filter\n" +
  9297  			"         │   │           │   ├─ Eq\n" +
  9298  			"         │   │           │   │   ├─ it1.info:1!null\n" +
  9299  			"         │   │           │   │   └─ genres (longtext)\n" +
  9300  			"         │   │           │   └─ TableAlias(it1)\n" +
  9301  			"         │   │           │       └─ Table\n" +
  9302  			"         │   │           │           ├─ name: info_type\n" +
  9303  			"         │   │           │           ├─ columns: [id info]\n" +
  9304  			"         │   │           │           ├─ colSet: (8,9)\n" +
  9305  			"         │   │           │           └─ tableId: 2\n" +
  9306  			"         │   │           └─ HashLookup\n" +
  9307  			"         │   │               ├─ left-key: TUPLE(it1.id:2!null)\n" +
  9308  			"         │   │               ├─ right-key: TUPLE(mi.info_type_id:4!null)\n" +
  9309  			"         │   │               └─ LookupJoin\n" +
  9310  			"         │   │                   ├─ InnerJoin\n" +
  9311  			"         │   │                   │   ├─ Eq\n" +
  9312  			"         │   │                   │   │   ├─ mi.movie_id:7!null\n" +
  9313  			"         │   │                   │   │   └─ mi_idx.movie_id:4!null\n" +
  9314  			"         │   │                   │   ├─ TableAlias(mi_idx)\n" +
  9315  			"         │   │                   │   │   └─ ProcessTable\n" +
  9316  			"         │   │                   │   │       └─ Table\n" +
  9317  			"         │   │                   │   │           ├─ name: movie_info_idx\n" +
  9318  			"         │   │                   │   │           └─ columns: [movie_id info_type_id info]\n" +
  9319  			"         │   │                   │   └─ Filter\n" +
  9320  			"         │   │                   │       ├─ HashIn\n" +
  9321  			"         │   │                   │       │   ├─ mi.info:2!null\n" +
  9322  			"         │   │                   │       │   └─ TUPLE(Horror (longtext), Action (longtext), Sci-Fi (longtext), Thriller (longtext), Crime (longtext), War (longtext))\n" +
  9323  			"         │   │                   │       └─ TableAlias(mi)\n" +
  9324  			"         │   │                   │           └─ ProcessTable\n" +
  9325  			"         │   │                   │               └─ Table\n" +
  9326  			"         │   │                   │                   ├─ name: movie_info\n" +
  9327  			"         │   │                   │                   └─ columns: [movie_id info_type_id info]\n" +
  9328  			"         │   │                   └─ Filter\n" +
  9329  			"         │   │                       ├─ HashIn\n" +
  9330  			"         │   │                       │   ├─ ci.note:2\n" +
  9331  			"         │   │                       │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
  9332  			"         │   │                       └─ TableAlias(ci)\n" +
  9333  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  9334  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  9335  			"         │   │                               ├─ keys: [mi.movie_id:7!null]\n" +
  9336  			"         │   │                               ├─ colSet: (1-7)\n" +
  9337  			"         │   │                               ├─ tableId: 1\n" +
  9338  			"         │   │                               └─ Table\n" +
  9339  			"         │   │                                   ├─ name: cast_info\n" +
  9340  			"         │   │                                   └─ columns: [person_id movie_id note]\n" +
  9341  			"         │   └─ HashLookup\n" +
  9342  			"         │       ├─ left-key: TUPLE(ci.person_id:10!null)\n" +
  9343  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
  9344  			"         │       └─ Filter\n" +
  9345  			"         │           ├─ Eq\n" +
  9346  			"         │           │   ├─ n.gender:1\n" +
  9347  			"         │           │   └─ m (longtext)\n" +
  9348  			"         │           └─ TableAlias(n)\n" +
  9349  			"         │               └─ ProcessTable\n" +
  9350  			"         │                   └─ Table\n" +
  9351  			"         │                       ├─ name: name\n" +
  9352  			"         │                       └─ columns: [id gender]\n" +
  9353  			"         └─ HashLookup\n" +
  9354  			"             ├─ left-key: TUPLE(mi.movie_id:7!null, mi_idx.movie_id:4!null, ci.movie_id:11!null)\n" +
  9355  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null)\n" +
  9356  			"             └─ TableAlias(t)\n" +
  9357  			"                 └─ ProcessTable\n" +
  9358  			"                     └─ Table\n" +
  9359  			"                         ├─ name: title\n" +
  9360  			"                         └─ columns: [id title]\n" +
  9361  			"",
  9362  		ExpectedEstimates: "Project\n" +
  9363  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(t.title) as movie_title]\n" +
  9364  			" └─ GroupBy\n" +
  9365  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(t.title))\n" +
  9366  			"     ├─ Grouping()\n" +
  9367  			"     └─ HashJoin\n" +
  9368  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id))\n" +
  9369  			"         ├─ HashJoin\n" +
  9370  			"         │   ├─ (n.id = ci.person_id)\n" +
  9371  			"         │   ├─ HashJoin\n" +
  9372  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  9373  			"         │   │   ├─ Filter\n" +
  9374  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
  9375  			"         │   │   │   └─ TableAlias(it2)\n" +
  9376  			"         │   │   │       └─ Table\n" +
  9377  			"         │   │   │           ├─ name: info_type\n" +
  9378  			"         │   │   │           └─ columns: [id info]\n" +
  9379  			"         │   │   └─ HashLookup\n" +
  9380  			"         │   │       ├─ left-key: (it2.id)\n" +
  9381  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
  9382  			"         │   │       └─ HashJoin\n" +
  9383  			"         │   │           ├─ (it1.id = mi.info_type_id)\n" +
  9384  			"         │   │           ├─ Filter\n" +
  9385  			"         │   │           │   ├─ (it1.info = 'genres')\n" +
  9386  			"         │   │           │   └─ TableAlias(it1)\n" +
  9387  			"         │   │           │       └─ Table\n" +
  9388  			"         │   │           │           ├─ name: info_type\n" +
  9389  			"         │   │           │           └─ columns: [id info]\n" +
  9390  			"         │   │           └─ HashLookup\n" +
  9391  			"         │   │               ├─ left-key: (it1.id)\n" +
  9392  			"         │   │               ├─ right-key: (mi.info_type_id)\n" +
  9393  			"         │   │               └─ LookupJoin\n" +
  9394  			"         │   │                   ├─ InnerJoin\n" +
  9395  			"         │   │                   │   ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  9396  			"         │   │                   │   ├─ TableAlias(mi_idx)\n" +
  9397  			"         │   │                   │   │   └─ Table\n" +
  9398  			"         │   │                   │   │       ├─ name: movie_info_idx\n" +
  9399  			"         │   │                   │   │       └─ columns: [movie_id info_type_id info]\n" +
  9400  			"         │   │                   │   └─ Filter\n" +
  9401  			"         │   │                   │       ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
  9402  			"         │   │                   │       └─ TableAlias(mi)\n" +
  9403  			"         │   │                   │           └─ Table\n" +
  9404  			"         │   │                   │               ├─ name: movie_info\n" +
  9405  			"         │   │                   │               └─ columns: [movie_id info_type_id info]\n" +
  9406  			"         │   │                   └─ Filter\n" +
  9407  			"         │   │                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
  9408  			"         │   │                       └─ TableAlias(ci)\n" +
  9409  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  9410  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  9411  			"         │   │                               ├─ columns: [person_id movie_id note]\n" +
  9412  			"         │   │                               └─ keys: mi.movie_id\n" +
  9413  			"         │   └─ HashLookup\n" +
  9414  			"         │       ├─ left-key: (ci.person_id)\n" +
  9415  			"         │       ├─ right-key: (n.id)\n" +
  9416  			"         │       └─ Filter\n" +
  9417  			"         │           ├─ (n.gender = 'm')\n" +
  9418  			"         │           └─ TableAlias(n)\n" +
  9419  			"         │               └─ Table\n" +
  9420  			"         │                   ├─ name: name\n" +
  9421  			"         │                   └─ columns: [id gender]\n" +
  9422  			"         └─ HashLookup\n" +
  9423  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id)\n" +
  9424  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  9425  			"             └─ TableAlias(t)\n" +
  9426  			"                 └─ Table\n" +
  9427  			"                     ├─ name: title\n" +
  9428  			"                     └─ columns: [id title]\n" +
  9429  			"",
  9430  		ExpectedAnalysis: "Project\n" +
  9431  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(t.title) as movie_title]\n" +
  9432  			" └─ GroupBy\n" +
  9433  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(t.title))\n" +
  9434  			"     ├─ Grouping()\n" +
  9435  			"     └─ HashJoin\n" +
  9436  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id))\n" +
  9437  			"         ├─ HashJoin\n" +
  9438  			"         │   ├─ (n.id = ci.person_id)\n" +
  9439  			"         │   ├─ HashJoin\n" +
  9440  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
  9441  			"         │   │   ├─ Filter\n" +
  9442  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
  9443  			"         │   │   │   └─ TableAlias(it2)\n" +
  9444  			"         │   │   │       └─ Table\n" +
  9445  			"         │   │   │           ├─ name: info_type\n" +
  9446  			"         │   │   │           └─ columns: [id info]\n" +
  9447  			"         │   │   └─ HashLookup\n" +
  9448  			"         │   │       ├─ left-key: (it2.id)\n" +
  9449  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
  9450  			"         │   │       └─ HashJoin\n" +
  9451  			"         │   │           ├─ (it1.id = mi.info_type_id)\n" +
  9452  			"         │   │           ├─ Filter\n" +
  9453  			"         │   │           │   ├─ (it1.info = 'genres')\n" +
  9454  			"         │   │           │   └─ TableAlias(it1)\n" +
  9455  			"         │   │           │       └─ Table\n" +
  9456  			"         │   │           │           ├─ name: info_type\n" +
  9457  			"         │   │           │           └─ columns: [id info]\n" +
  9458  			"         │   │           └─ HashLookup\n" +
  9459  			"         │   │               ├─ left-key: (it1.id)\n" +
  9460  			"         │   │               ├─ right-key: (mi.info_type_id)\n" +
  9461  			"         │   │               └─ LookupJoin\n" +
  9462  			"         │   │                   ├─ InnerJoin\n" +
  9463  			"         │   │                   │   ├─ (mi.movie_id = mi_idx.movie_id)\n" +
  9464  			"         │   │                   │   ├─ TableAlias(mi_idx)\n" +
  9465  			"         │   │                   │   │   └─ Table\n" +
  9466  			"         │   │                   │   │       ├─ name: movie_info_idx\n" +
  9467  			"         │   │                   │   │       └─ columns: [movie_id info_type_id info]\n" +
  9468  			"         │   │                   │   └─ Filter\n" +
  9469  			"         │   │                   │       ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
  9470  			"         │   │                   │       └─ TableAlias(mi)\n" +
  9471  			"         │   │                   │           └─ Table\n" +
  9472  			"         │   │                   │               ├─ name: movie_info\n" +
  9473  			"         │   │                   │               └─ columns: [movie_id info_type_id info]\n" +
  9474  			"         │   │                   └─ Filter\n" +
  9475  			"         │   │                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
  9476  			"         │   │                       └─ TableAlias(ci)\n" +
  9477  			"         │   │                           └─ IndexedTableAccess(cast_info)\n" +
  9478  			"         │   │                               ├─ index: [cast_info.movie_id]\n" +
  9479  			"         │   │                               ├─ columns: [person_id movie_id note]\n" +
  9480  			"         │   │                               └─ keys: mi.movie_id\n" +
  9481  			"         │   └─ HashLookup\n" +
  9482  			"         │       ├─ left-key: (ci.person_id)\n" +
  9483  			"         │       ├─ right-key: (n.id)\n" +
  9484  			"         │       └─ Filter\n" +
  9485  			"         │           ├─ (n.gender = 'm')\n" +
  9486  			"         │           └─ TableAlias(n)\n" +
  9487  			"         │               └─ Table\n" +
  9488  			"         │                   ├─ name: name\n" +
  9489  			"         │                   └─ columns: [id gender]\n" +
  9490  			"         └─ HashLookup\n" +
  9491  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id)\n" +
  9492  			"             ├─ right-key: (t.id, t.id, t.id)\n" +
  9493  			"             └─ TableAlias(t)\n" +
  9494  			"                 └─ Table\n" +
  9495  			"                     ├─ name: title\n" +
  9496  			"                     └─ columns: [id title]\n" +
  9497  			"",
  9498  	},
  9499  	{
  9500  		Query: `
  9501  SELECT MIN(n.name) AS voicing_actress,
  9502         MIN(t.title) AS voiced_movie
  9503  FROM aka_name AS an,
  9504       char_name AS chn,
  9505       cast_info AS ci,
  9506       company_name AS cn,
  9507       info_type AS it,
  9508       movie_companies AS mc,
  9509       movie_info AS mi,
  9510       name AS n,
  9511       role_type AS rt,
  9512       title AS t
  9513  WHERE ci.note IN ('(voice)',
  9514                    '(voice: Japanese version)',
  9515                    '(voice) (uncredited)',
  9516                    '(voice: English version)')
  9517    AND cn.country_code ='[us]'
  9518    AND it.info = 'release dates'
  9519    AND mc.note IS NOT NULL
  9520    AND (mc.note LIKE '%(USA)%'
  9521         OR mc.note LIKE '%(worldwide)%')
  9522    AND mi.info IS NOT NULL
  9523    AND (mi.info LIKE 'Japan:%200%'
  9524         OR mi.info LIKE 'USA:%200%')
  9525    AND n.gender ='f'
  9526    AND n.name LIKE '%Ang%'
  9527    AND rt.role ='actress'
  9528    AND t.production_year BETWEEN 2005 AND 2009
  9529    AND t.id = mi.movie_id
  9530    AND t.id = mc.movie_id
  9531    AND t.id = ci.movie_id
  9532    AND mc.movie_id = ci.movie_id
  9533    AND mc.movie_id = mi.movie_id
  9534    AND mi.movie_id = ci.movie_id
  9535    AND cn.id = mc.company_id
  9536    AND it.id = mi.info_type_id
  9537    AND n.id = ci.person_id
  9538    AND rt.id = ci.role_id
  9539    AND n.id = an.person_id
  9540    AND ci.person_id = an.person_id
  9541    AND chn.id = ci.person_role_id;
  9542  
  9543  `,
  9544  		ExpectedPlan: "Project\n" +
  9545  			" ├─ columns: [min(n.name):0!null as voicing_actress, min(t.title):1!null as voiced_movie]\n" +
  9546  			" └─ GroupBy\n" +
  9547  			"     ├─ select: MIN(n.name:6!null), MIN(t.title:1!null)\n" +
  9548  			"     ├─ group: \n" +
  9549  			"     └─ InnerJoin\n" +
  9550  			"         ├─ AND\n" +
  9551  			"         │   ├─ AND\n" +
  9552  			"         │   │   ├─ Eq\n" +
  9553  			"         │   │   │   ├─ t.id:0!null\n" +
  9554  			"         │   │   │   └─ mi.movie_id:8!null\n" +
  9555  			"         │   │   └─ Eq\n" +
  9556  			"         │   │       ├─ t.id:0!null\n" +
  9557  			"         │   │       └─ mc.movie_id:13!null\n" +
  9558  			"         │   └─ Eq\n" +
  9559  			"         │       ├─ t.id:0!null\n" +
  9560  			"         │       └─ ci.movie_id:17!null\n" +
  9561  			"         ├─ Filter\n" +
  9562  			"         │   ├─ AND\n" +
  9563  			"         │   │   ├─ GreaterThanOrEqual\n" +
  9564  			"         │   │   │   ├─ t.production_year:2\n" +
  9565  			"         │   │   │   └─ 2005 (smallint)\n" +
  9566  			"         │   │   └─ LessThanOrEqual\n" +
  9567  			"         │   │       ├─ t.production_year:2\n" +
  9568  			"         │   │       └─ 2009 (smallint)\n" +
  9569  			"         │   └─ TableAlias(t)\n" +
  9570  			"         │       └─ ProcessTable\n" +
  9571  			"         │           └─ Table\n" +
  9572  			"         │               ├─ name: title\n" +
  9573  			"         │               └─ columns: [id title production_year]\n" +
  9574  			"         └─ InnerJoin\n" +
  9575  			"             ├─ Eq\n" +
  9576  			"             │   ├─ rt.id:3!null\n" +
  9577  			"             │   └─ ci.role_id:20!null\n" +
  9578  			"             ├─ Filter\n" +
  9579  			"             │   ├─ Eq\n" +
  9580  			"             │   │   ├─ rt.role:1!null\n" +
  9581  			"             │   │   └─ actress (longtext)\n" +
  9582  			"             │   └─ TableAlias(rt)\n" +
  9583  			"             │       └─ ProcessTable\n" +
  9584  			"             │           └─ Table\n" +
  9585  			"             │               ├─ name: role_type\n" +
  9586  			"             │               └─ columns: [id role]\n" +
  9587  			"             └─ InnerJoin\n" +
  9588  			"                 ├─ AND\n" +
  9589  			"                 │   ├─ Eq\n" +
  9590  			"                 │   │   ├─ n.id:5!null\n" +
  9591  			"                 │   │   └─ ci.person_id:16!null\n" +
  9592  			"                 │   └─ Eq\n" +
  9593  			"                 │       ├─ n.id:5!null\n" +
  9594  			"                 │       └─ an.person_id:22!null\n" +
  9595  			"                 ├─ Filter\n" +
  9596  			"                 │   ├─ AND\n" +
  9597  			"                 │   │   ├─ Eq\n" +
  9598  			"                 │   │   │   ├─ n.gender:2\n" +
  9599  			"                 │   │   │   └─ f (longtext)\n" +
  9600  			"                 │   │   └─ n.name LIKE '%Ang%'\n" +
  9601  			"                 │   └─ TableAlias(n)\n" +
  9602  			"                 │       └─ ProcessTable\n" +
  9603  			"                 │           └─ Table\n" +
  9604  			"                 │               ├─ name: name\n" +
  9605  			"                 │               └─ columns: [id name gender]\n" +
  9606  			"                 └─ InnerJoin\n" +
  9607  			"                     ├─ AND\n" +
  9608  			"                     │   ├─ Eq\n" +
  9609  			"                     │   │   ├─ mc.movie_id:13!null\n" +
  9610  			"                     │   │   └─ mi.movie_id:8!null\n" +
  9611  			"                     │   └─ Eq\n" +
  9612  			"                     │       ├─ mi.movie_id:8!null\n" +
  9613  			"                     │       └─ ci.movie_id:17!null\n" +
  9614  			"                     ├─ InnerJoin\n" +
  9615  			"                     │   ├─ Eq\n" +
  9616  			"                     │   │   ├─ it.id:11!null\n" +
  9617  			"                     │   │   └─ mi.info_type_id:9!null\n" +
  9618  			"                     │   ├─ Filter\n" +
  9619  			"                     │   │   ├─ AND\n" +
  9620  			"                     │   │   │   ├─ NOT\n" +
  9621  			"                     │   │   │   │   └─ mi.info:2!null IS NULL\n" +
  9622  			"                     │   │   │   └─ Or\n" +
  9623  			"                     │   │   │       ├─ mi.info LIKE 'Japan:%200%'\n" +
  9624  			"                     │   │   │       └─ mi.info LIKE 'USA:%200%'\n" +
  9625  			"                     │   │   └─ TableAlias(mi)\n" +
  9626  			"                     │   │       └─ ProcessTable\n" +
  9627  			"                     │   │           └─ Table\n" +
  9628  			"                     │   │               ├─ name: movie_info\n" +
  9629  			"                     │   │               └─ columns: [movie_id info_type_id info]\n" +
  9630  			"                     │   └─ Filter\n" +
  9631  			"                     │       ├─ Eq\n" +
  9632  			"                     │       │   ├─ it.info:1!null\n" +
  9633  			"                     │       │   └─ release dates (longtext)\n" +
  9634  			"                     │       └─ TableAlias(it)\n" +
  9635  			"                     │           └─ ProcessTable\n" +
  9636  			"                     │               └─ Table\n" +
  9637  			"                     │                   ├─ name: info_type\n" +
  9638  			"                     │                   └─ columns: [id info]\n" +
  9639  			"                     └─ InnerJoin\n" +
  9640  			"                         ├─ Eq\n" +
  9641  			"                         │   ├─ cn.id:23!null\n" +
  9642  			"                         │   └─ mc.company_id:14!null\n" +
  9643  			"                         ├─ InnerJoin\n" +
  9644  			"                         │   ├─ Eq\n" +
  9645  			"                         │   │   ├─ mc.movie_id:13!null\n" +
  9646  			"                         │   │   └─ ci.movie_id:17!null\n" +
  9647  			"                         │   ├─ Filter\n" +
  9648  			"                         │   │   ├─ AND\n" +
  9649  			"                         │   │   │   ├─ NOT\n" +
  9650  			"                         │   │   │   │   └─ mc.note:2 IS NULL\n" +
  9651  			"                         │   │   │   └─ Or\n" +
  9652  			"                         │   │   │       ├─ mc.note LIKE '%(USA)%'\n" +
  9653  			"                         │   │   │       └─ mc.note LIKE '%(worldwide)%'\n" +
  9654  			"                         │   │   └─ TableAlias(mc)\n" +
  9655  			"                         │   │       └─ ProcessTable\n" +
  9656  			"                         │   │           └─ Table\n" +
  9657  			"                         │   │               ├─ name: movie_companies\n" +
  9658  			"                         │   │               └─ columns: [movie_id company_id note]\n" +
  9659  			"                         │   └─ LookupJoin\n" +
  9660  			"                         │       ├─ InnerJoin\n" +
  9661  			"                         │       │   ├─ Eq\n" +
  9662  			"                         │       │   │   ├─ chn.id:21!null\n" +
  9663  			"                         │       │   │   └─ ci.person_role_id:18\n" +
  9664  			"                         │       │   ├─ Filter\n" +
  9665  			"                         │       │   │   ├─ HashIn\n" +
  9666  			"                         │       │   │   │   ├─ ci.note:3\n" +
  9667  			"                         │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
  9668  			"                         │       │   │   └─ TableAlias(ci)\n" +
  9669  			"                         │       │   │       └─ ProcessTable\n" +
  9670  			"                         │       │   │           └─ Table\n" +
  9671  			"                         │       │   │               ├─ name: cast_info\n" +
  9672  			"                         │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
  9673  			"                         │       │   └─ TableAlias(chn)\n" +
  9674  			"                         │       │       └─ ProcessTable\n" +
  9675  			"                         │       │           └─ Table\n" +
  9676  			"                         │       │               ├─ name: char_name\n" +
  9677  			"                         │       │               └─ columns: [id]\n" +
  9678  			"                         │       └─ TableAlias(an)\n" +
  9679  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
  9680  			"                         │               ├─ index: [aka_name.person_id]\n" +
  9681  			"                         │               ├─ keys: [ci.person_id:16!null]\n" +
  9682  			"                         │               ├─ colSet: (1-8)\n" +
  9683  			"                         │               ├─ tableId: 1\n" +
  9684  			"                         │               └─ Table\n" +
  9685  			"                         │                   ├─ name: aka_name\n" +
  9686  			"                         │                   └─ columns: [person_id]\n" +
  9687  			"                         └─ Filter\n" +
  9688  			"                             ├─ Eq\n" +
  9689  			"                             │   ├─ cn.country_code:1\n" +
  9690  			"                             │   └─ [us] (longtext)\n" +
  9691  			"                             └─ TableAlias(cn)\n" +
  9692  			"                                 └─ ProcessTable\n" +
  9693  			"                                     └─ Table\n" +
  9694  			"                                         ├─ name: company_name\n" +
  9695  			"                                         └─ columns: [id country_code]\n" +
  9696  			"",
  9697  		ExpectedEstimates: "Project\n" +
  9698  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as voiced_movie]\n" +
  9699  			" └─ GroupBy\n" +
  9700  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
  9701  			"     ├─ Grouping()\n" +
  9702  			"     └─ InnerJoin\n" +
  9703  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
  9704  			"         ├─ Filter\n" +
  9705  			"         │   ├─ ((t.production_year >= 2005) AND (t.production_year <= 2009))\n" +
  9706  			"         │   └─ TableAlias(t)\n" +
  9707  			"         │       └─ Table\n" +
  9708  			"         │           ├─ name: title\n" +
  9709  			"         │           └─ columns: [id title production_year]\n" +
  9710  			"         └─ InnerJoin\n" +
  9711  			"             ├─ (rt.id = ci.role_id)\n" +
  9712  			"             ├─ Filter\n" +
  9713  			"             │   ├─ (rt.role = 'actress')\n" +
  9714  			"             │   └─ TableAlias(rt)\n" +
  9715  			"             │       └─ Table\n" +
  9716  			"             │           ├─ name: role_type\n" +
  9717  			"             │           └─ columns: [id role]\n" +
  9718  			"             └─ InnerJoin\n" +
  9719  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
  9720  			"                 ├─ Filter\n" +
  9721  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Ang%')\n" +
  9722  			"                 │   └─ TableAlias(n)\n" +
  9723  			"                 │       └─ Table\n" +
  9724  			"                 │           ├─ name: name\n" +
  9725  			"                 │           └─ columns: [id name gender]\n" +
  9726  			"                 └─ InnerJoin\n" +
  9727  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
  9728  			"                     ├─ InnerJoin\n" +
  9729  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
  9730  			"                     │   ├─ Filter\n" +
  9731  			"                     │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
  9732  			"                     │   │   └─ TableAlias(mi)\n" +
  9733  			"                     │   │       └─ Table\n" +
  9734  			"                     │   │           ├─ name: movie_info\n" +
  9735  			"                     │   │           └─ columns: [movie_id info_type_id info]\n" +
  9736  			"                     │   └─ Filter\n" +
  9737  			"                     │       ├─ (it.info = 'release dates')\n" +
  9738  			"                     │       └─ TableAlias(it)\n" +
  9739  			"                     │           └─ Table\n" +
  9740  			"                     │               ├─ name: info_type\n" +
  9741  			"                     │               └─ columns: [id info]\n" +
  9742  			"                     └─ InnerJoin\n" +
  9743  			"                         ├─ (cn.id = mc.company_id)\n" +
  9744  			"                         ├─ InnerJoin\n" +
  9745  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
  9746  			"                         │   ├─ Filter\n" +
  9747  			"                         │   │   ├─ ((NOT(mc.note IS NULL)) AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
  9748  			"                         │   │   └─ TableAlias(mc)\n" +
  9749  			"                         │   │       └─ Table\n" +
  9750  			"                         │   │           ├─ name: movie_companies\n" +
  9751  			"                         │   │           └─ columns: [movie_id company_id note]\n" +
  9752  			"                         │   └─ LookupJoin\n" +
  9753  			"                         │       ├─ InnerJoin\n" +
  9754  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
  9755  			"                         │       │   ├─ Filter\n" +
  9756  			"                         │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
  9757  			"                         │       │   │   └─ TableAlias(ci)\n" +
  9758  			"                         │       │   │       └─ Table\n" +
  9759  			"                         │       │   │           ├─ name: cast_info\n" +
  9760  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
  9761  			"                         │       │   └─ TableAlias(chn)\n" +
  9762  			"                         │       │       └─ Table\n" +
  9763  			"                         │       │           ├─ name: char_name\n" +
  9764  			"                         │       │           └─ columns: [id]\n" +
  9765  			"                         │       └─ TableAlias(an)\n" +
  9766  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
  9767  			"                         │               ├─ index: [aka_name.person_id]\n" +
  9768  			"                         │               ├─ columns: [person_id]\n" +
  9769  			"                         │               └─ keys: ci.person_id\n" +
  9770  			"                         └─ Filter\n" +
  9771  			"                             ├─ (cn.country_code = '[us]')\n" +
  9772  			"                             └─ TableAlias(cn)\n" +
  9773  			"                                 └─ Table\n" +
  9774  			"                                     ├─ name: company_name\n" +
  9775  			"                                     └─ columns: [id country_code]\n" +
  9776  			"",
  9777  		ExpectedAnalysis: "Project\n" +
  9778  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as voiced_movie]\n" +
  9779  			" └─ GroupBy\n" +
  9780  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
  9781  			"     ├─ Grouping()\n" +
  9782  			"     └─ InnerJoin\n" +
  9783  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
  9784  			"         ├─ Filter\n" +
  9785  			"         │   ├─ ((t.production_year >= 2005) AND (t.production_year <= 2009))\n" +
  9786  			"         │   └─ TableAlias(t)\n" +
  9787  			"         │       └─ Table\n" +
  9788  			"         │           ├─ name: title\n" +
  9789  			"         │           └─ columns: [id title production_year]\n" +
  9790  			"         └─ InnerJoin\n" +
  9791  			"             ├─ (rt.id = ci.role_id)\n" +
  9792  			"             ├─ Filter\n" +
  9793  			"             │   ├─ (rt.role = 'actress')\n" +
  9794  			"             │   └─ TableAlias(rt)\n" +
  9795  			"             │       └─ Table\n" +
  9796  			"             │           ├─ name: role_type\n" +
  9797  			"             │           └─ columns: [id role]\n" +
  9798  			"             └─ InnerJoin\n" +
  9799  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
  9800  			"                 ├─ Filter\n" +
  9801  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Ang%')\n" +
  9802  			"                 │   └─ TableAlias(n)\n" +
  9803  			"                 │       └─ Table\n" +
  9804  			"                 │           ├─ name: name\n" +
  9805  			"                 │           └─ columns: [id name gender]\n" +
  9806  			"                 └─ InnerJoin\n" +
  9807  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
  9808  			"                     ├─ InnerJoin\n" +
  9809  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
  9810  			"                     │   ├─ Filter\n" +
  9811  			"                     │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
  9812  			"                     │   │   └─ TableAlias(mi)\n" +
  9813  			"                     │   │       └─ Table\n" +
  9814  			"                     │   │           ├─ name: movie_info\n" +
  9815  			"                     │   │           └─ columns: [movie_id info_type_id info]\n" +
  9816  			"                     │   └─ Filter\n" +
  9817  			"                     │       ├─ (it.info = 'release dates')\n" +
  9818  			"                     │       └─ TableAlias(it)\n" +
  9819  			"                     │           └─ Table\n" +
  9820  			"                     │               ├─ name: info_type\n" +
  9821  			"                     │               └─ columns: [id info]\n" +
  9822  			"                     └─ InnerJoin\n" +
  9823  			"                         ├─ (cn.id = mc.company_id)\n" +
  9824  			"                         ├─ InnerJoin\n" +
  9825  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
  9826  			"                         │   ├─ Filter\n" +
  9827  			"                         │   │   ├─ ((NOT(mc.note IS NULL)) AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
  9828  			"                         │   │   └─ TableAlias(mc)\n" +
  9829  			"                         │   │       └─ Table\n" +
  9830  			"                         │   │           ├─ name: movie_companies\n" +
  9831  			"                         │   │           └─ columns: [movie_id company_id note]\n" +
  9832  			"                         │   └─ LookupJoin\n" +
  9833  			"                         │       ├─ InnerJoin\n" +
  9834  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
  9835  			"                         │       │   ├─ Filter\n" +
  9836  			"                         │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
  9837  			"                         │       │   │   └─ TableAlias(ci)\n" +
  9838  			"                         │       │   │       └─ Table\n" +
  9839  			"                         │       │   │           ├─ name: cast_info\n" +
  9840  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
  9841  			"                         │       │   └─ TableAlias(chn)\n" +
  9842  			"                         │       │       └─ Table\n" +
  9843  			"                         │       │           ├─ name: char_name\n" +
  9844  			"                         │       │           └─ columns: [id]\n" +
  9845  			"                         │       └─ TableAlias(an)\n" +
  9846  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
  9847  			"                         │               ├─ index: [aka_name.person_id]\n" +
  9848  			"                         │               ├─ columns: [person_id]\n" +
  9849  			"                         │               └─ keys: ci.person_id\n" +
  9850  			"                         └─ Filter\n" +
  9851  			"                             ├─ (cn.country_code = '[us]')\n" +
  9852  			"                             └─ TableAlias(cn)\n" +
  9853  			"                                 └─ Table\n" +
  9854  			"                                     ├─ name: company_name\n" +
  9855  			"                                     └─ columns: [id country_code]\n" +
  9856  			"",
  9857  	},
  9858  	{
  9859  		Query: `
  9860  SELECT MIN(n.name) AS voicing_actress,
  9861         MIN(t.title) AS kung_fu_panda
  9862  FROM aka_name AS an,
  9863       char_name AS chn,
  9864       cast_info AS ci,
  9865       company_name AS cn,
  9866       info_type AS it,
  9867       movie_companies AS mc,
  9868       movie_info AS mi,
  9869       name AS n,
  9870       role_type AS rt,
  9871       title AS t
  9872  WHERE ci.note = '(voice)'
  9873    AND cn.country_code ='[us]'
  9874    AND it.info = 'release dates'
  9875    AND mc.note LIKE '%(200%)%'
  9876    AND (mc.note LIKE '%(USA)%'
  9877         OR mc.note LIKE '%(worldwide)%')
  9878    AND mi.info IS NOT NULL
  9879    AND (mi.info LIKE 'Japan:%2007%'
  9880         OR mi.info LIKE 'USA:%2008%')
  9881    AND n.gender ='f'
  9882    AND n.name LIKE '%Angel%'
  9883    AND rt.role ='actress'
  9884    AND t.production_year BETWEEN 2007 AND 2008
  9885    AND t.title LIKE '%Kung%Fu%Panda%'
  9886    AND t.id = mi.movie_id
  9887    AND t.id = mc.movie_id
  9888    AND t.id = ci.movie_id
  9889    AND mc.movie_id = ci.movie_id
  9890    AND mc.movie_id = mi.movie_id
  9891    AND mi.movie_id = ci.movie_id
  9892    AND cn.id = mc.company_id
  9893    AND it.id = mi.info_type_id
  9894    AND n.id = ci.person_id
  9895    AND rt.id = ci.role_id
  9896    AND n.id = an.person_id
  9897    AND ci.person_id = an.person_id
  9898    AND chn.id = ci.person_role_id;
  9899  
  9900  `,
  9901  		ExpectedPlan: "Project\n" +
  9902  			" ├─ columns: [min(n.name):0!null as voicing_actress, min(t.title):1!null as kung_fu_panda]\n" +
  9903  			" └─ GroupBy\n" +
  9904  			"     ├─ select: MIN(n.name:6!null), MIN(t.title:1!null)\n" +
  9905  			"     ├─ group: \n" +
  9906  			"     └─ InnerJoin\n" +
  9907  			"         ├─ AND\n" +
  9908  			"         │   ├─ AND\n" +
  9909  			"         │   │   ├─ Eq\n" +
  9910  			"         │   │   │   ├─ t.id:0!null\n" +
  9911  			"         │   │   │   └─ mi.movie_id:8!null\n" +
  9912  			"         │   │   └─ Eq\n" +
  9913  			"         │   │       ├─ t.id:0!null\n" +
  9914  			"         │   │       └─ mc.movie_id:13!null\n" +
  9915  			"         │   └─ Eq\n" +
  9916  			"         │       ├─ t.id:0!null\n" +
  9917  			"         │       └─ ci.movie_id:17!null\n" +
  9918  			"         ├─ Filter\n" +
  9919  			"         │   ├─ AND\n" +
  9920  			"         │   │   ├─ AND\n" +
  9921  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
  9922  			"         │   │   │   │   ├─ t.production_year:2\n" +
  9923  			"         │   │   │   │   └─ 2007 (smallint)\n" +
  9924  			"         │   │   │   └─ LessThanOrEqual\n" +
  9925  			"         │   │   │       ├─ t.production_year:2\n" +
  9926  			"         │   │   │       └─ 2008 (smallint)\n" +
  9927  			"         │   │   └─ t.title LIKE '%Kung%Fu%Panda%'\n" +
  9928  			"         │   └─ TableAlias(t)\n" +
  9929  			"         │       └─ ProcessTable\n" +
  9930  			"         │           └─ Table\n" +
  9931  			"         │               ├─ name: title\n" +
  9932  			"         │               └─ columns: [id title production_year]\n" +
  9933  			"         └─ InnerJoin\n" +
  9934  			"             ├─ Eq\n" +
  9935  			"             │   ├─ rt.id:3!null\n" +
  9936  			"             │   └─ ci.role_id:20!null\n" +
  9937  			"             ├─ Filter\n" +
  9938  			"             │   ├─ Eq\n" +
  9939  			"             │   │   ├─ rt.role:1!null\n" +
  9940  			"             │   │   └─ actress (longtext)\n" +
  9941  			"             │   └─ TableAlias(rt)\n" +
  9942  			"             │       └─ ProcessTable\n" +
  9943  			"             │           └─ Table\n" +
  9944  			"             │               ├─ name: role_type\n" +
  9945  			"             │               └─ columns: [id role]\n" +
  9946  			"             └─ InnerJoin\n" +
  9947  			"                 ├─ AND\n" +
  9948  			"                 │   ├─ Eq\n" +
  9949  			"                 │   │   ├─ n.id:5!null\n" +
  9950  			"                 │   │   └─ ci.person_id:16!null\n" +
  9951  			"                 │   └─ Eq\n" +
  9952  			"                 │       ├─ n.id:5!null\n" +
  9953  			"                 │       └─ an.person_id:22!null\n" +
  9954  			"                 ├─ Filter\n" +
  9955  			"                 │   ├─ AND\n" +
  9956  			"                 │   │   ├─ Eq\n" +
  9957  			"                 │   │   │   ├─ n.gender:2\n" +
  9958  			"                 │   │   │   └─ f (longtext)\n" +
  9959  			"                 │   │   └─ n.name LIKE '%Angel%'\n" +
  9960  			"                 │   └─ TableAlias(n)\n" +
  9961  			"                 │       └─ ProcessTable\n" +
  9962  			"                 │           └─ Table\n" +
  9963  			"                 │               ├─ name: name\n" +
  9964  			"                 │               └─ columns: [id name gender]\n" +
  9965  			"                 └─ InnerJoin\n" +
  9966  			"                     ├─ AND\n" +
  9967  			"                     │   ├─ Eq\n" +
  9968  			"                     │   │   ├─ mc.movie_id:13!null\n" +
  9969  			"                     │   │   └─ mi.movie_id:8!null\n" +
  9970  			"                     │   └─ Eq\n" +
  9971  			"                     │       ├─ mi.movie_id:8!null\n" +
  9972  			"                     │       └─ ci.movie_id:17!null\n" +
  9973  			"                     ├─ InnerJoin\n" +
  9974  			"                     │   ├─ Eq\n" +
  9975  			"                     │   │   ├─ it.id:11!null\n" +
  9976  			"                     │   │   └─ mi.info_type_id:9!null\n" +
  9977  			"                     │   ├─ Filter\n" +
  9978  			"                     │   │   ├─ AND\n" +
  9979  			"                     │   │   │   ├─ NOT\n" +
  9980  			"                     │   │   │   │   └─ mi.info:2!null IS NULL\n" +
  9981  			"                     │   │   │   └─ Or\n" +
  9982  			"                     │   │   │       ├─ mi.info LIKE 'Japan:%2007%'\n" +
  9983  			"                     │   │   │       └─ mi.info LIKE 'USA:%2008%'\n" +
  9984  			"                     │   │   └─ TableAlias(mi)\n" +
  9985  			"                     │   │       └─ ProcessTable\n" +
  9986  			"                     │   │           └─ Table\n" +
  9987  			"                     │   │               ├─ name: movie_info\n" +
  9988  			"                     │   │               └─ columns: [movie_id info_type_id info]\n" +
  9989  			"                     │   └─ Filter\n" +
  9990  			"                     │       ├─ Eq\n" +
  9991  			"                     │       │   ├─ it.info:1!null\n" +
  9992  			"                     │       │   └─ release dates (longtext)\n" +
  9993  			"                     │       └─ TableAlias(it)\n" +
  9994  			"                     │           └─ ProcessTable\n" +
  9995  			"                     │               └─ Table\n" +
  9996  			"                     │                   ├─ name: info_type\n" +
  9997  			"                     │                   └─ columns: [id info]\n" +
  9998  			"                     └─ InnerJoin\n" +
  9999  			"                         ├─ Eq\n" +
 10000  			"                         │   ├─ cn.id:23!null\n" +
 10001  			"                         │   └─ mc.company_id:14!null\n" +
 10002  			"                         ├─ InnerJoin\n" +
 10003  			"                         │   ├─ Eq\n" +
 10004  			"                         │   │   ├─ mc.movie_id:13!null\n" +
 10005  			"                         │   │   └─ ci.movie_id:17!null\n" +
 10006  			"                         │   ├─ Filter\n" +
 10007  			"                         │   │   ├─ AND\n" +
 10008  			"                         │   │   │   ├─ mc.note LIKE '%(200%)%'\n" +
 10009  			"                         │   │   │   └─ Or\n" +
 10010  			"                         │   │   │       ├─ mc.note LIKE '%(USA)%'\n" +
 10011  			"                         │   │   │       └─ mc.note LIKE '%(worldwide)%'\n" +
 10012  			"                         │   │   └─ TableAlias(mc)\n" +
 10013  			"                         │   │       └─ ProcessTable\n" +
 10014  			"                         │   │           └─ Table\n" +
 10015  			"                         │   │               ├─ name: movie_companies\n" +
 10016  			"                         │   │               └─ columns: [movie_id company_id note]\n" +
 10017  			"                         │   └─ LookupJoin\n" +
 10018  			"                         │       ├─ InnerJoin\n" +
 10019  			"                         │       │   ├─ Eq\n" +
 10020  			"                         │       │   │   ├─ chn.id:21!null\n" +
 10021  			"                         │       │   │   └─ ci.person_role_id:18\n" +
 10022  			"                         │       │   ├─ Filter\n" +
 10023  			"                         │       │   │   ├─ Eq\n" +
 10024  			"                         │       │   │   │   ├─ ci.note:3\n" +
 10025  			"                         │       │   │   │   └─ (voice) (longtext)\n" +
 10026  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10027  			"                         │       │   │       └─ ProcessTable\n" +
 10028  			"                         │       │   │           └─ Table\n" +
 10029  			"                         │       │   │               ├─ name: cast_info\n" +
 10030  			"                         │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10031  			"                         │       │   └─ TableAlias(chn)\n" +
 10032  			"                         │       │       └─ ProcessTable\n" +
 10033  			"                         │       │           └─ Table\n" +
 10034  			"                         │       │               ├─ name: char_name\n" +
 10035  			"                         │       │               └─ columns: [id]\n" +
 10036  			"                         │       └─ TableAlias(an)\n" +
 10037  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10038  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10039  			"                         │               ├─ keys: [ci.person_id:16!null]\n" +
 10040  			"                         │               ├─ colSet: (1-8)\n" +
 10041  			"                         │               ├─ tableId: 1\n" +
 10042  			"                         │               └─ Table\n" +
 10043  			"                         │                   ├─ name: aka_name\n" +
 10044  			"                         │                   └─ columns: [person_id]\n" +
 10045  			"                         └─ Filter\n" +
 10046  			"                             ├─ Eq\n" +
 10047  			"                             │   ├─ cn.country_code:1\n" +
 10048  			"                             │   └─ [us] (longtext)\n" +
 10049  			"                             └─ TableAlias(cn)\n" +
 10050  			"                                 └─ ProcessTable\n" +
 10051  			"                                     └─ Table\n" +
 10052  			"                                         ├─ name: company_name\n" +
 10053  			"                                         └─ columns: [id country_code]\n" +
 10054  			"",
 10055  		ExpectedEstimates: "Project\n" +
 10056  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as kung_fu_panda]\n" +
 10057  			" └─ GroupBy\n" +
 10058  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 10059  			"     ├─ Grouping()\n" +
 10060  			"     └─ InnerJoin\n" +
 10061  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
 10062  			"         ├─ Filter\n" +
 10063  			"         │   ├─ (((t.production_year >= 2007) AND (t.production_year <= 2008)) AND t.title LIKE '%Kung%Fu%Panda%')\n" +
 10064  			"         │   └─ TableAlias(t)\n" +
 10065  			"         │       └─ Table\n" +
 10066  			"         │           ├─ name: title\n" +
 10067  			"         │           └─ columns: [id title production_year]\n" +
 10068  			"         └─ InnerJoin\n" +
 10069  			"             ├─ (rt.id = ci.role_id)\n" +
 10070  			"             ├─ Filter\n" +
 10071  			"             │   ├─ (rt.role = 'actress')\n" +
 10072  			"             │   └─ TableAlias(rt)\n" +
 10073  			"             │       └─ Table\n" +
 10074  			"             │           ├─ name: role_type\n" +
 10075  			"             │           └─ columns: [id role]\n" +
 10076  			"             └─ InnerJoin\n" +
 10077  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 10078  			"                 ├─ Filter\n" +
 10079  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Angel%')\n" +
 10080  			"                 │   └─ TableAlias(n)\n" +
 10081  			"                 │       └─ Table\n" +
 10082  			"                 │           ├─ name: name\n" +
 10083  			"                 │           └─ columns: [id name gender]\n" +
 10084  			"                 └─ InnerJoin\n" +
 10085  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 10086  			"                     ├─ InnerJoin\n" +
 10087  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
 10088  			"                     │   ├─ Filter\n" +
 10089  			"                     │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%2007%' OR mi.info LIKE 'USA:%2008%'))\n" +
 10090  			"                     │   │   └─ TableAlias(mi)\n" +
 10091  			"                     │   │       └─ Table\n" +
 10092  			"                     │   │           ├─ name: movie_info\n" +
 10093  			"                     │   │           └─ columns: [movie_id info_type_id info]\n" +
 10094  			"                     │   └─ Filter\n" +
 10095  			"                     │       ├─ (it.info = 'release dates')\n" +
 10096  			"                     │       └─ TableAlias(it)\n" +
 10097  			"                     │           └─ Table\n" +
 10098  			"                     │               ├─ name: info_type\n" +
 10099  			"                     │               └─ columns: [id info]\n" +
 10100  			"                     └─ InnerJoin\n" +
 10101  			"                         ├─ (cn.id = mc.company_id)\n" +
 10102  			"                         ├─ InnerJoin\n" +
 10103  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
 10104  			"                         │   ├─ Filter\n" +
 10105  			"                         │   │   ├─ (mc.note LIKE '%(200%)%' AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
 10106  			"                         │   │   └─ TableAlias(mc)\n" +
 10107  			"                         │   │       └─ Table\n" +
 10108  			"                         │   │           ├─ name: movie_companies\n" +
 10109  			"                         │   │           └─ columns: [movie_id company_id note]\n" +
 10110  			"                         │   └─ LookupJoin\n" +
 10111  			"                         │       ├─ InnerJoin\n" +
 10112  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
 10113  			"                         │       │   ├─ Filter\n" +
 10114  			"                         │       │   │   ├─ (ci.note = '(voice)')\n" +
 10115  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10116  			"                         │       │   │       └─ Table\n" +
 10117  			"                         │       │   │           ├─ name: cast_info\n" +
 10118  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10119  			"                         │       │   └─ TableAlias(chn)\n" +
 10120  			"                         │       │       └─ Table\n" +
 10121  			"                         │       │           ├─ name: char_name\n" +
 10122  			"                         │       │           └─ columns: [id]\n" +
 10123  			"                         │       └─ TableAlias(an)\n" +
 10124  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10125  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10126  			"                         │               ├─ columns: [person_id]\n" +
 10127  			"                         │               └─ keys: ci.person_id\n" +
 10128  			"                         └─ Filter\n" +
 10129  			"                             ├─ (cn.country_code = '[us]')\n" +
 10130  			"                             └─ TableAlias(cn)\n" +
 10131  			"                                 └─ Table\n" +
 10132  			"                                     ├─ name: company_name\n" +
 10133  			"                                     └─ columns: [id country_code]\n" +
 10134  			"",
 10135  		ExpectedAnalysis: "Project\n" +
 10136  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as kung_fu_panda]\n" +
 10137  			" └─ GroupBy\n" +
 10138  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 10139  			"     ├─ Grouping()\n" +
 10140  			"     └─ InnerJoin\n" +
 10141  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
 10142  			"         ├─ Filter\n" +
 10143  			"         │   ├─ (((t.production_year >= 2007) AND (t.production_year <= 2008)) AND t.title LIKE '%Kung%Fu%Panda%')\n" +
 10144  			"         │   └─ TableAlias(t)\n" +
 10145  			"         │       └─ Table\n" +
 10146  			"         │           ├─ name: title\n" +
 10147  			"         │           └─ columns: [id title production_year]\n" +
 10148  			"         └─ InnerJoin\n" +
 10149  			"             ├─ (rt.id = ci.role_id)\n" +
 10150  			"             ├─ Filter\n" +
 10151  			"             │   ├─ (rt.role = 'actress')\n" +
 10152  			"             │   └─ TableAlias(rt)\n" +
 10153  			"             │       └─ Table\n" +
 10154  			"             │           ├─ name: role_type\n" +
 10155  			"             │           └─ columns: [id role]\n" +
 10156  			"             └─ InnerJoin\n" +
 10157  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 10158  			"                 ├─ Filter\n" +
 10159  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Angel%')\n" +
 10160  			"                 │   └─ TableAlias(n)\n" +
 10161  			"                 │       └─ Table\n" +
 10162  			"                 │           ├─ name: name\n" +
 10163  			"                 │           └─ columns: [id name gender]\n" +
 10164  			"                 └─ InnerJoin\n" +
 10165  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 10166  			"                     ├─ InnerJoin\n" +
 10167  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
 10168  			"                     │   ├─ Filter\n" +
 10169  			"                     │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%2007%' OR mi.info LIKE 'USA:%2008%'))\n" +
 10170  			"                     │   │   └─ TableAlias(mi)\n" +
 10171  			"                     │   │       └─ Table\n" +
 10172  			"                     │   │           ├─ name: movie_info\n" +
 10173  			"                     │   │           └─ columns: [movie_id info_type_id info]\n" +
 10174  			"                     │   └─ Filter\n" +
 10175  			"                     │       ├─ (it.info = 'release dates')\n" +
 10176  			"                     │       └─ TableAlias(it)\n" +
 10177  			"                     │           └─ Table\n" +
 10178  			"                     │               ├─ name: info_type\n" +
 10179  			"                     │               └─ columns: [id info]\n" +
 10180  			"                     └─ InnerJoin\n" +
 10181  			"                         ├─ (cn.id = mc.company_id)\n" +
 10182  			"                         ├─ InnerJoin\n" +
 10183  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
 10184  			"                         │   ├─ Filter\n" +
 10185  			"                         │   │   ├─ (mc.note LIKE '%(200%)%' AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
 10186  			"                         │   │   └─ TableAlias(mc)\n" +
 10187  			"                         │   │       └─ Table\n" +
 10188  			"                         │   │           ├─ name: movie_companies\n" +
 10189  			"                         │   │           └─ columns: [movie_id company_id note]\n" +
 10190  			"                         │   └─ LookupJoin\n" +
 10191  			"                         │       ├─ InnerJoin\n" +
 10192  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
 10193  			"                         │       │   ├─ Filter\n" +
 10194  			"                         │       │   │   ├─ (ci.note = '(voice)')\n" +
 10195  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10196  			"                         │       │   │       └─ Table\n" +
 10197  			"                         │       │   │           ├─ name: cast_info\n" +
 10198  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10199  			"                         │       │   └─ TableAlias(chn)\n" +
 10200  			"                         │       │       └─ Table\n" +
 10201  			"                         │       │           ├─ name: char_name\n" +
 10202  			"                         │       │           └─ columns: [id]\n" +
 10203  			"                         │       └─ TableAlias(an)\n" +
 10204  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10205  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10206  			"                         │               ├─ columns: [person_id]\n" +
 10207  			"                         │               └─ keys: ci.person_id\n" +
 10208  			"                         └─ Filter\n" +
 10209  			"                             ├─ (cn.country_code = '[us]')\n" +
 10210  			"                             └─ TableAlias(cn)\n" +
 10211  			"                                 └─ Table\n" +
 10212  			"                                     ├─ name: company_name\n" +
 10213  			"                                     └─ columns: [id country_code]\n" +
 10214  			"",
 10215  	},
 10216  	{
 10217  		Query: `
 10218  SELECT MIN(n.name) AS voicing_actress,
 10219         MIN(t.title) AS jap_engl_voiced_movie
 10220  FROM aka_name AS an,
 10221       char_name AS chn,
 10222       cast_info AS ci,
 10223       company_name AS cn,
 10224       info_type AS it,
 10225       movie_companies AS mc,
 10226       movie_info AS mi,
 10227       name AS n,
 10228       role_type AS rt,
 10229       title AS t
 10230  WHERE ci.note IN ('(voice)',
 10231                    '(voice: Japanese version)',
 10232                    '(voice) (uncredited)',
 10233                    '(voice: English version)')
 10234    AND cn.country_code ='[us]'
 10235    AND it.info = 'release dates'
 10236    AND mi.info IS NOT NULL
 10237    AND (mi.info LIKE 'Japan:%200%'
 10238         OR mi.info LIKE 'USA:%200%')
 10239    AND n.gender ='f'
 10240    AND n.name LIKE '%An%'
 10241    AND rt.role ='actress'
 10242    AND t.production_year > 2000
 10243    AND t.id = mi.movie_id
 10244    AND t.id = mc.movie_id
 10245    AND t.id = ci.movie_id
 10246    AND mc.movie_id = ci.movie_id
 10247    AND mc.movie_id = mi.movie_id
 10248    AND mi.movie_id = ci.movie_id
 10249    AND cn.id = mc.company_id
 10250    AND it.id = mi.info_type_id
 10251    AND n.id = ci.person_id
 10252    AND rt.id = ci.role_id
 10253    AND n.id = an.person_id
 10254    AND ci.person_id = an.person_id
 10255    AND chn.id = ci.person_role_id;
 10256  
 10257  `,
 10258  		ExpectedPlan: "Project\n" +
 10259  			" ├─ columns: [min(n.name):0!null as voicing_actress, min(t.title):1!null as jap_engl_voiced_movie]\n" +
 10260  			" └─ GroupBy\n" +
 10261  			"     ├─ select: MIN(n.name:6!null), MIN(t.title:1!null)\n" +
 10262  			"     ├─ group: \n" +
 10263  			"     └─ InnerJoin\n" +
 10264  			"         ├─ AND\n" +
 10265  			"         │   ├─ AND\n" +
 10266  			"         │   │   ├─ Eq\n" +
 10267  			"         │   │   │   ├─ t.id:0!null\n" +
 10268  			"         │   │   │   └─ mi.movie_id:8!null\n" +
 10269  			"         │   │   └─ Eq\n" +
 10270  			"         │   │       ├─ t.id:0!null\n" +
 10271  			"         │   │       └─ mc.movie_id:13!null\n" +
 10272  			"         │   └─ Eq\n" +
 10273  			"         │       ├─ t.id:0!null\n" +
 10274  			"         │       └─ ci.movie_id:16!null\n" +
 10275  			"         ├─ Filter\n" +
 10276  			"         │   ├─ GreaterThan\n" +
 10277  			"         │   │   ├─ t.production_year:2\n" +
 10278  			"         │   │   └─ 2000 (smallint)\n" +
 10279  			"         │   └─ TableAlias(t)\n" +
 10280  			"         │       └─ ProcessTable\n" +
 10281  			"         │           └─ Table\n" +
 10282  			"         │               ├─ name: title\n" +
 10283  			"         │               └─ columns: [id title production_year]\n" +
 10284  			"         └─ InnerJoin\n" +
 10285  			"             ├─ Eq\n" +
 10286  			"             │   ├─ rt.id:3!null\n" +
 10287  			"             │   └─ ci.role_id:19!null\n" +
 10288  			"             ├─ Filter\n" +
 10289  			"             │   ├─ Eq\n" +
 10290  			"             │   │   ├─ rt.role:1!null\n" +
 10291  			"             │   │   └─ actress (longtext)\n" +
 10292  			"             │   └─ TableAlias(rt)\n" +
 10293  			"             │       └─ ProcessTable\n" +
 10294  			"             │           └─ Table\n" +
 10295  			"             │               ├─ name: role_type\n" +
 10296  			"             │               └─ columns: [id role]\n" +
 10297  			"             └─ InnerJoin\n" +
 10298  			"                 ├─ AND\n" +
 10299  			"                 │   ├─ Eq\n" +
 10300  			"                 │   │   ├─ n.id:5!null\n" +
 10301  			"                 │   │   └─ ci.person_id:15!null\n" +
 10302  			"                 │   └─ Eq\n" +
 10303  			"                 │       ├─ n.id:5!null\n" +
 10304  			"                 │       └─ an.person_id:21!null\n" +
 10305  			"                 ├─ Filter\n" +
 10306  			"                 │   ├─ AND\n" +
 10307  			"                 │   │   ├─ Eq\n" +
 10308  			"                 │   │   │   ├─ n.gender:2\n" +
 10309  			"                 │   │   │   └─ f (longtext)\n" +
 10310  			"                 │   │   └─ n.name LIKE '%An%'\n" +
 10311  			"                 │   └─ TableAlias(n)\n" +
 10312  			"                 │       └─ ProcessTable\n" +
 10313  			"                 │           └─ Table\n" +
 10314  			"                 │               ├─ name: name\n" +
 10315  			"                 │               └─ columns: [id name gender]\n" +
 10316  			"                 └─ InnerJoin\n" +
 10317  			"                     ├─ AND\n" +
 10318  			"                     │   ├─ Eq\n" +
 10319  			"                     │   │   ├─ mc.movie_id:13!null\n" +
 10320  			"                     │   │   └─ mi.movie_id:8!null\n" +
 10321  			"                     │   └─ Eq\n" +
 10322  			"                     │       ├─ mi.movie_id:8!null\n" +
 10323  			"                     │       └─ ci.movie_id:16!null\n" +
 10324  			"                     ├─ InnerJoin\n" +
 10325  			"                     │   ├─ Eq\n" +
 10326  			"                     │   │   ├─ it.id:11!null\n" +
 10327  			"                     │   │   └─ mi.info_type_id:9!null\n" +
 10328  			"                     │   ├─ Filter\n" +
 10329  			"                     │   │   ├─ AND\n" +
 10330  			"                     │   │   │   ├─ NOT\n" +
 10331  			"                     │   │   │   │   └─ mi.info:2!null IS NULL\n" +
 10332  			"                     │   │   │   └─ Or\n" +
 10333  			"                     │   │   │       ├─ mi.info LIKE 'Japan:%200%'\n" +
 10334  			"                     │   │   │       └─ mi.info LIKE 'USA:%200%'\n" +
 10335  			"                     │   │   └─ TableAlias(mi)\n" +
 10336  			"                     │   │       └─ ProcessTable\n" +
 10337  			"                     │   │           └─ Table\n" +
 10338  			"                     │   │               ├─ name: movie_info\n" +
 10339  			"                     │   │               └─ columns: [movie_id info_type_id info]\n" +
 10340  			"                     │   └─ Filter\n" +
 10341  			"                     │       ├─ Eq\n" +
 10342  			"                     │       │   ├─ it.info:1!null\n" +
 10343  			"                     │       │   └─ release dates (longtext)\n" +
 10344  			"                     │       └─ TableAlias(it)\n" +
 10345  			"                     │           └─ ProcessTable\n" +
 10346  			"                     │               └─ Table\n" +
 10347  			"                     │                   ├─ name: info_type\n" +
 10348  			"                     │                   └─ columns: [id info]\n" +
 10349  			"                     └─ InnerJoin\n" +
 10350  			"                         ├─ Eq\n" +
 10351  			"                         │   ├─ cn.id:22!null\n" +
 10352  			"                         │   └─ mc.company_id:14!null\n" +
 10353  			"                         ├─ InnerJoin\n" +
 10354  			"                         │   ├─ Eq\n" +
 10355  			"                         │   │   ├─ mc.movie_id:13!null\n" +
 10356  			"                         │   │   └─ ci.movie_id:16!null\n" +
 10357  			"                         │   ├─ TableAlias(mc)\n" +
 10358  			"                         │   │   └─ ProcessTable\n" +
 10359  			"                         │   │       └─ Table\n" +
 10360  			"                         │   │           ├─ name: movie_companies\n" +
 10361  			"                         │   │           └─ columns: [movie_id company_id]\n" +
 10362  			"                         │   └─ LookupJoin\n" +
 10363  			"                         │       ├─ InnerJoin\n" +
 10364  			"                         │       │   ├─ Eq\n" +
 10365  			"                         │       │   │   ├─ chn.id:20!null\n" +
 10366  			"                         │       │   │   └─ ci.person_role_id:17\n" +
 10367  			"                         │       │   ├─ Filter\n" +
 10368  			"                         │       │   │   ├─ HashIn\n" +
 10369  			"                         │       │   │   │   ├─ ci.note:3\n" +
 10370  			"                         │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 10371  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10372  			"                         │       │   │       └─ ProcessTable\n" +
 10373  			"                         │       │   │           └─ Table\n" +
 10374  			"                         │       │   │               ├─ name: cast_info\n" +
 10375  			"                         │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10376  			"                         │       │   └─ TableAlias(chn)\n" +
 10377  			"                         │       │       └─ ProcessTable\n" +
 10378  			"                         │       │           └─ Table\n" +
 10379  			"                         │       │               ├─ name: char_name\n" +
 10380  			"                         │       │               └─ columns: [id]\n" +
 10381  			"                         │       └─ TableAlias(an)\n" +
 10382  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10383  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10384  			"                         │               ├─ keys: [ci.person_id:15!null]\n" +
 10385  			"                         │               ├─ colSet: (1-8)\n" +
 10386  			"                         │               ├─ tableId: 1\n" +
 10387  			"                         │               └─ Table\n" +
 10388  			"                         │                   ├─ name: aka_name\n" +
 10389  			"                         │                   └─ columns: [person_id]\n" +
 10390  			"                         └─ Filter\n" +
 10391  			"                             ├─ Eq\n" +
 10392  			"                             │   ├─ cn.country_code:1\n" +
 10393  			"                             │   └─ [us] (longtext)\n" +
 10394  			"                             └─ TableAlias(cn)\n" +
 10395  			"                                 └─ ProcessTable\n" +
 10396  			"                                     └─ Table\n" +
 10397  			"                                         ├─ name: company_name\n" +
 10398  			"                                         └─ columns: [id country_code]\n" +
 10399  			"",
 10400  		ExpectedEstimates: "Project\n" +
 10401  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as jap_engl_voiced_movie]\n" +
 10402  			" └─ GroupBy\n" +
 10403  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 10404  			"     ├─ Grouping()\n" +
 10405  			"     └─ InnerJoin\n" +
 10406  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
 10407  			"         ├─ Filter\n" +
 10408  			"         │   ├─ (t.production_year > 2000)\n" +
 10409  			"         │   └─ TableAlias(t)\n" +
 10410  			"         │       └─ Table\n" +
 10411  			"         │           ├─ name: title\n" +
 10412  			"         │           └─ columns: [id title production_year]\n" +
 10413  			"         └─ InnerJoin\n" +
 10414  			"             ├─ (rt.id = ci.role_id)\n" +
 10415  			"             ├─ Filter\n" +
 10416  			"             │   ├─ (rt.role = 'actress')\n" +
 10417  			"             │   └─ TableAlias(rt)\n" +
 10418  			"             │       └─ Table\n" +
 10419  			"             │           ├─ name: role_type\n" +
 10420  			"             │           └─ columns: [id role]\n" +
 10421  			"             └─ InnerJoin\n" +
 10422  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 10423  			"                 ├─ Filter\n" +
 10424  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 10425  			"                 │   └─ TableAlias(n)\n" +
 10426  			"                 │       └─ Table\n" +
 10427  			"                 │           ├─ name: name\n" +
 10428  			"                 │           └─ columns: [id name gender]\n" +
 10429  			"                 └─ InnerJoin\n" +
 10430  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 10431  			"                     ├─ InnerJoin\n" +
 10432  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
 10433  			"                     │   ├─ Filter\n" +
 10434  			"                     │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
 10435  			"                     │   │   └─ TableAlias(mi)\n" +
 10436  			"                     │   │       └─ Table\n" +
 10437  			"                     │   │           ├─ name: movie_info\n" +
 10438  			"                     │   │           └─ columns: [movie_id info_type_id info]\n" +
 10439  			"                     │   └─ Filter\n" +
 10440  			"                     │       ├─ (it.info = 'release dates')\n" +
 10441  			"                     │       └─ TableAlias(it)\n" +
 10442  			"                     │           └─ Table\n" +
 10443  			"                     │               ├─ name: info_type\n" +
 10444  			"                     │               └─ columns: [id info]\n" +
 10445  			"                     └─ InnerJoin\n" +
 10446  			"                         ├─ (cn.id = mc.company_id)\n" +
 10447  			"                         ├─ InnerJoin\n" +
 10448  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
 10449  			"                         │   ├─ TableAlias(mc)\n" +
 10450  			"                         │   │   └─ Table\n" +
 10451  			"                         │   │       ├─ name: movie_companies\n" +
 10452  			"                         │   │       └─ columns: [movie_id company_id]\n" +
 10453  			"                         │   └─ LookupJoin\n" +
 10454  			"                         │       ├─ InnerJoin\n" +
 10455  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
 10456  			"                         │       │   ├─ Filter\n" +
 10457  			"                         │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 10458  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10459  			"                         │       │   │       └─ Table\n" +
 10460  			"                         │       │   │           ├─ name: cast_info\n" +
 10461  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10462  			"                         │       │   └─ TableAlias(chn)\n" +
 10463  			"                         │       │       └─ Table\n" +
 10464  			"                         │       │           ├─ name: char_name\n" +
 10465  			"                         │       │           └─ columns: [id]\n" +
 10466  			"                         │       └─ TableAlias(an)\n" +
 10467  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10468  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10469  			"                         │               ├─ columns: [person_id]\n" +
 10470  			"                         │               └─ keys: ci.person_id\n" +
 10471  			"                         └─ Filter\n" +
 10472  			"                             ├─ (cn.country_code = '[us]')\n" +
 10473  			"                             └─ TableAlias(cn)\n" +
 10474  			"                                 └─ Table\n" +
 10475  			"                                     ├─ name: company_name\n" +
 10476  			"                                     └─ columns: [id country_code]\n" +
 10477  			"",
 10478  		ExpectedAnalysis: "Project\n" +
 10479  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as jap_engl_voiced_movie]\n" +
 10480  			" └─ GroupBy\n" +
 10481  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 10482  			"     ├─ Grouping()\n" +
 10483  			"     └─ InnerJoin\n" +
 10484  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
 10485  			"         ├─ Filter\n" +
 10486  			"         │   ├─ (t.production_year > 2000)\n" +
 10487  			"         │   └─ TableAlias(t)\n" +
 10488  			"         │       └─ Table\n" +
 10489  			"         │           ├─ name: title\n" +
 10490  			"         │           └─ columns: [id title production_year]\n" +
 10491  			"         └─ InnerJoin\n" +
 10492  			"             ├─ (rt.id = ci.role_id)\n" +
 10493  			"             ├─ Filter\n" +
 10494  			"             │   ├─ (rt.role = 'actress')\n" +
 10495  			"             │   └─ TableAlias(rt)\n" +
 10496  			"             │       └─ Table\n" +
 10497  			"             │           ├─ name: role_type\n" +
 10498  			"             │           └─ columns: [id role]\n" +
 10499  			"             └─ InnerJoin\n" +
 10500  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 10501  			"                 ├─ Filter\n" +
 10502  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 10503  			"                 │   └─ TableAlias(n)\n" +
 10504  			"                 │       └─ Table\n" +
 10505  			"                 │           ├─ name: name\n" +
 10506  			"                 │           └─ columns: [id name gender]\n" +
 10507  			"                 └─ InnerJoin\n" +
 10508  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 10509  			"                     ├─ InnerJoin\n" +
 10510  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
 10511  			"                     │   ├─ Filter\n" +
 10512  			"                     │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
 10513  			"                     │   │   └─ TableAlias(mi)\n" +
 10514  			"                     │   │       └─ Table\n" +
 10515  			"                     │   │           ├─ name: movie_info\n" +
 10516  			"                     │   │           └─ columns: [movie_id info_type_id info]\n" +
 10517  			"                     │   └─ Filter\n" +
 10518  			"                     │       ├─ (it.info = 'release dates')\n" +
 10519  			"                     │       └─ TableAlias(it)\n" +
 10520  			"                     │           └─ Table\n" +
 10521  			"                     │               ├─ name: info_type\n" +
 10522  			"                     │               └─ columns: [id info]\n" +
 10523  			"                     └─ InnerJoin\n" +
 10524  			"                         ├─ (cn.id = mc.company_id)\n" +
 10525  			"                         ├─ InnerJoin\n" +
 10526  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
 10527  			"                         │   ├─ TableAlias(mc)\n" +
 10528  			"                         │   │   └─ Table\n" +
 10529  			"                         │   │       ├─ name: movie_companies\n" +
 10530  			"                         │   │       └─ columns: [movie_id company_id]\n" +
 10531  			"                         │   └─ LookupJoin\n" +
 10532  			"                         │       ├─ InnerJoin\n" +
 10533  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
 10534  			"                         │       │   ├─ Filter\n" +
 10535  			"                         │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 10536  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10537  			"                         │       │   │       └─ Table\n" +
 10538  			"                         │       │   │           ├─ name: cast_info\n" +
 10539  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10540  			"                         │       │   └─ TableAlias(chn)\n" +
 10541  			"                         │       │       └─ Table\n" +
 10542  			"                         │       │           ├─ name: char_name\n" +
 10543  			"                         │       │           └─ columns: [id]\n" +
 10544  			"                         │       └─ TableAlias(an)\n" +
 10545  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10546  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10547  			"                         │               ├─ columns: [person_id]\n" +
 10548  			"                         │               └─ keys: ci.person_id\n" +
 10549  			"                         └─ Filter\n" +
 10550  			"                             ├─ (cn.country_code = '[us]')\n" +
 10551  			"                             └─ TableAlias(cn)\n" +
 10552  			"                                 └─ Table\n" +
 10553  			"                                     ├─ name: company_name\n" +
 10554  			"                                     └─ columns: [id country_code]\n" +
 10555  			"",
 10556  	},
 10557  	{
 10558  		Query: `
 10559  SELECT MIN(n.name) AS voicing_actress,
 10560         MIN(t.title) AS jap_engl_voiced_movie
 10561  FROM aka_name AS an,
 10562       char_name AS chn,
 10563       cast_info AS ci,
 10564       company_name AS cn,
 10565       info_type AS it,
 10566       movie_companies AS mc,
 10567       movie_info AS mi,
 10568       name AS n,
 10569       role_type AS rt,
 10570       title AS t
 10571  WHERE ci.note IN ('(voice)',
 10572                    '(voice: Japanese version)',
 10573                    '(voice) (uncredited)',
 10574                    '(voice: English version)')
 10575    AND cn.country_code ='[us]'
 10576    AND it.info = 'release dates'
 10577    AND n.gender ='f'
 10578    AND rt.role ='actress'
 10579    AND t.production_year > 2000
 10580    AND t.id = mi.movie_id
 10581    AND t.id = mc.movie_id
 10582    AND t.id = ci.movie_id
 10583    AND mc.movie_id = ci.movie_id
 10584    AND mc.movie_id = mi.movie_id
 10585    AND mi.movie_id = ci.movie_id
 10586    AND cn.id = mc.company_id
 10587    AND it.id = mi.info_type_id
 10588    AND n.id = ci.person_id
 10589    AND rt.id = ci.role_id
 10590    AND n.id = an.person_id
 10591    AND ci.person_id = an.person_id
 10592    AND chn.id = ci.person_role_id;
 10593  
 10594  `,
 10595  		ExpectedPlan: "Project\n" +
 10596  			" ├─ columns: [min(n.name):0!null as voicing_actress, min(t.title):1!null as jap_engl_voiced_movie]\n" +
 10597  			" └─ GroupBy\n" +
 10598  			"     ├─ select: MIN(n.name:6!null), MIN(t.title:1!null)\n" +
 10599  			"     ├─ group: \n" +
 10600  			"     └─ InnerJoin\n" +
 10601  			"         ├─ AND\n" +
 10602  			"         │   ├─ AND\n" +
 10603  			"         │   │   ├─ Eq\n" +
 10604  			"         │   │   │   ├─ t.id:0!null\n" +
 10605  			"         │   │   │   └─ mi.movie_id:8!null\n" +
 10606  			"         │   │   └─ Eq\n" +
 10607  			"         │   │       ├─ t.id:0!null\n" +
 10608  			"         │   │       └─ mc.movie_id:12!null\n" +
 10609  			"         │   └─ Eq\n" +
 10610  			"         │       ├─ t.id:0!null\n" +
 10611  			"         │       └─ ci.movie_id:15!null\n" +
 10612  			"         ├─ Filter\n" +
 10613  			"         │   ├─ GreaterThan\n" +
 10614  			"         │   │   ├─ t.production_year:2\n" +
 10615  			"         │   │   └─ 2000 (smallint)\n" +
 10616  			"         │   └─ TableAlias(t)\n" +
 10617  			"         │       └─ ProcessTable\n" +
 10618  			"         │           └─ Table\n" +
 10619  			"         │               ├─ name: title\n" +
 10620  			"         │               └─ columns: [id title production_year]\n" +
 10621  			"         └─ InnerJoin\n" +
 10622  			"             ├─ Eq\n" +
 10623  			"             │   ├─ rt.id:3!null\n" +
 10624  			"             │   └─ ci.role_id:18!null\n" +
 10625  			"             ├─ Filter\n" +
 10626  			"             │   ├─ Eq\n" +
 10627  			"             │   │   ├─ rt.role:1!null\n" +
 10628  			"             │   │   └─ actress (longtext)\n" +
 10629  			"             │   └─ TableAlias(rt)\n" +
 10630  			"             │       └─ ProcessTable\n" +
 10631  			"             │           └─ Table\n" +
 10632  			"             │               ├─ name: role_type\n" +
 10633  			"             │               └─ columns: [id role]\n" +
 10634  			"             └─ InnerJoin\n" +
 10635  			"                 ├─ AND\n" +
 10636  			"                 │   ├─ Eq\n" +
 10637  			"                 │   │   ├─ n.id:5!null\n" +
 10638  			"                 │   │   └─ ci.person_id:14!null\n" +
 10639  			"                 │   └─ Eq\n" +
 10640  			"                 │       ├─ n.id:5!null\n" +
 10641  			"                 │       └─ an.person_id:20!null\n" +
 10642  			"                 ├─ Filter\n" +
 10643  			"                 │   ├─ Eq\n" +
 10644  			"                 │   │   ├─ n.gender:2\n" +
 10645  			"                 │   │   └─ f (longtext)\n" +
 10646  			"                 │   └─ TableAlias(n)\n" +
 10647  			"                 │       └─ ProcessTable\n" +
 10648  			"                 │           └─ Table\n" +
 10649  			"                 │               ├─ name: name\n" +
 10650  			"                 │               └─ columns: [id name gender]\n" +
 10651  			"                 └─ InnerJoin\n" +
 10652  			"                     ├─ AND\n" +
 10653  			"                     │   ├─ Eq\n" +
 10654  			"                     │   │   ├─ mc.movie_id:12!null\n" +
 10655  			"                     │   │   └─ mi.movie_id:8!null\n" +
 10656  			"                     │   └─ Eq\n" +
 10657  			"                     │       ├─ mi.movie_id:8!null\n" +
 10658  			"                     │       └─ ci.movie_id:15!null\n" +
 10659  			"                     ├─ InnerJoin\n" +
 10660  			"                     │   ├─ Eq\n" +
 10661  			"                     │   │   ├─ it.id:10!null\n" +
 10662  			"                     │   │   └─ mi.info_type_id:9!null\n" +
 10663  			"                     │   ├─ TableAlias(mi)\n" +
 10664  			"                     │   │   └─ ProcessTable\n" +
 10665  			"                     │   │       └─ Table\n" +
 10666  			"                     │   │           ├─ name: movie_info\n" +
 10667  			"                     │   │           └─ columns: [movie_id info_type_id]\n" +
 10668  			"                     │   └─ Filter\n" +
 10669  			"                     │       ├─ Eq\n" +
 10670  			"                     │       │   ├─ it.info:1!null\n" +
 10671  			"                     │       │   └─ release dates (longtext)\n" +
 10672  			"                     │       └─ TableAlias(it)\n" +
 10673  			"                     │           └─ ProcessTable\n" +
 10674  			"                     │               └─ Table\n" +
 10675  			"                     │                   ├─ name: info_type\n" +
 10676  			"                     │                   └─ columns: [id info]\n" +
 10677  			"                     └─ InnerJoin\n" +
 10678  			"                         ├─ Eq\n" +
 10679  			"                         │   ├─ cn.id:21!null\n" +
 10680  			"                         │   └─ mc.company_id:13!null\n" +
 10681  			"                         ├─ InnerJoin\n" +
 10682  			"                         │   ├─ Eq\n" +
 10683  			"                         │   │   ├─ mc.movie_id:12!null\n" +
 10684  			"                         │   │   └─ ci.movie_id:15!null\n" +
 10685  			"                         │   ├─ TableAlias(mc)\n" +
 10686  			"                         │   │   └─ ProcessTable\n" +
 10687  			"                         │   │       └─ Table\n" +
 10688  			"                         │   │           ├─ name: movie_companies\n" +
 10689  			"                         │   │           └─ columns: [movie_id company_id]\n" +
 10690  			"                         │   └─ LookupJoin\n" +
 10691  			"                         │       ├─ InnerJoin\n" +
 10692  			"                         │       │   ├─ Eq\n" +
 10693  			"                         │       │   │   ├─ chn.id:19!null\n" +
 10694  			"                         │       │   │   └─ ci.person_role_id:16\n" +
 10695  			"                         │       │   ├─ Filter\n" +
 10696  			"                         │       │   │   ├─ HashIn\n" +
 10697  			"                         │       │   │   │   ├─ ci.note:3\n" +
 10698  			"                         │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 10699  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10700  			"                         │       │   │       └─ ProcessTable\n" +
 10701  			"                         │       │   │           └─ Table\n" +
 10702  			"                         │       │   │               ├─ name: cast_info\n" +
 10703  			"                         │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10704  			"                         │       │   └─ TableAlias(chn)\n" +
 10705  			"                         │       │       └─ ProcessTable\n" +
 10706  			"                         │       │           └─ Table\n" +
 10707  			"                         │       │               ├─ name: char_name\n" +
 10708  			"                         │       │               └─ columns: [id]\n" +
 10709  			"                         │       └─ TableAlias(an)\n" +
 10710  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10711  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10712  			"                         │               ├─ keys: [ci.person_id:14!null]\n" +
 10713  			"                         │               ├─ colSet: (1-8)\n" +
 10714  			"                         │               ├─ tableId: 1\n" +
 10715  			"                         │               └─ Table\n" +
 10716  			"                         │                   ├─ name: aka_name\n" +
 10717  			"                         │                   └─ columns: [person_id]\n" +
 10718  			"                         └─ Filter\n" +
 10719  			"                             ├─ Eq\n" +
 10720  			"                             │   ├─ cn.country_code:1\n" +
 10721  			"                             │   └─ [us] (longtext)\n" +
 10722  			"                             └─ TableAlias(cn)\n" +
 10723  			"                                 └─ ProcessTable\n" +
 10724  			"                                     └─ Table\n" +
 10725  			"                                         ├─ name: company_name\n" +
 10726  			"                                         └─ columns: [id country_code]\n" +
 10727  			"",
 10728  		ExpectedEstimates: "Project\n" +
 10729  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as jap_engl_voiced_movie]\n" +
 10730  			" └─ GroupBy\n" +
 10731  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 10732  			"     ├─ Grouping()\n" +
 10733  			"     └─ InnerJoin\n" +
 10734  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
 10735  			"         ├─ Filter\n" +
 10736  			"         │   ├─ (t.production_year > 2000)\n" +
 10737  			"         │   └─ TableAlias(t)\n" +
 10738  			"         │       └─ Table\n" +
 10739  			"         │           ├─ name: title\n" +
 10740  			"         │           └─ columns: [id title production_year]\n" +
 10741  			"         └─ InnerJoin\n" +
 10742  			"             ├─ (rt.id = ci.role_id)\n" +
 10743  			"             ├─ Filter\n" +
 10744  			"             │   ├─ (rt.role = 'actress')\n" +
 10745  			"             │   └─ TableAlias(rt)\n" +
 10746  			"             │       └─ Table\n" +
 10747  			"             │           ├─ name: role_type\n" +
 10748  			"             │           └─ columns: [id role]\n" +
 10749  			"             └─ InnerJoin\n" +
 10750  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 10751  			"                 ├─ Filter\n" +
 10752  			"                 │   ├─ (n.gender = 'f')\n" +
 10753  			"                 │   └─ TableAlias(n)\n" +
 10754  			"                 │       └─ Table\n" +
 10755  			"                 │           ├─ name: name\n" +
 10756  			"                 │           └─ columns: [id name gender]\n" +
 10757  			"                 └─ InnerJoin\n" +
 10758  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 10759  			"                     ├─ InnerJoin\n" +
 10760  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
 10761  			"                     │   ├─ TableAlias(mi)\n" +
 10762  			"                     │   │   └─ Table\n" +
 10763  			"                     │   │       ├─ name: movie_info\n" +
 10764  			"                     │   │       └─ columns: [movie_id info_type_id]\n" +
 10765  			"                     │   └─ Filter\n" +
 10766  			"                     │       ├─ (it.info = 'release dates')\n" +
 10767  			"                     │       └─ TableAlias(it)\n" +
 10768  			"                     │           └─ Table\n" +
 10769  			"                     │               ├─ name: info_type\n" +
 10770  			"                     │               └─ columns: [id info]\n" +
 10771  			"                     └─ InnerJoin\n" +
 10772  			"                         ├─ (cn.id = mc.company_id)\n" +
 10773  			"                         ├─ InnerJoin\n" +
 10774  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
 10775  			"                         │   ├─ TableAlias(mc)\n" +
 10776  			"                         │   │   └─ Table\n" +
 10777  			"                         │   │       ├─ name: movie_companies\n" +
 10778  			"                         │   │       └─ columns: [movie_id company_id]\n" +
 10779  			"                         │   └─ LookupJoin\n" +
 10780  			"                         │       ├─ InnerJoin\n" +
 10781  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
 10782  			"                         │       │   ├─ Filter\n" +
 10783  			"                         │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 10784  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10785  			"                         │       │   │       └─ Table\n" +
 10786  			"                         │       │   │           ├─ name: cast_info\n" +
 10787  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10788  			"                         │       │   └─ TableAlias(chn)\n" +
 10789  			"                         │       │       └─ Table\n" +
 10790  			"                         │       │           ├─ name: char_name\n" +
 10791  			"                         │       │           └─ columns: [id]\n" +
 10792  			"                         │       └─ TableAlias(an)\n" +
 10793  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10794  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10795  			"                         │               ├─ columns: [person_id]\n" +
 10796  			"                         │               └─ keys: ci.person_id\n" +
 10797  			"                         └─ Filter\n" +
 10798  			"                             ├─ (cn.country_code = '[us]')\n" +
 10799  			"                             └─ TableAlias(cn)\n" +
 10800  			"                                 └─ Table\n" +
 10801  			"                                     ├─ name: company_name\n" +
 10802  			"                                     └─ columns: [id country_code]\n" +
 10803  			"",
 10804  		ExpectedAnalysis: "Project\n" +
 10805  			" ├─ columns: [min(n.name) as voicing_actress, min(t.title) as jap_engl_voiced_movie]\n" +
 10806  			" └─ GroupBy\n" +
 10807  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 10808  			"     ├─ Grouping()\n" +
 10809  			"     └─ InnerJoin\n" +
 10810  			"         ├─ (((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id))\n" +
 10811  			"         ├─ Filter\n" +
 10812  			"         │   ├─ (t.production_year > 2000)\n" +
 10813  			"         │   └─ TableAlias(t)\n" +
 10814  			"         │       └─ Table\n" +
 10815  			"         │           ├─ name: title\n" +
 10816  			"         │           └─ columns: [id title production_year]\n" +
 10817  			"         └─ InnerJoin\n" +
 10818  			"             ├─ (rt.id = ci.role_id)\n" +
 10819  			"             ├─ Filter\n" +
 10820  			"             │   ├─ (rt.role = 'actress')\n" +
 10821  			"             │   └─ TableAlias(rt)\n" +
 10822  			"             │       └─ Table\n" +
 10823  			"             │           ├─ name: role_type\n" +
 10824  			"             │           └─ columns: [id role]\n" +
 10825  			"             └─ InnerJoin\n" +
 10826  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 10827  			"                 ├─ Filter\n" +
 10828  			"                 │   ├─ (n.gender = 'f')\n" +
 10829  			"                 │   └─ TableAlias(n)\n" +
 10830  			"                 │       └─ Table\n" +
 10831  			"                 │           ├─ name: name\n" +
 10832  			"                 │           └─ columns: [id name gender]\n" +
 10833  			"                 └─ InnerJoin\n" +
 10834  			"                     ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 10835  			"                     ├─ InnerJoin\n" +
 10836  			"                     │   ├─ (it.id = mi.info_type_id)\n" +
 10837  			"                     │   ├─ TableAlias(mi)\n" +
 10838  			"                     │   │   └─ Table\n" +
 10839  			"                     │   │       ├─ name: movie_info\n" +
 10840  			"                     │   │       └─ columns: [movie_id info_type_id]\n" +
 10841  			"                     │   └─ Filter\n" +
 10842  			"                     │       ├─ (it.info = 'release dates')\n" +
 10843  			"                     │       └─ TableAlias(it)\n" +
 10844  			"                     │           └─ Table\n" +
 10845  			"                     │               ├─ name: info_type\n" +
 10846  			"                     │               └─ columns: [id info]\n" +
 10847  			"                     └─ InnerJoin\n" +
 10848  			"                         ├─ (cn.id = mc.company_id)\n" +
 10849  			"                         ├─ InnerJoin\n" +
 10850  			"                         │   ├─ (mc.movie_id = ci.movie_id)\n" +
 10851  			"                         │   ├─ TableAlias(mc)\n" +
 10852  			"                         │   │   └─ Table\n" +
 10853  			"                         │   │       ├─ name: movie_companies\n" +
 10854  			"                         │   │       └─ columns: [movie_id company_id]\n" +
 10855  			"                         │   └─ LookupJoin\n" +
 10856  			"                         │       ├─ InnerJoin\n" +
 10857  			"                         │       │   ├─ (chn.id = ci.person_role_id)\n" +
 10858  			"                         │       │   ├─ Filter\n" +
 10859  			"                         │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 10860  			"                         │       │   │   └─ TableAlias(ci)\n" +
 10861  			"                         │       │   │       └─ Table\n" +
 10862  			"                         │       │   │           ├─ name: cast_info\n" +
 10863  			"                         │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 10864  			"                         │       │   └─ TableAlias(chn)\n" +
 10865  			"                         │       │       └─ Table\n" +
 10866  			"                         │       │           ├─ name: char_name\n" +
 10867  			"                         │       │           └─ columns: [id]\n" +
 10868  			"                         │       └─ TableAlias(an)\n" +
 10869  			"                         │           └─ IndexedTableAccess(aka_name)\n" +
 10870  			"                         │               ├─ index: [aka_name.person_id]\n" +
 10871  			"                         │               ├─ columns: [person_id]\n" +
 10872  			"                         │               └─ keys: ci.person_id\n" +
 10873  			"                         └─ Filter\n" +
 10874  			"                             ├─ (cn.country_code = '[us]')\n" +
 10875  			"                             └─ TableAlias(cn)\n" +
 10876  			"                                 └─ Table\n" +
 10877  			"                                     ├─ name: company_name\n" +
 10878  			"                                     └─ columns: [id country_code]\n" +
 10879  			"",
 10880  	},
 10881  	{
 10882  		Query: `
 10883  SELECT MIN(mc.note) AS production_note,
 10884         MIN(t.title) AS movie_title,
 10885         MIN(t.production_year) AS movie_year
 10886  FROM company_type AS ct,
 10887       info_type AS it,
 10888       movie_companies AS mc,
 10889       movie_info_idx AS mi_idx,
 10890       title AS t
 10891  WHERE ct.kind = 'production companies'
 10892    AND it.info = 'top 250 rank'
 10893    AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'
 10894    AND (mc.note LIKE '%(co-production)%'
 10895         OR mc.note LIKE '%(presents)%')
 10896    AND ct.id = mc.company_type_id
 10897    AND t.id = mc.movie_id
 10898    AND t.id = mi_idx.movie_id
 10899    AND mc.movie_id = mi_idx.movie_id
 10900    AND it.id = mi_idx.info_type_id;
 10901  
 10902  `,
 10903  		ExpectedPlan: "Project\n" +
 10904  			" ├─ columns: [min(mc.note):0!null as production_note, min(t.title):2!null as movie_title, min(t.production_year):1!null as movie_year]\n" +
 10905  			" └─ GroupBy\n" +
 10906  			"     ├─ select: MIN(mc.note:5), MIN(t.production_year:2), MIN(t.title:1!null)\n" +
 10907  			"     ├─ group: \n" +
 10908  			"     └─ InnerJoin\n" +
 10909  			"         ├─ AND\n" +
 10910  			"         │   ├─ AND\n" +
 10911  			"         │   │   ├─ Eq\n" +
 10912  			"         │   │   │   ├─ ct.id:10!null\n" +
 10913  			"         │   │   │   └─ mc.company_type_id:4!null\n" +
 10914  			"         │   │   └─ Eq\n" +
 10915  			"         │   │       ├─ mc.movie_id:3!null\n" +
 10916  			"         │   │       └─ mi_idx.movie_id:6!null\n" +
 10917  			"         │   └─ Eq\n" +
 10918  			"         │       ├─ t.id:0!null\n" +
 10919  			"         │       └─ mi_idx.movie_id:6!null\n" +
 10920  			"         ├─ InnerJoin\n" +
 10921  			"         │   ├─ Eq\n" +
 10922  			"         │   │   ├─ t.id:0!null\n" +
 10923  			"         │   │   └─ mc.movie_id:3!null\n" +
 10924  			"         │   ├─ TableAlias(t)\n" +
 10925  			"         │   │   └─ ProcessTable\n" +
 10926  			"         │   │       └─ Table\n" +
 10927  			"         │   │           ├─ name: title\n" +
 10928  			"         │   │           └─ columns: [id title production_year]\n" +
 10929  			"         │   └─ Filter\n" +
 10930  			"         │       ├─ AND\n" +
 10931  			"         │       │   ├─ NOT\n" +
 10932  			"         │       │   │   └─ mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'\n" +
 10933  			"         │       │   └─ Or\n" +
 10934  			"         │       │       ├─ mc.note LIKE '%(co-production)%'\n" +
 10935  			"         │       │       └─ mc.note LIKE '%(presents)%'\n" +
 10936  			"         │       └─ TableAlias(mc)\n" +
 10937  			"         │           └─ ProcessTable\n" +
 10938  			"         │               └─ Table\n" +
 10939  			"         │                   ├─ name: movie_companies\n" +
 10940  			"         │                   └─ columns: [movie_id company_type_id note]\n" +
 10941  			"         └─ CrossJoin\n" +
 10942  			"             ├─ InnerJoin\n" +
 10943  			"             │   ├─ Eq\n" +
 10944  			"             │   │   ├─ it.id:8!null\n" +
 10945  			"             │   │   └─ mi_idx.info_type_id:7!null\n" +
 10946  			"             │   ├─ TableAlias(mi_idx)\n" +
 10947  			"             │   │   └─ ProcessTable\n" +
 10948  			"             │   │       └─ Table\n" +
 10949  			"             │   │           ├─ name: movie_info_idx\n" +
 10950  			"             │   │           └─ columns: [movie_id info_type_id]\n" +
 10951  			"             │   └─ Filter\n" +
 10952  			"             │       ├─ Eq\n" +
 10953  			"             │       │   ├─ it.info:1!null\n" +
 10954  			"             │       │   └─ top 250 rank (longtext)\n" +
 10955  			"             │       └─ TableAlias(it)\n" +
 10956  			"             │           └─ ProcessTable\n" +
 10957  			"             │               └─ Table\n" +
 10958  			"             │                   ├─ name: info_type\n" +
 10959  			"             │                   └─ columns: [id info]\n" +
 10960  			"             └─ Filter\n" +
 10961  			"                 ├─ Eq\n" +
 10962  			"                 │   ├─ ct.kind:1!null\n" +
 10963  			"                 │   └─ production companies (longtext)\n" +
 10964  			"                 └─ TableAlias(ct)\n" +
 10965  			"                     └─ ProcessTable\n" +
 10966  			"                         └─ Table\n" +
 10967  			"                             ├─ name: company_type\n" +
 10968  			"                             └─ columns: [id kind]\n" +
 10969  			"",
 10970  		ExpectedEstimates: "Project\n" +
 10971  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 10972  			" └─ GroupBy\n" +
 10973  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 10974  			"     ├─ Grouping()\n" +
 10975  			"     └─ InnerJoin\n" +
 10976  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 10977  			"         ├─ InnerJoin\n" +
 10978  			"         │   ├─ (t.id = mc.movie_id)\n" +
 10979  			"         │   ├─ TableAlias(t)\n" +
 10980  			"         │   │   └─ Table\n" +
 10981  			"         │   │       ├─ name: title\n" +
 10982  			"         │   │       └─ columns: [id title production_year]\n" +
 10983  			"         │   └─ Filter\n" +
 10984  			"         │       ├─ ((NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%')) AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%'))\n" +
 10985  			"         │       └─ TableAlias(mc)\n" +
 10986  			"         │           └─ Table\n" +
 10987  			"         │               ├─ name: movie_companies\n" +
 10988  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 10989  			"         └─ CrossJoin\n" +
 10990  			"             ├─ InnerJoin\n" +
 10991  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 10992  			"             │   ├─ TableAlias(mi_idx)\n" +
 10993  			"             │   │   └─ Table\n" +
 10994  			"             │   │       ├─ name: movie_info_idx\n" +
 10995  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 10996  			"             │   └─ Filter\n" +
 10997  			"             │       ├─ (it.info = 'top 250 rank')\n" +
 10998  			"             │       └─ TableAlias(it)\n" +
 10999  			"             │           └─ Table\n" +
 11000  			"             │               ├─ name: info_type\n" +
 11001  			"             │               └─ columns: [id info]\n" +
 11002  			"             └─ Filter\n" +
 11003  			"                 ├─ (ct.kind = 'production companies')\n" +
 11004  			"                 └─ TableAlias(ct)\n" +
 11005  			"                     └─ Table\n" +
 11006  			"                         ├─ name: company_type\n" +
 11007  			"                         └─ columns: [id kind]\n" +
 11008  			"",
 11009  		ExpectedAnalysis: "Project\n" +
 11010  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 11011  			" └─ GroupBy\n" +
 11012  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 11013  			"     ├─ Grouping()\n" +
 11014  			"     └─ InnerJoin\n" +
 11015  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 11016  			"         ├─ InnerJoin\n" +
 11017  			"         │   ├─ (t.id = mc.movie_id)\n" +
 11018  			"         │   ├─ TableAlias(t)\n" +
 11019  			"         │   │   └─ Table\n" +
 11020  			"         │   │       ├─ name: title\n" +
 11021  			"         │   │       └─ columns: [id title production_year]\n" +
 11022  			"         │   └─ Filter\n" +
 11023  			"         │       ├─ ((NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%')) AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%'))\n" +
 11024  			"         │       └─ TableAlias(mc)\n" +
 11025  			"         │           └─ Table\n" +
 11026  			"         │               ├─ name: movie_companies\n" +
 11027  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 11028  			"         └─ CrossJoin\n" +
 11029  			"             ├─ InnerJoin\n" +
 11030  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 11031  			"             │   ├─ TableAlias(mi_idx)\n" +
 11032  			"             │   │   └─ Table\n" +
 11033  			"             │   │       ├─ name: movie_info_idx\n" +
 11034  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 11035  			"             │   └─ Filter\n" +
 11036  			"             │       ├─ (it.info = 'top 250 rank')\n" +
 11037  			"             │       └─ TableAlias(it)\n" +
 11038  			"             │           └─ Table\n" +
 11039  			"             │               ├─ name: info_type\n" +
 11040  			"             │               └─ columns: [id info]\n" +
 11041  			"             └─ Filter\n" +
 11042  			"                 ├─ (ct.kind = 'production companies')\n" +
 11043  			"                 └─ TableAlias(ct)\n" +
 11044  			"                     └─ Table\n" +
 11045  			"                         ├─ name: company_type\n" +
 11046  			"                         └─ columns: [id kind]\n" +
 11047  			"",
 11048  	},
 11049  	{
 11050  		Query: `
 11051  SELECT MIN(mc.note) AS production_note,
 11052         MIN(t.title) AS movie_title,
 11053         MIN(t.production_year) AS movie_year
 11054  FROM company_type AS ct,
 11055       info_type AS it,
 11056       movie_companies AS mc,
 11057       movie_info_idx AS mi_idx,
 11058       title AS t
 11059  WHERE ct.kind = 'production companies'
 11060    AND it.info = 'bottom 10 rank'
 11061    AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'
 11062    AND t.production_year BETWEEN 2005 AND 2010
 11063    AND ct.id = mc.company_type_id
 11064    AND t.id = mc.movie_id
 11065    AND t.id = mi_idx.movie_id
 11066    AND mc.movie_id = mi_idx.movie_id
 11067    AND it.id = mi_idx.info_type_id;
 11068  
 11069  `,
 11070  		ExpectedPlan: "Project\n" +
 11071  			" ├─ columns: [min(mc.note):0!null as production_note, min(t.title):2!null as movie_title, min(t.production_year):1!null as movie_year]\n" +
 11072  			" └─ GroupBy\n" +
 11073  			"     ├─ select: MIN(mc.note:5), MIN(t.production_year:2), MIN(t.title:1!null)\n" +
 11074  			"     ├─ group: \n" +
 11075  			"     └─ InnerJoin\n" +
 11076  			"         ├─ AND\n" +
 11077  			"         │   ├─ AND\n" +
 11078  			"         │   │   ├─ Eq\n" +
 11079  			"         │   │   │   ├─ ct.id:10!null\n" +
 11080  			"         │   │   │   └─ mc.company_type_id:4!null\n" +
 11081  			"         │   │   └─ Eq\n" +
 11082  			"         │   │       ├─ mc.movie_id:3!null\n" +
 11083  			"         │   │       └─ mi_idx.movie_id:6!null\n" +
 11084  			"         │   └─ Eq\n" +
 11085  			"         │       ├─ t.id:0!null\n" +
 11086  			"         │       └─ mi_idx.movie_id:6!null\n" +
 11087  			"         ├─ InnerJoin\n" +
 11088  			"         │   ├─ Eq\n" +
 11089  			"         │   │   ├─ t.id:0!null\n" +
 11090  			"         │   │   └─ mc.movie_id:3!null\n" +
 11091  			"         │   ├─ Filter\n" +
 11092  			"         │   │   ├─ AND\n" +
 11093  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
 11094  			"         │   │   │   │   ├─ t.production_year:2\n" +
 11095  			"         │   │   │   │   └─ 2005 (smallint)\n" +
 11096  			"         │   │   │   └─ LessThanOrEqual\n" +
 11097  			"         │   │   │       ├─ t.production_year:2\n" +
 11098  			"         │   │   │       └─ 2010 (smallint)\n" +
 11099  			"         │   │   └─ TableAlias(t)\n" +
 11100  			"         │   │       └─ ProcessTable\n" +
 11101  			"         │   │           └─ Table\n" +
 11102  			"         │   │               ├─ name: title\n" +
 11103  			"         │   │               └─ columns: [id title production_year]\n" +
 11104  			"         │   └─ Filter\n" +
 11105  			"         │       ├─ NOT\n" +
 11106  			"         │       │   └─ mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'\n" +
 11107  			"         │       └─ TableAlias(mc)\n" +
 11108  			"         │           └─ ProcessTable\n" +
 11109  			"         │               └─ Table\n" +
 11110  			"         │                   ├─ name: movie_companies\n" +
 11111  			"         │                   └─ columns: [movie_id company_type_id note]\n" +
 11112  			"         └─ CrossJoin\n" +
 11113  			"             ├─ InnerJoin\n" +
 11114  			"             │   ├─ Eq\n" +
 11115  			"             │   │   ├─ it.id:8!null\n" +
 11116  			"             │   │   └─ mi_idx.info_type_id:7!null\n" +
 11117  			"             │   ├─ TableAlias(mi_idx)\n" +
 11118  			"             │   │   └─ ProcessTable\n" +
 11119  			"             │   │       └─ Table\n" +
 11120  			"             │   │           ├─ name: movie_info_idx\n" +
 11121  			"             │   │           └─ columns: [movie_id info_type_id]\n" +
 11122  			"             │   └─ Filter\n" +
 11123  			"             │       ├─ Eq\n" +
 11124  			"             │       │   ├─ it.info:1!null\n" +
 11125  			"             │       │   └─ bottom 10 rank (longtext)\n" +
 11126  			"             │       └─ TableAlias(it)\n" +
 11127  			"             │           └─ ProcessTable\n" +
 11128  			"             │               └─ Table\n" +
 11129  			"             │                   ├─ name: info_type\n" +
 11130  			"             │                   └─ columns: [id info]\n" +
 11131  			"             └─ Filter\n" +
 11132  			"                 ├─ Eq\n" +
 11133  			"                 │   ├─ ct.kind:1!null\n" +
 11134  			"                 │   └─ production companies (longtext)\n" +
 11135  			"                 └─ TableAlias(ct)\n" +
 11136  			"                     └─ ProcessTable\n" +
 11137  			"                         └─ Table\n" +
 11138  			"                             ├─ name: company_type\n" +
 11139  			"                             └─ columns: [id kind]\n" +
 11140  			"",
 11141  		ExpectedEstimates: "Project\n" +
 11142  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 11143  			" └─ GroupBy\n" +
 11144  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 11145  			"     ├─ Grouping()\n" +
 11146  			"     └─ InnerJoin\n" +
 11147  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 11148  			"         ├─ InnerJoin\n" +
 11149  			"         │   ├─ (t.id = mc.movie_id)\n" +
 11150  			"         │   ├─ Filter\n" +
 11151  			"         │   │   ├─ ((t.production_year >= 2005) AND (t.production_year <= 2010))\n" +
 11152  			"         │   │   └─ TableAlias(t)\n" +
 11153  			"         │   │       └─ Table\n" +
 11154  			"         │   │           ├─ name: title\n" +
 11155  			"         │   │           └─ columns: [id title production_year]\n" +
 11156  			"         │   └─ Filter\n" +
 11157  			"         │       ├─ (NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'))\n" +
 11158  			"         │       └─ TableAlias(mc)\n" +
 11159  			"         │           └─ Table\n" +
 11160  			"         │               ├─ name: movie_companies\n" +
 11161  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 11162  			"         └─ CrossJoin\n" +
 11163  			"             ├─ InnerJoin\n" +
 11164  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 11165  			"             │   ├─ TableAlias(mi_idx)\n" +
 11166  			"             │   │   └─ Table\n" +
 11167  			"             │   │       ├─ name: movie_info_idx\n" +
 11168  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 11169  			"             │   └─ Filter\n" +
 11170  			"             │       ├─ (it.info = 'bottom 10 rank')\n" +
 11171  			"             │       └─ TableAlias(it)\n" +
 11172  			"             │           └─ Table\n" +
 11173  			"             │               ├─ name: info_type\n" +
 11174  			"             │               └─ columns: [id info]\n" +
 11175  			"             └─ Filter\n" +
 11176  			"                 ├─ (ct.kind = 'production companies')\n" +
 11177  			"                 └─ TableAlias(ct)\n" +
 11178  			"                     └─ Table\n" +
 11179  			"                         ├─ name: company_type\n" +
 11180  			"                         └─ columns: [id kind]\n" +
 11181  			"",
 11182  		ExpectedAnalysis: "Project\n" +
 11183  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 11184  			" └─ GroupBy\n" +
 11185  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 11186  			"     ├─ Grouping()\n" +
 11187  			"     └─ InnerJoin\n" +
 11188  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 11189  			"         ├─ InnerJoin\n" +
 11190  			"         │   ├─ (t.id = mc.movie_id)\n" +
 11191  			"         │   ├─ Filter\n" +
 11192  			"         │   │   ├─ ((t.production_year >= 2005) AND (t.production_year <= 2010))\n" +
 11193  			"         │   │   └─ TableAlias(t)\n" +
 11194  			"         │   │       └─ Table\n" +
 11195  			"         │   │           ├─ name: title\n" +
 11196  			"         │   │           └─ columns: [id title production_year]\n" +
 11197  			"         │   └─ Filter\n" +
 11198  			"         │       ├─ (NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'))\n" +
 11199  			"         │       └─ TableAlias(mc)\n" +
 11200  			"         │           └─ Table\n" +
 11201  			"         │               ├─ name: movie_companies\n" +
 11202  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 11203  			"         └─ CrossJoin\n" +
 11204  			"             ├─ InnerJoin\n" +
 11205  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 11206  			"             │   ├─ TableAlias(mi_idx)\n" +
 11207  			"             │   │   └─ Table\n" +
 11208  			"             │   │       ├─ name: movie_info_idx\n" +
 11209  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 11210  			"             │   └─ Filter\n" +
 11211  			"             │       ├─ (it.info = 'bottom 10 rank')\n" +
 11212  			"             │       └─ TableAlias(it)\n" +
 11213  			"             │           └─ Table\n" +
 11214  			"             │               ├─ name: info_type\n" +
 11215  			"             │               └─ columns: [id info]\n" +
 11216  			"             └─ Filter\n" +
 11217  			"                 ├─ (ct.kind = 'production companies')\n" +
 11218  			"                 └─ TableAlias(ct)\n" +
 11219  			"                     └─ Table\n" +
 11220  			"                         ├─ name: company_type\n" +
 11221  			"                         └─ columns: [id kind]\n" +
 11222  			"",
 11223  	},
 11224  	{
 11225  		Query: `
 11226  SELECT MIN(mc.note) AS production_note,
 11227         MIN(t.title) AS movie_title,
 11228         MIN(t.production_year) AS movie_year
 11229  FROM company_type AS ct,
 11230       info_type AS it,
 11231       movie_companies AS mc,
 11232       movie_info_idx AS mi_idx,
 11233       title AS t
 11234  WHERE ct.kind = 'production companies'
 11235    AND it.info = 'top 250 rank'
 11236    AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'
 11237    AND (mc.note LIKE '%(co-production)%')
 11238    AND t.production_year >2010
 11239    AND ct.id = mc.company_type_id
 11240    AND t.id = mc.movie_id
 11241    AND t.id = mi_idx.movie_id
 11242    AND mc.movie_id = mi_idx.movie_id
 11243    AND it.id = mi_idx.info_type_id;
 11244  
 11245  `,
 11246  		ExpectedPlan: "Project\n" +
 11247  			" ├─ columns: [min(mc.note):0!null as production_note, min(t.title):2!null as movie_title, min(t.production_year):1!null as movie_year]\n" +
 11248  			" └─ GroupBy\n" +
 11249  			"     ├─ select: MIN(mc.note:5), MIN(t.production_year:2), MIN(t.title:1!null)\n" +
 11250  			"     ├─ group: \n" +
 11251  			"     └─ InnerJoin\n" +
 11252  			"         ├─ AND\n" +
 11253  			"         │   ├─ AND\n" +
 11254  			"         │   │   ├─ Eq\n" +
 11255  			"         │   │   │   ├─ ct.id:10!null\n" +
 11256  			"         │   │   │   └─ mc.company_type_id:4!null\n" +
 11257  			"         │   │   └─ Eq\n" +
 11258  			"         │   │       ├─ mc.movie_id:3!null\n" +
 11259  			"         │   │       └─ mi_idx.movie_id:6!null\n" +
 11260  			"         │   └─ Eq\n" +
 11261  			"         │       ├─ t.id:0!null\n" +
 11262  			"         │       └─ mi_idx.movie_id:6!null\n" +
 11263  			"         ├─ InnerJoin\n" +
 11264  			"         │   ├─ Eq\n" +
 11265  			"         │   │   ├─ t.id:0!null\n" +
 11266  			"         │   │   └─ mc.movie_id:3!null\n" +
 11267  			"         │   ├─ Filter\n" +
 11268  			"         │   │   ├─ GreaterThan\n" +
 11269  			"         │   │   │   ├─ t.production_year:2\n" +
 11270  			"         │   │   │   └─ 2010 (smallint)\n" +
 11271  			"         │   │   └─ TableAlias(t)\n" +
 11272  			"         │   │       └─ ProcessTable\n" +
 11273  			"         │   │           └─ Table\n" +
 11274  			"         │   │               ├─ name: title\n" +
 11275  			"         │   │               └─ columns: [id title production_year]\n" +
 11276  			"         │   └─ Filter\n" +
 11277  			"         │       ├─ AND\n" +
 11278  			"         │       │   ├─ NOT\n" +
 11279  			"         │       │   │   └─ mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'\n" +
 11280  			"         │       │   └─ mc.note LIKE '%(co-production)%'\n" +
 11281  			"         │       └─ TableAlias(mc)\n" +
 11282  			"         │           └─ ProcessTable\n" +
 11283  			"         │               └─ Table\n" +
 11284  			"         │                   ├─ name: movie_companies\n" +
 11285  			"         │                   └─ columns: [movie_id company_type_id note]\n" +
 11286  			"         └─ CrossJoin\n" +
 11287  			"             ├─ InnerJoin\n" +
 11288  			"             │   ├─ Eq\n" +
 11289  			"             │   │   ├─ it.id:8!null\n" +
 11290  			"             │   │   └─ mi_idx.info_type_id:7!null\n" +
 11291  			"             │   ├─ TableAlias(mi_idx)\n" +
 11292  			"             │   │   └─ ProcessTable\n" +
 11293  			"             │   │       └─ Table\n" +
 11294  			"             │   │           ├─ name: movie_info_idx\n" +
 11295  			"             │   │           └─ columns: [movie_id info_type_id]\n" +
 11296  			"             │   └─ Filter\n" +
 11297  			"             │       ├─ Eq\n" +
 11298  			"             │       │   ├─ it.info:1!null\n" +
 11299  			"             │       │   └─ top 250 rank (longtext)\n" +
 11300  			"             │       └─ TableAlias(it)\n" +
 11301  			"             │           └─ ProcessTable\n" +
 11302  			"             │               └─ Table\n" +
 11303  			"             │                   ├─ name: info_type\n" +
 11304  			"             │                   └─ columns: [id info]\n" +
 11305  			"             └─ Filter\n" +
 11306  			"                 ├─ Eq\n" +
 11307  			"                 │   ├─ ct.kind:1!null\n" +
 11308  			"                 │   └─ production companies (longtext)\n" +
 11309  			"                 └─ TableAlias(ct)\n" +
 11310  			"                     └─ ProcessTable\n" +
 11311  			"                         └─ Table\n" +
 11312  			"                             ├─ name: company_type\n" +
 11313  			"                             └─ columns: [id kind]\n" +
 11314  			"",
 11315  		ExpectedEstimates: "Project\n" +
 11316  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 11317  			" └─ GroupBy\n" +
 11318  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 11319  			"     ├─ Grouping()\n" +
 11320  			"     └─ InnerJoin\n" +
 11321  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 11322  			"         ├─ InnerJoin\n" +
 11323  			"         │   ├─ (t.id = mc.movie_id)\n" +
 11324  			"         │   ├─ Filter\n" +
 11325  			"         │   │   ├─ (t.production_year > 2010)\n" +
 11326  			"         │   │   └─ TableAlias(t)\n" +
 11327  			"         │   │       └─ Table\n" +
 11328  			"         │   │           ├─ name: title\n" +
 11329  			"         │   │           └─ columns: [id title production_year]\n" +
 11330  			"         │   └─ Filter\n" +
 11331  			"         │       ├─ ((NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%')) AND mc.note LIKE '%(co-production)%')\n" +
 11332  			"         │       └─ TableAlias(mc)\n" +
 11333  			"         │           └─ Table\n" +
 11334  			"         │               ├─ name: movie_companies\n" +
 11335  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 11336  			"         └─ CrossJoin\n" +
 11337  			"             ├─ InnerJoin\n" +
 11338  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 11339  			"             │   ├─ TableAlias(mi_idx)\n" +
 11340  			"             │   │   └─ Table\n" +
 11341  			"             │   │       ├─ name: movie_info_idx\n" +
 11342  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 11343  			"             │   └─ Filter\n" +
 11344  			"             │       ├─ (it.info = 'top 250 rank')\n" +
 11345  			"             │       └─ TableAlias(it)\n" +
 11346  			"             │           └─ Table\n" +
 11347  			"             │               ├─ name: info_type\n" +
 11348  			"             │               └─ columns: [id info]\n" +
 11349  			"             └─ Filter\n" +
 11350  			"                 ├─ (ct.kind = 'production companies')\n" +
 11351  			"                 └─ TableAlias(ct)\n" +
 11352  			"                     └─ Table\n" +
 11353  			"                         ├─ name: company_type\n" +
 11354  			"                         └─ columns: [id kind]\n" +
 11355  			"",
 11356  		ExpectedAnalysis: "Project\n" +
 11357  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 11358  			" └─ GroupBy\n" +
 11359  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 11360  			"     ├─ Grouping()\n" +
 11361  			"     └─ InnerJoin\n" +
 11362  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 11363  			"         ├─ InnerJoin\n" +
 11364  			"         │   ├─ (t.id = mc.movie_id)\n" +
 11365  			"         │   ├─ Filter\n" +
 11366  			"         │   │   ├─ (t.production_year > 2010)\n" +
 11367  			"         │   │   └─ TableAlias(t)\n" +
 11368  			"         │   │       └─ Table\n" +
 11369  			"         │   │           ├─ name: title\n" +
 11370  			"         │   │           └─ columns: [id title production_year]\n" +
 11371  			"         │   └─ Filter\n" +
 11372  			"         │       ├─ ((NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%')) AND mc.note LIKE '%(co-production)%')\n" +
 11373  			"         │       └─ TableAlias(mc)\n" +
 11374  			"         │           └─ Table\n" +
 11375  			"         │               ├─ name: movie_companies\n" +
 11376  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 11377  			"         └─ CrossJoin\n" +
 11378  			"             ├─ InnerJoin\n" +
 11379  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 11380  			"             │   ├─ TableAlias(mi_idx)\n" +
 11381  			"             │   │   └─ Table\n" +
 11382  			"             │   │       ├─ name: movie_info_idx\n" +
 11383  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 11384  			"             │   └─ Filter\n" +
 11385  			"             │       ├─ (it.info = 'top 250 rank')\n" +
 11386  			"             │       └─ TableAlias(it)\n" +
 11387  			"             │           └─ Table\n" +
 11388  			"             │               ├─ name: info_type\n" +
 11389  			"             │               └─ columns: [id info]\n" +
 11390  			"             └─ Filter\n" +
 11391  			"                 ├─ (ct.kind = 'production companies')\n" +
 11392  			"                 └─ TableAlias(ct)\n" +
 11393  			"                     └─ Table\n" +
 11394  			"                         ├─ name: company_type\n" +
 11395  			"                         └─ columns: [id kind]\n" +
 11396  			"",
 11397  	},
 11398  	{
 11399  		Query: `
 11400  SELECT MIN(mc.note) AS production_note,
 11401         MIN(t.title) AS movie_title,
 11402         MIN(t.production_year) AS movie_year
 11403  FROM company_type AS ct,
 11404       info_type AS it,
 11405       movie_companies AS mc,
 11406       movie_info_idx AS mi_idx,
 11407       title AS t
 11408  WHERE ct.kind = 'production companies'
 11409    AND it.info = 'bottom 10 rank'
 11410    AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'
 11411    AND t.production_year >2000
 11412    AND ct.id = mc.company_type_id
 11413    AND t.id = mc.movie_id
 11414    AND t.id = mi_idx.movie_id
 11415    AND mc.movie_id = mi_idx.movie_id
 11416    AND it.id = mi_idx.info_type_id;
 11417  
 11418  `,
 11419  		ExpectedPlan: "Project\n" +
 11420  			" ├─ columns: [min(mc.note):0!null as production_note, min(t.title):2!null as movie_title, min(t.production_year):1!null as movie_year]\n" +
 11421  			" └─ GroupBy\n" +
 11422  			"     ├─ select: MIN(mc.note:5), MIN(t.production_year:2), MIN(t.title:1!null)\n" +
 11423  			"     ├─ group: \n" +
 11424  			"     └─ InnerJoin\n" +
 11425  			"         ├─ AND\n" +
 11426  			"         │   ├─ AND\n" +
 11427  			"         │   │   ├─ Eq\n" +
 11428  			"         │   │   │   ├─ ct.id:10!null\n" +
 11429  			"         │   │   │   └─ mc.company_type_id:4!null\n" +
 11430  			"         │   │   └─ Eq\n" +
 11431  			"         │   │       ├─ mc.movie_id:3!null\n" +
 11432  			"         │   │       └─ mi_idx.movie_id:6!null\n" +
 11433  			"         │   └─ Eq\n" +
 11434  			"         │       ├─ t.id:0!null\n" +
 11435  			"         │       └─ mi_idx.movie_id:6!null\n" +
 11436  			"         ├─ InnerJoin\n" +
 11437  			"         │   ├─ Eq\n" +
 11438  			"         │   │   ├─ t.id:0!null\n" +
 11439  			"         │   │   └─ mc.movie_id:3!null\n" +
 11440  			"         │   ├─ Filter\n" +
 11441  			"         │   │   ├─ GreaterThan\n" +
 11442  			"         │   │   │   ├─ t.production_year:2\n" +
 11443  			"         │   │   │   └─ 2000 (smallint)\n" +
 11444  			"         │   │   └─ TableAlias(t)\n" +
 11445  			"         │   │       └─ ProcessTable\n" +
 11446  			"         │   │           └─ Table\n" +
 11447  			"         │   │               ├─ name: title\n" +
 11448  			"         │   │               └─ columns: [id title production_year]\n" +
 11449  			"         │   └─ Filter\n" +
 11450  			"         │       ├─ NOT\n" +
 11451  			"         │       │   └─ mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'\n" +
 11452  			"         │       └─ TableAlias(mc)\n" +
 11453  			"         │           └─ ProcessTable\n" +
 11454  			"         │               └─ Table\n" +
 11455  			"         │                   ├─ name: movie_companies\n" +
 11456  			"         │                   └─ columns: [movie_id company_type_id note]\n" +
 11457  			"         └─ CrossJoin\n" +
 11458  			"             ├─ InnerJoin\n" +
 11459  			"             │   ├─ Eq\n" +
 11460  			"             │   │   ├─ it.id:8!null\n" +
 11461  			"             │   │   └─ mi_idx.info_type_id:7!null\n" +
 11462  			"             │   ├─ TableAlias(mi_idx)\n" +
 11463  			"             │   │   └─ ProcessTable\n" +
 11464  			"             │   │       └─ Table\n" +
 11465  			"             │   │           ├─ name: movie_info_idx\n" +
 11466  			"             │   │           └─ columns: [movie_id info_type_id]\n" +
 11467  			"             │   └─ Filter\n" +
 11468  			"             │       ├─ Eq\n" +
 11469  			"             │       │   ├─ it.info:1!null\n" +
 11470  			"             │       │   └─ bottom 10 rank (longtext)\n" +
 11471  			"             │       └─ TableAlias(it)\n" +
 11472  			"             │           └─ ProcessTable\n" +
 11473  			"             │               └─ Table\n" +
 11474  			"             │                   ├─ name: info_type\n" +
 11475  			"             │                   └─ columns: [id info]\n" +
 11476  			"             └─ Filter\n" +
 11477  			"                 ├─ Eq\n" +
 11478  			"                 │   ├─ ct.kind:1!null\n" +
 11479  			"                 │   └─ production companies (longtext)\n" +
 11480  			"                 └─ TableAlias(ct)\n" +
 11481  			"                     └─ ProcessTable\n" +
 11482  			"                         └─ Table\n" +
 11483  			"                             ├─ name: company_type\n" +
 11484  			"                             └─ columns: [id kind]\n" +
 11485  			"",
 11486  		ExpectedEstimates: "Project\n" +
 11487  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 11488  			" └─ GroupBy\n" +
 11489  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 11490  			"     ├─ Grouping()\n" +
 11491  			"     └─ InnerJoin\n" +
 11492  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 11493  			"         ├─ InnerJoin\n" +
 11494  			"         │   ├─ (t.id = mc.movie_id)\n" +
 11495  			"         │   ├─ Filter\n" +
 11496  			"         │   │   ├─ (t.production_year > 2000)\n" +
 11497  			"         │   │   └─ TableAlias(t)\n" +
 11498  			"         │   │       └─ Table\n" +
 11499  			"         │   │           ├─ name: title\n" +
 11500  			"         │   │           └─ columns: [id title production_year]\n" +
 11501  			"         │   └─ Filter\n" +
 11502  			"         │       ├─ (NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'))\n" +
 11503  			"         │       └─ TableAlias(mc)\n" +
 11504  			"         │           └─ Table\n" +
 11505  			"         │               ├─ name: movie_companies\n" +
 11506  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 11507  			"         └─ CrossJoin\n" +
 11508  			"             ├─ InnerJoin\n" +
 11509  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 11510  			"             │   ├─ TableAlias(mi_idx)\n" +
 11511  			"             │   │   └─ Table\n" +
 11512  			"             │   │       ├─ name: movie_info_idx\n" +
 11513  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 11514  			"             │   └─ Filter\n" +
 11515  			"             │       ├─ (it.info = 'bottom 10 rank')\n" +
 11516  			"             │       └─ TableAlias(it)\n" +
 11517  			"             │           └─ Table\n" +
 11518  			"             │               ├─ name: info_type\n" +
 11519  			"             │               └─ columns: [id info]\n" +
 11520  			"             └─ Filter\n" +
 11521  			"                 ├─ (ct.kind = 'production companies')\n" +
 11522  			"                 └─ TableAlias(ct)\n" +
 11523  			"                     └─ Table\n" +
 11524  			"                         ├─ name: company_type\n" +
 11525  			"                         └─ columns: [id kind]\n" +
 11526  			"",
 11527  		ExpectedAnalysis: "Project\n" +
 11528  			" ├─ columns: [min(mc.note) as production_note, min(t.title) as movie_title, min(t.production_year) as movie_year]\n" +
 11529  			" └─ GroupBy\n" +
 11530  			"     ├─ SelectedExprs(MIN(mc.note), MIN(t.production_year), MIN(t.title))\n" +
 11531  			"     ├─ Grouping()\n" +
 11532  			"     └─ InnerJoin\n" +
 11533  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 11534  			"         ├─ InnerJoin\n" +
 11535  			"         │   ├─ (t.id = mc.movie_id)\n" +
 11536  			"         │   ├─ Filter\n" +
 11537  			"         │   │   ├─ (t.production_year > 2000)\n" +
 11538  			"         │   │   └─ TableAlias(t)\n" +
 11539  			"         │   │       └─ Table\n" +
 11540  			"         │   │           ├─ name: title\n" +
 11541  			"         │   │           └─ columns: [id title production_year]\n" +
 11542  			"         │   └─ Filter\n" +
 11543  			"         │       ├─ (NOT(mc.note LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'))\n" +
 11544  			"         │       └─ TableAlias(mc)\n" +
 11545  			"         │           └─ Table\n" +
 11546  			"         │               ├─ name: movie_companies\n" +
 11547  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 11548  			"         └─ CrossJoin\n" +
 11549  			"             ├─ InnerJoin\n" +
 11550  			"             │   ├─ (it.id = mi_idx.info_type_id)\n" +
 11551  			"             │   ├─ TableAlias(mi_idx)\n" +
 11552  			"             │   │   └─ Table\n" +
 11553  			"             │   │       ├─ name: movie_info_idx\n" +
 11554  			"             │   │       └─ columns: [movie_id info_type_id]\n" +
 11555  			"             │   └─ Filter\n" +
 11556  			"             │       ├─ (it.info = 'bottom 10 rank')\n" +
 11557  			"             │       └─ TableAlias(it)\n" +
 11558  			"             │           └─ Table\n" +
 11559  			"             │               ├─ name: info_type\n" +
 11560  			"             │               └─ columns: [id info]\n" +
 11561  			"             └─ Filter\n" +
 11562  			"                 ├─ (ct.kind = 'production companies')\n" +
 11563  			"                 └─ TableAlias(ct)\n" +
 11564  			"                     └─ Table\n" +
 11565  			"                         ├─ name: company_type\n" +
 11566  			"                         └─ columns: [id kind]\n" +
 11567  			"",
 11568  	},
 11569  	{
 11570  		Query: `
 11571  SELECT MIN(t.title) AS complete_downey_ironman_movie
 11572  FROM complete_cast AS cc,
 11573       comp_cast_type AS cct1,
 11574       comp_cast_type AS cct2,
 11575       char_name AS chn,
 11576       cast_info AS ci,
 11577       keyword AS k,
 11578       kind_type AS kt,
 11579       movie_keyword AS mk,
 11580       name AS n,
 11581       title AS t
 11582  WHERE cct1.kind = 'cast'
 11583    AND cct2.kind LIKE '%complete%'
 11584    AND chn.name NOT LIKE '%Sherlock%'
 11585    AND (chn.name LIKE '%Tony%Stark%'
 11586         OR chn.name LIKE '%Iron%Man%')
 11587    AND k.keyword IN ('superhero',
 11588                      'sequel',
 11589                      'second-part',
 11590                      'marvel-comics',
 11591                      'based-on-comic',
 11592                      'tv-special',
 11593                      'fight',
 11594                      'violence')
 11595    AND kt.kind = 'movie'
 11596    AND t.production_year > 1950
 11597    AND kt.id = t.kind_id
 11598    AND t.id = mk.movie_id
 11599    AND t.id = ci.movie_id
 11600    AND t.id = cc.movie_id
 11601    AND mk.movie_id = ci.movie_id
 11602    AND mk.movie_id = cc.movie_id
 11603    AND ci.movie_id = cc.movie_id
 11604    AND chn.id = ci.person_role_id
 11605    AND n.id = ci.person_id
 11606    AND k.id = mk.keyword_id
 11607    AND cct1.id = cc.subject_id
 11608    AND cct2.id = cc.status_id;
 11609  
 11610  `,
 11611  		ExpectedPlan: "Project\n" +
 11612  			" ├─ columns: [min(t.title):0!null as complete_downey_ironman_movie]\n" +
 11613  			" └─ GroupBy\n" +
 11614  			"     ├─ select: MIN(t.title:1!null)\n" +
 11615  			"     ├─ group: \n" +
 11616  			"     └─ InnerJoin\n" +
 11617  			"         ├─ AND\n" +
 11618  			"         │   ├─ AND\n" +
 11619  			"         │   │   ├─ Eq\n" +
 11620  			"         │   │   │   ├─ ci.movie_id:19!null\n" +
 11621  			"         │   │   │   └─ cc.movie_id:8\n" +
 11622  			"         │   │   └─ Eq\n" +
 11623  			"         │   │       ├─ mk.movie_id:13!null\n" +
 11624  			"         │   │       └─ ci.movie_id:19!null\n" +
 11625  			"         │   └─ Eq\n" +
 11626  			"         │       ├─ t.id:0!null\n" +
 11627  			"         │       └─ ci.movie_id:19!null\n" +
 11628  			"         ├─ InnerJoin\n" +
 11629  			"         │   ├─ Eq\n" +
 11630  			"         │   │   ├─ t.id:0!null\n" +
 11631  			"         │   │   └─ mk.movie_id:13!null\n" +
 11632  			"         │   ├─ InnerJoin\n" +
 11633  			"         │   │   ├─ Eq\n" +
 11634  			"         │   │   │   ├─ kt.id:11!null\n" +
 11635  			"         │   │   │   └─ t.kind_id:2!null\n" +
 11636  			"         │   │   ├─ InnerJoin\n" +
 11637  			"         │   │   │   ├─ Eq\n" +
 11638  			"         │   │   │   │   ├─ t.id:0!null\n" +
 11639  			"         │   │   │   │   └─ cc.movie_id:8\n" +
 11640  			"         │   │   │   ├─ Filter\n" +
 11641  			"         │   │   │   │   ├─ GreaterThan\n" +
 11642  			"         │   │   │   │   │   ├─ t.production_year:3\n" +
 11643  			"         │   │   │   │   │   └─ 1950 (smallint)\n" +
 11644  			"         │   │   │   │   └─ TableAlias(t)\n" +
 11645  			"         │   │   │   │       └─ ProcessTable\n" +
 11646  			"         │   │   │   │           └─ Table\n" +
 11647  			"         │   │   │   │               ├─ name: title\n" +
 11648  			"         │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 11649  			"         │   │   │   └─ InnerJoin\n" +
 11650  			"         │   │   │       ├─ Eq\n" +
 11651  			"         │   │   │       │   ├─ cct2.id:4!null\n" +
 11652  			"         │   │   │       │   └─ cc.status_id:10!null\n" +
 11653  			"         │   │   │       ├─ Filter\n" +
 11654  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 11655  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 11656  			"         │   │   │       │       └─ ProcessTable\n" +
 11657  			"         │   │   │       │           └─ Table\n" +
 11658  			"         │   │   │       │               ├─ name: comp_cast_type\n" +
 11659  			"         │   │   │       │               └─ columns: [id kind]\n" +
 11660  			"         │   │   │       └─ InnerJoin\n" +
 11661  			"         │   │   │           ├─ Eq\n" +
 11662  			"         │   │   │           │   ├─ cct1.id:6!null\n" +
 11663  			"         │   │   │           │   └─ cc.subject_id:9!null\n" +
 11664  			"         │   │   │           ├─ Filter\n" +
 11665  			"         │   │   │           │   ├─ Eq\n" +
 11666  			"         │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 11667  			"         │   │   │           │   │   └─ cast (longtext)\n" +
 11668  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 11669  			"         │   │   │           │       └─ Table\n" +
 11670  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 11671  			"         │   │   │           │           ├─ columns: [id kind]\n" +
 11672  			"         │   │   │           │           ├─ colSet: (5,6)\n" +
 11673  			"         │   │   │           │           └─ tableId: 2\n" +
 11674  			"         │   │   │           └─ TableAlias(cc)\n" +
 11675  			"         │   │   │               └─ ProcessTable\n" +
 11676  			"         │   │   │                   └─ Table\n" +
 11677  			"         │   │   │                       ├─ name: complete_cast\n" +
 11678  			"         │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 11679  			"         │   │   └─ Filter\n" +
 11680  			"         │   │       ├─ Eq\n" +
 11681  			"         │   │       │   ├─ kt.kind:1!null\n" +
 11682  			"         │   │       │   └─ movie (longtext)\n" +
 11683  			"         │   │       └─ TableAlias(kt)\n" +
 11684  			"         │   │           └─ ProcessTable\n" +
 11685  			"         │   │               └─ Table\n" +
 11686  			"         │   │                   ├─ name: kind_type\n" +
 11687  			"         │   │                   └─ columns: [id kind]\n" +
 11688  			"         │   └─ InnerJoin\n" +
 11689  			"         │       ├─ Eq\n" +
 11690  			"         │       │   ├─ k.id:15!null\n" +
 11691  			"         │       │   └─ mk.keyword_id:14!null\n" +
 11692  			"         │       ├─ TableAlias(mk)\n" +
 11693  			"         │       │   └─ ProcessTable\n" +
 11694  			"         │       │       └─ Table\n" +
 11695  			"         │       │           ├─ name: movie_keyword\n" +
 11696  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 11697  			"         │       └─ Filter\n" +
 11698  			"         │           ├─ HashIn\n" +
 11699  			"         │           │   ├─ k.keyword:1!null\n" +
 11700  			"         │           │   └─ TUPLE(superhero (longtext), sequel (longtext), second-part (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext))\n" +
 11701  			"         │           └─ TableAlias(k)\n" +
 11702  			"         │               └─ ProcessTable\n" +
 11703  			"         │                   └─ Table\n" +
 11704  			"         │                       ├─ name: keyword\n" +
 11705  			"         │                       └─ columns: [id keyword]\n" +
 11706  			"         └─ InnerJoin\n" +
 11707  			"             ├─ Eq\n" +
 11708  			"             │   ├─ n.id:17!null\n" +
 11709  			"             │   └─ ci.person_id:18!null\n" +
 11710  			"             ├─ TableAlias(n)\n" +
 11711  			"             │   └─ ProcessTable\n" +
 11712  			"             │       └─ Table\n" +
 11713  			"             │           ├─ name: name\n" +
 11714  			"             │           └─ columns: [id]\n" +
 11715  			"             └─ InnerJoin\n" +
 11716  			"                 ├─ Eq\n" +
 11717  			"                 │   ├─ chn.id:21!null\n" +
 11718  			"                 │   └─ ci.person_role_id:20\n" +
 11719  			"                 ├─ TableAlias(ci)\n" +
 11720  			"                 │   └─ ProcessTable\n" +
 11721  			"                 │       └─ Table\n" +
 11722  			"                 │           ├─ name: cast_info\n" +
 11723  			"                 │           └─ columns: [person_id movie_id person_role_id]\n" +
 11724  			"                 └─ Filter\n" +
 11725  			"                     ├─ AND\n" +
 11726  			"                     │   ├─ NOT\n" +
 11727  			"                     │   │   └─ chn.name LIKE '%Sherlock%'\n" +
 11728  			"                     │   └─ Or\n" +
 11729  			"                     │       ├─ chn.name LIKE '%Tony%Stark%'\n" +
 11730  			"                     │       └─ chn.name LIKE '%Iron%Man%'\n" +
 11731  			"                     └─ TableAlias(chn)\n" +
 11732  			"                         └─ ProcessTable\n" +
 11733  			"                             └─ Table\n" +
 11734  			"                                 ├─ name: char_name\n" +
 11735  			"                                 └─ columns: [id name]\n" +
 11736  			"",
 11737  		ExpectedEstimates: "Project\n" +
 11738  			" ├─ columns: [min(t.title) as complete_downey_ironman_movie]\n" +
 11739  			" └─ GroupBy\n" +
 11740  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 11741  			"     ├─ Grouping()\n" +
 11742  			"     └─ InnerJoin\n" +
 11743  			"         ├─ (((ci.movie_id = cc.movie_id) AND (mk.movie_id = ci.movie_id)) AND (t.id = ci.movie_id))\n" +
 11744  			"         ├─ InnerJoin\n" +
 11745  			"         │   ├─ (t.id = mk.movie_id)\n" +
 11746  			"         │   ├─ InnerJoin\n" +
 11747  			"         │   │   ├─ (kt.id = t.kind_id)\n" +
 11748  			"         │   │   ├─ InnerJoin\n" +
 11749  			"         │   │   │   ├─ (t.id = cc.movie_id)\n" +
 11750  			"         │   │   │   ├─ Filter\n" +
 11751  			"         │   │   │   │   ├─ (t.production_year > 1950)\n" +
 11752  			"         │   │   │   │   └─ TableAlias(t)\n" +
 11753  			"         │   │   │   │       └─ Table\n" +
 11754  			"         │   │   │   │           ├─ name: title\n" +
 11755  			"         │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 11756  			"         │   │   │   └─ InnerJoin\n" +
 11757  			"         │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 11758  			"         │   │   │       ├─ Filter\n" +
 11759  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 11760  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 11761  			"         │   │   │       │       └─ Table\n" +
 11762  			"         │   │   │       │           ├─ name: comp_cast_type\n" +
 11763  			"         │   │   │       │           └─ columns: [id kind]\n" +
 11764  			"         │   │   │       └─ InnerJoin\n" +
 11765  			"         │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 11766  			"         │   │   │           ├─ Filter\n" +
 11767  			"         │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 11768  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 11769  			"         │   │   │           │       └─ Table\n" +
 11770  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 11771  			"         │   │   │           │           └─ columns: [id kind]\n" +
 11772  			"         │   │   │           └─ TableAlias(cc)\n" +
 11773  			"         │   │   │               └─ Table\n" +
 11774  			"         │   │   │                   ├─ name: complete_cast\n" +
 11775  			"         │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 11776  			"         │   │   └─ Filter\n" +
 11777  			"         │   │       ├─ (kt.kind = 'movie')\n" +
 11778  			"         │   │       └─ TableAlias(kt)\n" +
 11779  			"         │   │           └─ Table\n" +
 11780  			"         │   │               ├─ name: kind_type\n" +
 11781  			"         │   │               └─ columns: [id kind]\n" +
 11782  			"         │   └─ InnerJoin\n" +
 11783  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 11784  			"         │       ├─ TableAlias(mk)\n" +
 11785  			"         │       │   └─ Table\n" +
 11786  			"         │       │       ├─ name: movie_keyword\n" +
 11787  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 11788  			"         │       └─ Filter\n" +
 11789  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 11790  			"         │           └─ TableAlias(k)\n" +
 11791  			"         │               └─ Table\n" +
 11792  			"         │                   ├─ name: keyword\n" +
 11793  			"         │                   └─ columns: [id keyword]\n" +
 11794  			"         └─ InnerJoin\n" +
 11795  			"             ├─ (n.id = ci.person_id)\n" +
 11796  			"             ├─ TableAlias(n)\n" +
 11797  			"             │   └─ Table\n" +
 11798  			"             │       ├─ name: name\n" +
 11799  			"             │       └─ columns: [id]\n" +
 11800  			"             └─ InnerJoin\n" +
 11801  			"                 ├─ (chn.id = ci.person_role_id)\n" +
 11802  			"                 ├─ TableAlias(ci)\n" +
 11803  			"                 │   └─ Table\n" +
 11804  			"                 │       ├─ name: cast_info\n" +
 11805  			"                 │       └─ columns: [person_id movie_id person_role_id]\n" +
 11806  			"                 └─ Filter\n" +
 11807  			"                     ├─ ((NOT(chn.name LIKE '%Sherlock%')) AND (chn.name LIKE '%Tony%Stark%' OR chn.name LIKE '%Iron%Man%'))\n" +
 11808  			"                     └─ TableAlias(chn)\n" +
 11809  			"                         └─ Table\n" +
 11810  			"                             ├─ name: char_name\n" +
 11811  			"                             └─ columns: [id name]\n" +
 11812  			"",
 11813  		ExpectedAnalysis: "Project\n" +
 11814  			" ├─ columns: [min(t.title) as complete_downey_ironman_movie]\n" +
 11815  			" └─ GroupBy\n" +
 11816  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 11817  			"     ├─ Grouping()\n" +
 11818  			"     └─ InnerJoin\n" +
 11819  			"         ├─ (((ci.movie_id = cc.movie_id) AND (mk.movie_id = ci.movie_id)) AND (t.id = ci.movie_id))\n" +
 11820  			"         ├─ InnerJoin\n" +
 11821  			"         │   ├─ (t.id = mk.movie_id)\n" +
 11822  			"         │   ├─ InnerJoin\n" +
 11823  			"         │   │   ├─ (kt.id = t.kind_id)\n" +
 11824  			"         │   │   ├─ InnerJoin\n" +
 11825  			"         │   │   │   ├─ (t.id = cc.movie_id)\n" +
 11826  			"         │   │   │   ├─ Filter\n" +
 11827  			"         │   │   │   │   ├─ (t.production_year > 1950)\n" +
 11828  			"         │   │   │   │   └─ TableAlias(t)\n" +
 11829  			"         │   │   │   │       └─ Table\n" +
 11830  			"         │   │   │   │           ├─ name: title\n" +
 11831  			"         │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 11832  			"         │   │   │   └─ InnerJoin\n" +
 11833  			"         │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 11834  			"         │   │   │       ├─ Filter\n" +
 11835  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 11836  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 11837  			"         │   │   │       │       └─ Table\n" +
 11838  			"         │   │   │       │           ├─ name: comp_cast_type\n" +
 11839  			"         │   │   │       │           └─ columns: [id kind]\n" +
 11840  			"         │   │   │       └─ InnerJoin\n" +
 11841  			"         │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 11842  			"         │   │   │           ├─ Filter\n" +
 11843  			"         │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 11844  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 11845  			"         │   │   │           │       └─ Table\n" +
 11846  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 11847  			"         │   │   │           │           └─ columns: [id kind]\n" +
 11848  			"         │   │   │           └─ TableAlias(cc)\n" +
 11849  			"         │   │   │               └─ Table\n" +
 11850  			"         │   │   │                   ├─ name: complete_cast\n" +
 11851  			"         │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 11852  			"         │   │   └─ Filter\n" +
 11853  			"         │   │       ├─ (kt.kind = 'movie')\n" +
 11854  			"         │   │       └─ TableAlias(kt)\n" +
 11855  			"         │   │           └─ Table\n" +
 11856  			"         │   │               ├─ name: kind_type\n" +
 11857  			"         │   │               └─ columns: [id kind]\n" +
 11858  			"         │   └─ InnerJoin\n" +
 11859  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 11860  			"         │       ├─ TableAlias(mk)\n" +
 11861  			"         │       │   └─ Table\n" +
 11862  			"         │       │       ├─ name: movie_keyword\n" +
 11863  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 11864  			"         │       └─ Filter\n" +
 11865  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 11866  			"         │           └─ TableAlias(k)\n" +
 11867  			"         │               └─ Table\n" +
 11868  			"         │                   ├─ name: keyword\n" +
 11869  			"         │                   └─ columns: [id keyword]\n" +
 11870  			"         └─ InnerJoin\n" +
 11871  			"             ├─ (n.id = ci.person_id)\n" +
 11872  			"             ├─ TableAlias(n)\n" +
 11873  			"             │   └─ Table\n" +
 11874  			"             │       ├─ name: name\n" +
 11875  			"             │       └─ columns: [id]\n" +
 11876  			"             └─ InnerJoin\n" +
 11877  			"                 ├─ (chn.id = ci.person_role_id)\n" +
 11878  			"                 ├─ TableAlias(ci)\n" +
 11879  			"                 │   └─ Table\n" +
 11880  			"                 │       ├─ name: cast_info\n" +
 11881  			"                 │       └─ columns: [person_id movie_id person_role_id]\n" +
 11882  			"                 └─ Filter\n" +
 11883  			"                     ├─ ((NOT(chn.name LIKE '%Sherlock%')) AND (chn.name LIKE '%Tony%Stark%' OR chn.name LIKE '%Iron%Man%'))\n" +
 11884  			"                     └─ TableAlias(chn)\n" +
 11885  			"                         └─ Table\n" +
 11886  			"                             ├─ name: char_name\n" +
 11887  			"                             └─ columns: [id name]\n" +
 11888  			"",
 11889  	},
 11890  	{
 11891  		Query: `
 11892  SELECT MIN(t.title) AS complete_downey_ironman_movie
 11893  FROM complete_cast AS cc,
 11894       comp_cast_type AS cct1,
 11895       comp_cast_type AS cct2,
 11896       char_name AS chn,
 11897       cast_info AS ci,
 11898       keyword AS k,
 11899       kind_type AS kt,
 11900       movie_keyword AS mk,
 11901       name AS n,
 11902       title AS t
 11903  WHERE cct1.kind = 'cast'
 11904    AND cct2.kind LIKE '%complete%'
 11905    AND chn.name NOT LIKE '%Sherlock%'
 11906    AND (chn.name LIKE '%Tony%Stark%'
 11907         OR chn.name LIKE '%Iron%Man%')
 11908    AND k.keyword IN ('superhero',
 11909                      'sequel',
 11910                      'second-part',
 11911                      'marvel-comics',
 11912                      'based-on-comic',
 11913                      'tv-special',
 11914                      'fight',
 11915                      'violence')
 11916    AND kt.kind = 'movie'
 11917    AND n.name LIKE '%Downey%Robert%'
 11918    AND t.production_year > 2000
 11919    AND kt.id = t.kind_id
 11920    AND t.id = mk.movie_id
 11921    AND t.id = ci.movie_id
 11922    AND t.id = cc.movie_id
 11923    AND mk.movie_id = ci.movie_id
 11924    AND mk.movie_id = cc.movie_id
 11925    AND ci.movie_id = cc.movie_id
 11926    AND chn.id = ci.person_role_id
 11927    AND n.id = ci.person_id
 11928    AND k.id = mk.keyword_id
 11929    AND cct1.id = cc.subject_id
 11930    AND cct2.id = cc.status_id;
 11931  
 11932  `,
 11933  		ExpectedPlan: "Project\n" +
 11934  			" ├─ columns: [min(t.title):0!null as complete_downey_ironman_movie]\n" +
 11935  			" └─ GroupBy\n" +
 11936  			"     ├─ select: MIN(t.title:1!null)\n" +
 11937  			"     ├─ group: \n" +
 11938  			"     └─ InnerJoin\n" +
 11939  			"         ├─ AND\n" +
 11940  			"         │   ├─ AND\n" +
 11941  			"         │   │   ├─ Eq\n" +
 11942  			"         │   │   │   ├─ ci.movie_id:20!null\n" +
 11943  			"         │   │   │   └─ cc.movie_id:8\n" +
 11944  			"         │   │   └─ Eq\n" +
 11945  			"         │   │       ├─ mk.movie_id:13!null\n" +
 11946  			"         │   │       └─ ci.movie_id:20!null\n" +
 11947  			"         │   └─ Eq\n" +
 11948  			"         │       ├─ t.id:0!null\n" +
 11949  			"         │       └─ ci.movie_id:20!null\n" +
 11950  			"         ├─ InnerJoin\n" +
 11951  			"         │   ├─ Eq\n" +
 11952  			"         │   │   ├─ t.id:0!null\n" +
 11953  			"         │   │   └─ mk.movie_id:13!null\n" +
 11954  			"         │   ├─ InnerJoin\n" +
 11955  			"         │   │   ├─ Eq\n" +
 11956  			"         │   │   │   ├─ kt.id:11!null\n" +
 11957  			"         │   │   │   └─ t.kind_id:2!null\n" +
 11958  			"         │   │   ├─ InnerJoin\n" +
 11959  			"         │   │   │   ├─ Eq\n" +
 11960  			"         │   │   │   │   ├─ t.id:0!null\n" +
 11961  			"         │   │   │   │   └─ cc.movie_id:8\n" +
 11962  			"         │   │   │   ├─ Filter\n" +
 11963  			"         │   │   │   │   ├─ GreaterThan\n" +
 11964  			"         │   │   │   │   │   ├─ t.production_year:3\n" +
 11965  			"         │   │   │   │   │   └─ 2000 (smallint)\n" +
 11966  			"         │   │   │   │   └─ TableAlias(t)\n" +
 11967  			"         │   │   │   │       └─ ProcessTable\n" +
 11968  			"         │   │   │   │           └─ Table\n" +
 11969  			"         │   │   │   │               ├─ name: title\n" +
 11970  			"         │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 11971  			"         │   │   │   └─ InnerJoin\n" +
 11972  			"         │   │   │       ├─ Eq\n" +
 11973  			"         │   │   │       │   ├─ cct2.id:4!null\n" +
 11974  			"         │   │   │       │   └─ cc.status_id:10!null\n" +
 11975  			"         │   │   │       ├─ Filter\n" +
 11976  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 11977  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 11978  			"         │   │   │       │       └─ ProcessTable\n" +
 11979  			"         │   │   │       │           └─ Table\n" +
 11980  			"         │   │   │       │               ├─ name: comp_cast_type\n" +
 11981  			"         │   │   │       │               └─ columns: [id kind]\n" +
 11982  			"         │   │   │       └─ InnerJoin\n" +
 11983  			"         │   │   │           ├─ Eq\n" +
 11984  			"         │   │   │           │   ├─ cct1.id:6!null\n" +
 11985  			"         │   │   │           │   └─ cc.subject_id:9!null\n" +
 11986  			"         │   │   │           ├─ Filter\n" +
 11987  			"         │   │   │           │   ├─ Eq\n" +
 11988  			"         │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 11989  			"         │   │   │           │   │   └─ cast (longtext)\n" +
 11990  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 11991  			"         │   │   │           │       └─ Table\n" +
 11992  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 11993  			"         │   │   │           │           ├─ columns: [id kind]\n" +
 11994  			"         │   │   │           │           ├─ colSet: (5,6)\n" +
 11995  			"         │   │   │           │           └─ tableId: 2\n" +
 11996  			"         │   │   │           └─ TableAlias(cc)\n" +
 11997  			"         │   │   │               └─ ProcessTable\n" +
 11998  			"         │   │   │                   └─ Table\n" +
 11999  			"         │   │   │                       ├─ name: complete_cast\n" +
 12000  			"         │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 12001  			"         │   │   └─ Filter\n" +
 12002  			"         │   │       ├─ Eq\n" +
 12003  			"         │   │       │   ├─ kt.kind:1!null\n" +
 12004  			"         │   │       │   └─ movie (longtext)\n" +
 12005  			"         │   │       └─ TableAlias(kt)\n" +
 12006  			"         │   │           └─ ProcessTable\n" +
 12007  			"         │   │               └─ Table\n" +
 12008  			"         │   │                   ├─ name: kind_type\n" +
 12009  			"         │   │                   └─ columns: [id kind]\n" +
 12010  			"         │   └─ InnerJoin\n" +
 12011  			"         │       ├─ Eq\n" +
 12012  			"         │       │   ├─ k.id:15!null\n" +
 12013  			"         │       │   └─ mk.keyword_id:14!null\n" +
 12014  			"         │       ├─ TableAlias(mk)\n" +
 12015  			"         │       │   └─ ProcessTable\n" +
 12016  			"         │       │       └─ Table\n" +
 12017  			"         │       │           ├─ name: movie_keyword\n" +
 12018  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 12019  			"         │       └─ Filter\n" +
 12020  			"         │           ├─ HashIn\n" +
 12021  			"         │           │   ├─ k.keyword:1!null\n" +
 12022  			"         │           │   └─ TUPLE(superhero (longtext), sequel (longtext), second-part (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext))\n" +
 12023  			"         │           └─ TableAlias(k)\n" +
 12024  			"         │               └─ ProcessTable\n" +
 12025  			"         │                   └─ Table\n" +
 12026  			"         │                       ├─ name: keyword\n" +
 12027  			"         │                       └─ columns: [id keyword]\n" +
 12028  			"         └─ InnerJoin\n" +
 12029  			"             ├─ Eq\n" +
 12030  			"             │   ├─ n.id:17!null\n" +
 12031  			"             │   └─ ci.person_id:19!null\n" +
 12032  			"             ├─ Filter\n" +
 12033  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 12034  			"             │   └─ TableAlias(n)\n" +
 12035  			"             │       └─ ProcessTable\n" +
 12036  			"             │           └─ Table\n" +
 12037  			"             │               ├─ name: name\n" +
 12038  			"             │               └─ columns: [id name]\n" +
 12039  			"             └─ InnerJoin\n" +
 12040  			"                 ├─ Eq\n" +
 12041  			"                 │   ├─ chn.id:22!null\n" +
 12042  			"                 │   └─ ci.person_role_id:21\n" +
 12043  			"                 ├─ TableAlias(ci)\n" +
 12044  			"                 │   └─ ProcessTable\n" +
 12045  			"                 │       └─ Table\n" +
 12046  			"                 │           ├─ name: cast_info\n" +
 12047  			"                 │           └─ columns: [person_id movie_id person_role_id]\n" +
 12048  			"                 └─ Filter\n" +
 12049  			"                     ├─ AND\n" +
 12050  			"                     │   ├─ NOT\n" +
 12051  			"                     │   │   └─ chn.name LIKE '%Sherlock%'\n" +
 12052  			"                     │   └─ Or\n" +
 12053  			"                     │       ├─ chn.name LIKE '%Tony%Stark%'\n" +
 12054  			"                     │       └─ chn.name LIKE '%Iron%Man%'\n" +
 12055  			"                     └─ TableAlias(chn)\n" +
 12056  			"                         └─ ProcessTable\n" +
 12057  			"                             └─ Table\n" +
 12058  			"                                 ├─ name: char_name\n" +
 12059  			"                                 └─ columns: [id name]\n" +
 12060  			"",
 12061  		ExpectedEstimates: "Project\n" +
 12062  			" ├─ columns: [min(t.title) as complete_downey_ironman_movie]\n" +
 12063  			" └─ GroupBy\n" +
 12064  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 12065  			"     ├─ Grouping()\n" +
 12066  			"     └─ InnerJoin\n" +
 12067  			"         ├─ (((ci.movie_id = cc.movie_id) AND (mk.movie_id = ci.movie_id)) AND (t.id = ci.movie_id))\n" +
 12068  			"         ├─ InnerJoin\n" +
 12069  			"         │   ├─ (t.id = mk.movie_id)\n" +
 12070  			"         │   ├─ InnerJoin\n" +
 12071  			"         │   │   ├─ (kt.id = t.kind_id)\n" +
 12072  			"         │   │   ├─ InnerJoin\n" +
 12073  			"         │   │   │   ├─ (t.id = cc.movie_id)\n" +
 12074  			"         │   │   │   ├─ Filter\n" +
 12075  			"         │   │   │   │   ├─ (t.production_year > 2000)\n" +
 12076  			"         │   │   │   │   └─ TableAlias(t)\n" +
 12077  			"         │   │   │   │       └─ Table\n" +
 12078  			"         │   │   │   │           ├─ name: title\n" +
 12079  			"         │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 12080  			"         │   │   │   └─ InnerJoin\n" +
 12081  			"         │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 12082  			"         │   │   │       ├─ Filter\n" +
 12083  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 12084  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 12085  			"         │   │   │       │       └─ Table\n" +
 12086  			"         │   │   │       │           ├─ name: comp_cast_type\n" +
 12087  			"         │   │   │       │           └─ columns: [id kind]\n" +
 12088  			"         │   │   │       └─ InnerJoin\n" +
 12089  			"         │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 12090  			"         │   │   │           ├─ Filter\n" +
 12091  			"         │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 12092  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 12093  			"         │   │   │           │       └─ Table\n" +
 12094  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 12095  			"         │   │   │           │           └─ columns: [id kind]\n" +
 12096  			"         │   │   │           └─ TableAlias(cc)\n" +
 12097  			"         │   │   │               └─ Table\n" +
 12098  			"         │   │   │                   ├─ name: complete_cast\n" +
 12099  			"         │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 12100  			"         │   │   └─ Filter\n" +
 12101  			"         │   │       ├─ (kt.kind = 'movie')\n" +
 12102  			"         │   │       └─ TableAlias(kt)\n" +
 12103  			"         │   │           └─ Table\n" +
 12104  			"         │   │               ├─ name: kind_type\n" +
 12105  			"         │   │               └─ columns: [id kind]\n" +
 12106  			"         │   └─ InnerJoin\n" +
 12107  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 12108  			"         │       ├─ TableAlias(mk)\n" +
 12109  			"         │       │   └─ Table\n" +
 12110  			"         │       │       ├─ name: movie_keyword\n" +
 12111  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 12112  			"         │       └─ Filter\n" +
 12113  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 12114  			"         │           └─ TableAlias(k)\n" +
 12115  			"         │               └─ Table\n" +
 12116  			"         │                   ├─ name: keyword\n" +
 12117  			"         │                   └─ columns: [id keyword]\n" +
 12118  			"         └─ InnerJoin\n" +
 12119  			"             ├─ (n.id = ci.person_id)\n" +
 12120  			"             ├─ Filter\n" +
 12121  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 12122  			"             │   └─ TableAlias(n)\n" +
 12123  			"             │       └─ Table\n" +
 12124  			"             │           ├─ name: name\n" +
 12125  			"             │           └─ columns: [id name]\n" +
 12126  			"             └─ InnerJoin\n" +
 12127  			"                 ├─ (chn.id = ci.person_role_id)\n" +
 12128  			"                 ├─ TableAlias(ci)\n" +
 12129  			"                 │   └─ Table\n" +
 12130  			"                 │       ├─ name: cast_info\n" +
 12131  			"                 │       └─ columns: [person_id movie_id person_role_id]\n" +
 12132  			"                 └─ Filter\n" +
 12133  			"                     ├─ ((NOT(chn.name LIKE '%Sherlock%')) AND (chn.name LIKE '%Tony%Stark%' OR chn.name LIKE '%Iron%Man%'))\n" +
 12134  			"                     └─ TableAlias(chn)\n" +
 12135  			"                         └─ Table\n" +
 12136  			"                             ├─ name: char_name\n" +
 12137  			"                             └─ columns: [id name]\n" +
 12138  			"",
 12139  		ExpectedAnalysis: "Project\n" +
 12140  			" ├─ columns: [min(t.title) as complete_downey_ironman_movie]\n" +
 12141  			" └─ GroupBy\n" +
 12142  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 12143  			"     ├─ Grouping()\n" +
 12144  			"     └─ InnerJoin\n" +
 12145  			"         ├─ (((ci.movie_id = cc.movie_id) AND (mk.movie_id = ci.movie_id)) AND (t.id = ci.movie_id))\n" +
 12146  			"         ├─ InnerJoin\n" +
 12147  			"         │   ├─ (t.id = mk.movie_id)\n" +
 12148  			"         │   ├─ InnerJoin\n" +
 12149  			"         │   │   ├─ (kt.id = t.kind_id)\n" +
 12150  			"         │   │   ├─ InnerJoin\n" +
 12151  			"         │   │   │   ├─ (t.id = cc.movie_id)\n" +
 12152  			"         │   │   │   ├─ Filter\n" +
 12153  			"         │   │   │   │   ├─ (t.production_year > 2000)\n" +
 12154  			"         │   │   │   │   └─ TableAlias(t)\n" +
 12155  			"         │   │   │   │       └─ Table\n" +
 12156  			"         │   │   │   │           ├─ name: title\n" +
 12157  			"         │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 12158  			"         │   │   │   └─ InnerJoin\n" +
 12159  			"         │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 12160  			"         │   │   │       ├─ Filter\n" +
 12161  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 12162  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 12163  			"         │   │   │       │       └─ Table\n" +
 12164  			"         │   │   │       │           ├─ name: comp_cast_type\n" +
 12165  			"         │   │   │       │           └─ columns: [id kind]\n" +
 12166  			"         │   │   │       └─ InnerJoin\n" +
 12167  			"         │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 12168  			"         │   │   │           ├─ Filter\n" +
 12169  			"         │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 12170  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 12171  			"         │   │   │           │       └─ Table\n" +
 12172  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 12173  			"         │   │   │           │           └─ columns: [id kind]\n" +
 12174  			"         │   │   │           └─ TableAlias(cc)\n" +
 12175  			"         │   │   │               └─ Table\n" +
 12176  			"         │   │   │                   ├─ name: complete_cast\n" +
 12177  			"         │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 12178  			"         │   │   └─ Filter\n" +
 12179  			"         │   │       ├─ (kt.kind = 'movie')\n" +
 12180  			"         │   │       └─ TableAlias(kt)\n" +
 12181  			"         │   │           └─ Table\n" +
 12182  			"         │   │               ├─ name: kind_type\n" +
 12183  			"         │   │               └─ columns: [id kind]\n" +
 12184  			"         │   └─ InnerJoin\n" +
 12185  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 12186  			"         │       ├─ TableAlias(mk)\n" +
 12187  			"         │       │   └─ Table\n" +
 12188  			"         │       │       ├─ name: movie_keyword\n" +
 12189  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 12190  			"         │       └─ Filter\n" +
 12191  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 12192  			"         │           └─ TableAlias(k)\n" +
 12193  			"         │               └─ Table\n" +
 12194  			"         │                   ├─ name: keyword\n" +
 12195  			"         │                   └─ columns: [id keyword]\n" +
 12196  			"         └─ InnerJoin\n" +
 12197  			"             ├─ (n.id = ci.person_id)\n" +
 12198  			"             ├─ Filter\n" +
 12199  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 12200  			"             │   └─ TableAlias(n)\n" +
 12201  			"             │       └─ Table\n" +
 12202  			"             │           ├─ name: name\n" +
 12203  			"             │           └─ columns: [id name]\n" +
 12204  			"             └─ InnerJoin\n" +
 12205  			"                 ├─ (chn.id = ci.person_role_id)\n" +
 12206  			"                 ├─ TableAlias(ci)\n" +
 12207  			"                 │   └─ Table\n" +
 12208  			"                 │       ├─ name: cast_info\n" +
 12209  			"                 │       └─ columns: [person_id movie_id person_role_id]\n" +
 12210  			"                 └─ Filter\n" +
 12211  			"                     ├─ ((NOT(chn.name LIKE '%Sherlock%')) AND (chn.name LIKE '%Tony%Stark%' OR chn.name LIKE '%Iron%Man%'))\n" +
 12212  			"                     └─ TableAlias(chn)\n" +
 12213  			"                         └─ Table\n" +
 12214  			"                             ├─ name: char_name\n" +
 12215  			"                             └─ columns: [id name]\n" +
 12216  			"",
 12217  	},
 12218  	{
 12219  		Query: `
 12220  SELECT MIN(n.name) AS cast_member,
 12221         MIN(t.title) AS complete_dynamic_hero_movie
 12222  FROM complete_cast AS cc,
 12223       comp_cast_type AS cct1,
 12224       comp_cast_type AS cct2,
 12225       char_name AS chn,
 12226       cast_info AS ci,
 12227       keyword AS k,
 12228       kind_type AS kt,
 12229       movie_keyword AS mk,
 12230       name AS n,
 12231       title AS t
 12232  WHERE cct1.kind = 'cast'
 12233    AND cct2.kind LIKE '%complete%'
 12234    AND chn.name IS NOT NULL
 12235    AND (chn.name LIKE '%man%'
 12236         OR chn.name LIKE '%Man%')
 12237    AND k.keyword IN ('superhero',
 12238                      'marvel-comics',
 12239                      'based-on-comic',
 12240                      'tv-special',
 12241                      'fight',
 12242                      'violence',
 12243                      'magnet',
 12244                      'web',
 12245                      'claw',
 12246                      'laser')
 12247    AND kt.kind = 'movie'
 12248    AND t.production_year > 2000
 12249    AND kt.id = t.kind_id
 12250    AND t.id = mk.movie_id
 12251    AND t.id = ci.movie_id
 12252    AND t.id = cc.movie_id
 12253    AND mk.movie_id = ci.movie_id
 12254    AND mk.movie_id = cc.movie_id
 12255    AND ci.movie_id = cc.movie_id
 12256    AND chn.id = ci.person_role_id
 12257    AND n.id = ci.person_id
 12258    AND k.id = mk.keyword_id
 12259    AND cct1.id = cc.subject_id
 12260    AND cct2.id = cc.status_id;
 12261  
 12262  `,
 12263  		ExpectedPlan: "Project\n" +
 12264  			" ├─ columns: [min(n.name):0!null as cast_member, min(t.title):1!null as complete_dynamic_hero_movie]\n" +
 12265  			" └─ GroupBy\n" +
 12266  			"     ├─ select: MIN(n.name:18!null), MIN(t.title:1!null)\n" +
 12267  			"     ├─ group: \n" +
 12268  			"     └─ InnerJoin\n" +
 12269  			"         ├─ AND\n" +
 12270  			"         │   ├─ AND\n" +
 12271  			"         │   │   ├─ Eq\n" +
 12272  			"         │   │   │   ├─ ci.movie_id:20!null\n" +
 12273  			"         │   │   │   └─ cc.movie_id:8\n" +
 12274  			"         │   │   └─ Eq\n" +
 12275  			"         │   │       ├─ mk.movie_id:13!null\n" +
 12276  			"         │   │       └─ ci.movie_id:20!null\n" +
 12277  			"         │   └─ Eq\n" +
 12278  			"         │       ├─ t.id:0!null\n" +
 12279  			"         │       └─ ci.movie_id:20!null\n" +
 12280  			"         ├─ InnerJoin\n" +
 12281  			"         │   ├─ Eq\n" +
 12282  			"         │   │   ├─ t.id:0!null\n" +
 12283  			"         │   │   └─ mk.movie_id:13!null\n" +
 12284  			"         │   ├─ InnerJoin\n" +
 12285  			"         │   │   ├─ Eq\n" +
 12286  			"         │   │   │   ├─ kt.id:11!null\n" +
 12287  			"         │   │   │   └─ t.kind_id:2!null\n" +
 12288  			"         │   │   ├─ InnerJoin\n" +
 12289  			"         │   │   │   ├─ Eq\n" +
 12290  			"         │   │   │   │   ├─ t.id:0!null\n" +
 12291  			"         │   │   │   │   └─ cc.movie_id:8\n" +
 12292  			"         │   │   │   ├─ Filter\n" +
 12293  			"         │   │   │   │   ├─ GreaterThan\n" +
 12294  			"         │   │   │   │   │   ├─ t.production_year:3\n" +
 12295  			"         │   │   │   │   │   └─ 2000 (smallint)\n" +
 12296  			"         │   │   │   │   └─ TableAlias(t)\n" +
 12297  			"         │   │   │   │       └─ ProcessTable\n" +
 12298  			"         │   │   │   │           └─ Table\n" +
 12299  			"         │   │   │   │               ├─ name: title\n" +
 12300  			"         │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 12301  			"         │   │   │   └─ InnerJoin\n" +
 12302  			"         │   │   │       ├─ Eq\n" +
 12303  			"         │   │   │       │   ├─ cct2.id:4!null\n" +
 12304  			"         │   │   │       │   └─ cc.status_id:10!null\n" +
 12305  			"         │   │   │       ├─ Filter\n" +
 12306  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 12307  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 12308  			"         │   │   │       │       └─ ProcessTable\n" +
 12309  			"         │   │   │       │           └─ Table\n" +
 12310  			"         │   │   │       │               ├─ name: comp_cast_type\n" +
 12311  			"         │   │   │       │               └─ columns: [id kind]\n" +
 12312  			"         │   │   │       └─ InnerJoin\n" +
 12313  			"         │   │   │           ├─ Eq\n" +
 12314  			"         │   │   │           │   ├─ cct1.id:6!null\n" +
 12315  			"         │   │   │           │   └─ cc.subject_id:9!null\n" +
 12316  			"         │   │   │           ├─ Filter\n" +
 12317  			"         │   │   │           │   ├─ Eq\n" +
 12318  			"         │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 12319  			"         │   │   │           │   │   └─ cast (longtext)\n" +
 12320  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 12321  			"         │   │   │           │       └─ Table\n" +
 12322  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 12323  			"         │   │   │           │           ├─ columns: [id kind]\n" +
 12324  			"         │   │   │           │           ├─ colSet: (5,6)\n" +
 12325  			"         │   │   │           │           └─ tableId: 2\n" +
 12326  			"         │   │   │           └─ TableAlias(cc)\n" +
 12327  			"         │   │   │               └─ ProcessTable\n" +
 12328  			"         │   │   │                   └─ Table\n" +
 12329  			"         │   │   │                       ├─ name: complete_cast\n" +
 12330  			"         │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 12331  			"         │   │   └─ Filter\n" +
 12332  			"         │   │       ├─ Eq\n" +
 12333  			"         │   │       │   ├─ kt.kind:1!null\n" +
 12334  			"         │   │       │   └─ movie (longtext)\n" +
 12335  			"         │   │       └─ TableAlias(kt)\n" +
 12336  			"         │   │           └─ ProcessTable\n" +
 12337  			"         │   │               └─ Table\n" +
 12338  			"         │   │                   ├─ name: kind_type\n" +
 12339  			"         │   │                   └─ columns: [id kind]\n" +
 12340  			"         │   └─ InnerJoin\n" +
 12341  			"         │       ├─ Eq\n" +
 12342  			"         │       │   ├─ k.id:15!null\n" +
 12343  			"         │       │   └─ mk.keyword_id:14!null\n" +
 12344  			"         │       ├─ TableAlias(mk)\n" +
 12345  			"         │       │   └─ ProcessTable\n" +
 12346  			"         │       │       └─ Table\n" +
 12347  			"         │       │           ├─ name: movie_keyword\n" +
 12348  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 12349  			"         │       └─ Filter\n" +
 12350  			"         │           ├─ HashIn\n" +
 12351  			"         │           │   ├─ k.keyword:1!null\n" +
 12352  			"         │           │   └─ TUPLE(superhero (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext), magnet (longtext), web (longtext), claw (longtext), laser (longtext))\n" +
 12353  			"         │           └─ TableAlias(k)\n" +
 12354  			"         │               └─ ProcessTable\n" +
 12355  			"         │                   └─ Table\n" +
 12356  			"         │                       ├─ name: keyword\n" +
 12357  			"         │                       └─ columns: [id keyword]\n" +
 12358  			"         └─ InnerJoin\n" +
 12359  			"             ├─ Eq\n" +
 12360  			"             │   ├─ n.id:17!null\n" +
 12361  			"             │   └─ ci.person_id:19!null\n" +
 12362  			"             ├─ TableAlias(n)\n" +
 12363  			"             │   └─ ProcessTable\n" +
 12364  			"             │       └─ Table\n" +
 12365  			"             │           ├─ name: name\n" +
 12366  			"             │           └─ columns: [id name]\n" +
 12367  			"             └─ InnerJoin\n" +
 12368  			"                 ├─ Eq\n" +
 12369  			"                 │   ├─ chn.id:22!null\n" +
 12370  			"                 │   └─ ci.person_role_id:21\n" +
 12371  			"                 ├─ TableAlias(ci)\n" +
 12372  			"                 │   └─ ProcessTable\n" +
 12373  			"                 │       └─ Table\n" +
 12374  			"                 │           ├─ name: cast_info\n" +
 12375  			"                 │           └─ columns: [person_id movie_id person_role_id]\n" +
 12376  			"                 └─ Filter\n" +
 12377  			"                     ├─ AND\n" +
 12378  			"                     │   ├─ NOT\n" +
 12379  			"                     │   │   └─ chn.name:1!null IS NULL\n" +
 12380  			"                     │   └─ Or\n" +
 12381  			"                     │       ├─ chn.name LIKE '%man%'\n" +
 12382  			"                     │       └─ chn.name LIKE '%Man%'\n" +
 12383  			"                     └─ TableAlias(chn)\n" +
 12384  			"                         └─ ProcessTable\n" +
 12385  			"                             └─ Table\n" +
 12386  			"                                 ├─ name: char_name\n" +
 12387  			"                                 └─ columns: [id name]\n" +
 12388  			"",
 12389  		ExpectedEstimates: "Project\n" +
 12390  			" ├─ columns: [min(n.name) as cast_member, min(t.title) as complete_dynamic_hero_movie]\n" +
 12391  			" └─ GroupBy\n" +
 12392  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 12393  			"     ├─ Grouping()\n" +
 12394  			"     └─ InnerJoin\n" +
 12395  			"         ├─ (((ci.movie_id = cc.movie_id) AND (mk.movie_id = ci.movie_id)) AND (t.id = ci.movie_id))\n" +
 12396  			"         ├─ InnerJoin\n" +
 12397  			"         │   ├─ (t.id = mk.movie_id)\n" +
 12398  			"         │   ├─ InnerJoin\n" +
 12399  			"         │   │   ├─ (kt.id = t.kind_id)\n" +
 12400  			"         │   │   ├─ InnerJoin\n" +
 12401  			"         │   │   │   ├─ (t.id = cc.movie_id)\n" +
 12402  			"         │   │   │   ├─ Filter\n" +
 12403  			"         │   │   │   │   ├─ (t.production_year > 2000)\n" +
 12404  			"         │   │   │   │   └─ TableAlias(t)\n" +
 12405  			"         │   │   │   │       └─ Table\n" +
 12406  			"         │   │   │   │           ├─ name: title\n" +
 12407  			"         │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 12408  			"         │   │   │   └─ InnerJoin\n" +
 12409  			"         │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 12410  			"         │   │   │       ├─ Filter\n" +
 12411  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 12412  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 12413  			"         │   │   │       │       └─ Table\n" +
 12414  			"         │   │   │       │           ├─ name: comp_cast_type\n" +
 12415  			"         │   │   │       │           └─ columns: [id kind]\n" +
 12416  			"         │   │   │       └─ InnerJoin\n" +
 12417  			"         │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 12418  			"         │   │   │           ├─ Filter\n" +
 12419  			"         │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 12420  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 12421  			"         │   │   │           │       └─ Table\n" +
 12422  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 12423  			"         │   │   │           │           └─ columns: [id kind]\n" +
 12424  			"         │   │   │           └─ TableAlias(cc)\n" +
 12425  			"         │   │   │               └─ Table\n" +
 12426  			"         │   │   │                   ├─ name: complete_cast\n" +
 12427  			"         │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 12428  			"         │   │   └─ Filter\n" +
 12429  			"         │   │       ├─ (kt.kind = 'movie')\n" +
 12430  			"         │   │       └─ TableAlias(kt)\n" +
 12431  			"         │   │           └─ Table\n" +
 12432  			"         │   │               ├─ name: kind_type\n" +
 12433  			"         │   │               └─ columns: [id kind]\n" +
 12434  			"         │   └─ InnerJoin\n" +
 12435  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 12436  			"         │       ├─ TableAlias(mk)\n" +
 12437  			"         │       │   └─ Table\n" +
 12438  			"         │       │       ├─ name: movie_keyword\n" +
 12439  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 12440  			"         │       └─ Filter\n" +
 12441  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence', 'magnet', 'web', 'claw', 'laser'))\n" +
 12442  			"         │           └─ TableAlias(k)\n" +
 12443  			"         │               └─ Table\n" +
 12444  			"         │                   ├─ name: keyword\n" +
 12445  			"         │                   └─ columns: [id keyword]\n" +
 12446  			"         └─ InnerJoin\n" +
 12447  			"             ├─ (n.id = ci.person_id)\n" +
 12448  			"             ├─ TableAlias(n)\n" +
 12449  			"             │   └─ Table\n" +
 12450  			"             │       ├─ name: name\n" +
 12451  			"             │       └─ columns: [id name]\n" +
 12452  			"             └─ InnerJoin\n" +
 12453  			"                 ├─ (chn.id = ci.person_role_id)\n" +
 12454  			"                 ├─ TableAlias(ci)\n" +
 12455  			"                 │   └─ Table\n" +
 12456  			"                 │       ├─ name: cast_info\n" +
 12457  			"                 │       └─ columns: [person_id movie_id person_role_id]\n" +
 12458  			"                 └─ Filter\n" +
 12459  			"                     ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 12460  			"                     └─ TableAlias(chn)\n" +
 12461  			"                         └─ Table\n" +
 12462  			"                             ├─ name: char_name\n" +
 12463  			"                             └─ columns: [id name]\n" +
 12464  			"",
 12465  		ExpectedAnalysis: "Project\n" +
 12466  			" ├─ columns: [min(n.name) as cast_member, min(t.title) as complete_dynamic_hero_movie]\n" +
 12467  			" └─ GroupBy\n" +
 12468  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 12469  			"     ├─ Grouping()\n" +
 12470  			"     └─ InnerJoin\n" +
 12471  			"         ├─ (((ci.movie_id = cc.movie_id) AND (mk.movie_id = ci.movie_id)) AND (t.id = ci.movie_id))\n" +
 12472  			"         ├─ InnerJoin\n" +
 12473  			"         │   ├─ (t.id = mk.movie_id)\n" +
 12474  			"         │   ├─ InnerJoin\n" +
 12475  			"         │   │   ├─ (kt.id = t.kind_id)\n" +
 12476  			"         │   │   ├─ InnerJoin\n" +
 12477  			"         │   │   │   ├─ (t.id = cc.movie_id)\n" +
 12478  			"         │   │   │   ├─ Filter\n" +
 12479  			"         │   │   │   │   ├─ (t.production_year > 2000)\n" +
 12480  			"         │   │   │   │   └─ TableAlias(t)\n" +
 12481  			"         │   │   │   │       └─ Table\n" +
 12482  			"         │   │   │   │           ├─ name: title\n" +
 12483  			"         │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 12484  			"         │   │   │   └─ InnerJoin\n" +
 12485  			"         │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 12486  			"         │   │   │       ├─ Filter\n" +
 12487  			"         │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 12488  			"         │   │   │       │   └─ TableAlias(cct2)\n" +
 12489  			"         │   │   │       │       └─ Table\n" +
 12490  			"         │   │   │       │           ├─ name: comp_cast_type\n" +
 12491  			"         │   │   │       │           └─ columns: [id kind]\n" +
 12492  			"         │   │   │       └─ InnerJoin\n" +
 12493  			"         │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 12494  			"         │   │   │           ├─ Filter\n" +
 12495  			"         │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 12496  			"         │   │   │           │   └─ TableAlias(cct1)\n" +
 12497  			"         │   │   │           │       └─ Table\n" +
 12498  			"         │   │   │           │           ├─ name: comp_cast_type\n" +
 12499  			"         │   │   │           │           └─ columns: [id kind]\n" +
 12500  			"         │   │   │           └─ TableAlias(cc)\n" +
 12501  			"         │   │   │               └─ Table\n" +
 12502  			"         │   │   │                   ├─ name: complete_cast\n" +
 12503  			"         │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 12504  			"         │   │   └─ Filter\n" +
 12505  			"         │   │       ├─ (kt.kind = 'movie')\n" +
 12506  			"         │   │       └─ TableAlias(kt)\n" +
 12507  			"         │   │           └─ Table\n" +
 12508  			"         │   │               ├─ name: kind_type\n" +
 12509  			"         │   │               └─ columns: [id kind]\n" +
 12510  			"         │   └─ InnerJoin\n" +
 12511  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 12512  			"         │       ├─ TableAlias(mk)\n" +
 12513  			"         │       │   └─ Table\n" +
 12514  			"         │       │       ├─ name: movie_keyword\n" +
 12515  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 12516  			"         │       └─ Filter\n" +
 12517  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence', 'magnet', 'web', 'claw', 'laser'))\n" +
 12518  			"         │           └─ TableAlias(k)\n" +
 12519  			"         │               └─ Table\n" +
 12520  			"         │                   ├─ name: keyword\n" +
 12521  			"         │                   └─ columns: [id keyword]\n" +
 12522  			"         └─ InnerJoin\n" +
 12523  			"             ├─ (n.id = ci.person_id)\n" +
 12524  			"             ├─ TableAlias(n)\n" +
 12525  			"             │   └─ Table\n" +
 12526  			"             │       ├─ name: name\n" +
 12527  			"             │       └─ columns: [id name]\n" +
 12528  			"             └─ InnerJoin\n" +
 12529  			"                 ├─ (chn.id = ci.person_role_id)\n" +
 12530  			"                 ├─ TableAlias(ci)\n" +
 12531  			"                 │   └─ Table\n" +
 12532  			"                 │       ├─ name: cast_info\n" +
 12533  			"                 │       └─ columns: [person_id movie_id person_role_id]\n" +
 12534  			"                 └─ Filter\n" +
 12535  			"                     ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 12536  			"                     └─ TableAlias(chn)\n" +
 12537  			"                         └─ Table\n" +
 12538  			"                             ├─ name: char_name\n" +
 12539  			"                             └─ columns: [id name]\n" +
 12540  			"",
 12541  	},
 12542  	{
 12543  		Query: `
 12544  SELECT MIN(cn.name) AS company_name,
 12545         MIN(lt.link) AS link_type,
 12546         MIN(t.title) AS western_follow_up
 12547  FROM company_name AS cn,
 12548       company_type AS ct,
 12549       keyword AS k,
 12550       link_type AS lt,
 12551       movie_companies AS mc,
 12552       movie_info AS mi,
 12553       movie_keyword AS mk,
 12554       movie_link AS ml,
 12555       title AS t
 12556  WHERE cn.country_code !='[pl]'
 12557    AND (cn.name LIKE '%Film%'
 12558         OR cn.name LIKE '%Warner%')
 12559    AND ct.kind ='production companies'
 12560    AND k.keyword ='sequel'
 12561    AND lt.link LIKE '%follow%'
 12562    AND mc.note IS NULL
 12563    AND mi.info IN ('Sweden',
 12564                    'Norway',
 12565                    'Germany',
 12566                    'Denmark',
 12567                    'Swedish',
 12568                    'Denish',
 12569                    'Norwegian',
 12570                    'German')
 12571    AND t.production_year BETWEEN 1950 AND 2000
 12572    AND lt.id = ml.link_type_id
 12573    AND ml.movie_id = t.id
 12574    AND t.id = mk.movie_id
 12575    AND mk.keyword_id = k.id
 12576    AND t.id = mc.movie_id
 12577    AND mc.company_type_id = ct.id
 12578    AND mc.company_id = cn.id
 12579    AND mi.movie_id = t.id
 12580    AND ml.movie_id = mk.movie_id
 12581    AND ml.movie_id = mc.movie_id
 12582    AND mk.movie_id = mc.movie_id
 12583    AND ml.movie_id = mi.movie_id
 12584    AND mk.movie_id = mi.movie_id
 12585    AND mc.movie_id = mi.movie_id;
 12586  
 12587  `,
 12588  		ExpectedPlan: "Project\n" +
 12589  			" ├─ columns: [min(cn.name):0!null as company_name, min(lt.link):1!null as link_type, min(t.title):2!null as western_follow_up]\n" +
 12590  			" └─ GroupBy\n" +
 12591  			"     ├─ select: MIN(cn.name:8!null), MIN(lt.link:15!null), MIN(t.title:1!null)\n" +
 12592  			"     ├─ group: \n" +
 12593  			"     └─ InnerJoin\n" +
 12594  			"         ├─ AND\n" +
 12595  			"         │   ├─ AND\n" +
 12596  			"         │   │   ├─ AND\n" +
 12597  			"         │   │   │   ├─ AND\n" +
 12598  			"         │   │   │   │   ├─ AND\n" +
 12599  			"         │   │   │   │   │   ├─ Eq\n" +
 12600  			"         │   │   │   │   │   │   ├─ mc.movie_id:3!null\n" +
 12601  			"         │   │   │   │   │   │   └─ mi.movie_id:20!null\n" +
 12602  			"         │   │   │   │   │   └─ Eq\n" +
 12603  			"         │   │   │   │   │       ├─ mk.movie_id:16!null\n" +
 12604  			"         │   │   │   │   │       └─ mc.movie_id:3!null\n" +
 12605  			"         │   │   │   │   └─ Eq\n" +
 12606  			"         │   │   │   │       ├─ ml.movie_id:12!null\n" +
 12607  			"         │   │   │   │       └─ mc.movie_id:3!null\n" +
 12608  			"         │   │   │   └─ Eq\n" +
 12609  			"         │   │   │       ├─ ml.movie_id:12!null\n" +
 12610  			"         │   │   │       └─ t.id:0!null\n" +
 12611  			"         │   │   └─ Eq\n" +
 12612  			"         │   │       ├─ t.id:0!null\n" +
 12613  			"         │   │       └─ mk.movie_id:16!null\n" +
 12614  			"         │   └─ Eq\n" +
 12615  			"         │       ├─ mi.movie_id:20!null\n" +
 12616  			"         │       └─ t.id:0!null\n" +
 12617  			"         ├─ InnerJoin\n" +
 12618  			"         │   ├─ Eq\n" +
 12619  			"         │   │   ├─ t.id:0!null\n" +
 12620  			"         │   │   └─ mc.movie_id:3!null\n" +
 12621  			"         │   ├─ Filter\n" +
 12622  			"         │   │   ├─ AND\n" +
 12623  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
 12624  			"         │   │   │   │   ├─ t.production_year:2\n" +
 12625  			"         │   │   │   │   └─ 1950 (smallint)\n" +
 12626  			"         │   │   │   └─ LessThanOrEqual\n" +
 12627  			"         │   │   │       ├─ t.production_year:2\n" +
 12628  			"         │   │   │       └─ 2000 (smallint)\n" +
 12629  			"         │   │   └─ TableAlias(t)\n" +
 12630  			"         │   │       └─ ProcessTable\n" +
 12631  			"         │   │           └─ Table\n" +
 12632  			"         │   │               ├─ name: title\n" +
 12633  			"         │   │               └─ columns: [id title production_year]\n" +
 12634  			"         │   └─ InnerJoin\n" +
 12635  			"         │       ├─ Eq\n" +
 12636  			"         │       │   ├─ mc.company_type_id:5!null\n" +
 12637  			"         │       │   └─ ct.id:10!null\n" +
 12638  			"         │       ├─ InnerJoin\n" +
 12639  			"         │       │   ├─ Eq\n" +
 12640  			"         │       │   │   ├─ mc.company_id:4!null\n" +
 12641  			"         │       │   │   └─ cn.id:7!null\n" +
 12642  			"         │       │   ├─ Filter\n" +
 12643  			"         │       │   │   ├─ mc.note:3 IS NULL\n" +
 12644  			"         │       │   │   └─ TableAlias(mc)\n" +
 12645  			"         │       │   │       └─ ProcessTable\n" +
 12646  			"         │       │   │           └─ Table\n" +
 12647  			"         │       │   │               ├─ name: movie_companies\n" +
 12648  			"         │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 12649  			"         │       │   └─ Filter\n" +
 12650  			"         │       │       ├─ AND\n" +
 12651  			"         │       │       │   ├─ NOT\n" +
 12652  			"         │       │       │   │   └─ Eq\n" +
 12653  			"         │       │       │   │       ├─ cn.country_code:2\n" +
 12654  			"         │       │       │   │       └─ [pl] (longtext)\n" +
 12655  			"         │       │       │   └─ Or\n" +
 12656  			"         │       │       │       ├─ cn.name LIKE '%Film%'\n" +
 12657  			"         │       │       │       └─ cn.name LIKE '%Warner%'\n" +
 12658  			"         │       │       └─ TableAlias(cn)\n" +
 12659  			"         │       │           └─ ProcessTable\n" +
 12660  			"         │       │               └─ Table\n" +
 12661  			"         │       │                   ├─ name: company_name\n" +
 12662  			"         │       │                   └─ columns: [id name country_code]\n" +
 12663  			"         │       └─ Filter\n" +
 12664  			"         │           ├─ Eq\n" +
 12665  			"         │           │   ├─ ct.kind:1!null\n" +
 12666  			"         │           │   └─ production companies (longtext)\n" +
 12667  			"         │           └─ TableAlias(ct)\n" +
 12668  			"         │               └─ ProcessTable\n" +
 12669  			"         │                   └─ Table\n" +
 12670  			"         │                       ├─ name: company_type\n" +
 12671  			"         │                       └─ columns: [id kind]\n" +
 12672  			"         └─ LookupJoin\n" +
 12673  			"             ├─ InnerJoin\n" +
 12674  			"             │   ├─ Eq\n" +
 12675  			"             │   │   ├─ ml.movie_id:12!null\n" +
 12676  			"             │   │   └─ mk.movie_id:16!null\n" +
 12677  			"             │   ├─ InnerJoin\n" +
 12678  			"             │   │   ├─ Eq\n" +
 12679  			"             │   │   │   ├─ lt.id:14!null\n" +
 12680  			"             │   │   │   └─ ml.link_type_id:13!null\n" +
 12681  			"             │   │   ├─ TableAlias(ml)\n" +
 12682  			"             │   │   │   └─ ProcessTable\n" +
 12683  			"             │   │   │       └─ Table\n" +
 12684  			"             │   │   │           ├─ name: movie_link\n" +
 12685  			"             │   │   │           └─ columns: [movie_id link_type_id]\n" +
 12686  			"             │   │   └─ Filter\n" +
 12687  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 12688  			"             │   │       └─ TableAlias(lt)\n" +
 12689  			"             │   │           └─ ProcessTable\n" +
 12690  			"             │   │               └─ Table\n" +
 12691  			"             │   │                   ├─ name: link_type\n" +
 12692  			"             │   │                   └─ columns: [id link]\n" +
 12693  			"             │   └─ InnerJoin\n" +
 12694  			"             │       ├─ Eq\n" +
 12695  			"             │       │   ├─ mk.keyword_id:17!null\n" +
 12696  			"             │       │   └─ k.id:18!null\n" +
 12697  			"             │       ├─ TableAlias(mk)\n" +
 12698  			"             │       │   └─ ProcessTable\n" +
 12699  			"             │       │       └─ Table\n" +
 12700  			"             │       │           ├─ name: movie_keyword\n" +
 12701  			"             │       │           └─ columns: [movie_id keyword_id]\n" +
 12702  			"             │       └─ Filter\n" +
 12703  			"             │           ├─ Eq\n" +
 12704  			"             │           │   ├─ k.keyword:1!null\n" +
 12705  			"             │           │   └─ sequel (longtext)\n" +
 12706  			"             │           └─ TableAlias(k)\n" +
 12707  			"             │               └─ ProcessTable\n" +
 12708  			"             │                   └─ Table\n" +
 12709  			"             │                       ├─ name: keyword\n" +
 12710  			"             │                       └─ columns: [id keyword]\n" +
 12711  			"             └─ Filter\n" +
 12712  			"                 ├─ HashIn\n" +
 12713  			"                 │   ├─ mi.info:1!null\n" +
 12714  			"                 │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext))\n" +
 12715  			"                 └─ TableAlias(mi)\n" +
 12716  			"                     └─ IndexedTableAccess(movie_info)\n" +
 12717  			"                         ├─ index: [movie_info.movie_id]\n" +
 12718  			"                         ├─ keys: [mk.movie_id:16!null]\n" +
 12719  			"                         ├─ colSet: (20-24)\n" +
 12720  			"                         ├─ tableId: 6\n" +
 12721  			"                         └─ Table\n" +
 12722  			"                             ├─ name: movie_info\n" +
 12723  			"                             └─ columns: [movie_id info]\n" +
 12724  			"",
 12725  		ExpectedEstimates: "Project\n" +
 12726  			" ├─ columns: [min(cn.name) as company_name, min(lt.link) as link_type, min(t.title) as western_follow_up]\n" +
 12727  			" └─ GroupBy\n" +
 12728  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 12729  			"     ├─ Grouping()\n" +
 12730  			"     └─ InnerJoin\n" +
 12731  			"         ├─ ((((((mc.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (ml.movie_id = mc.movie_id)) AND (ml.movie_id = t.id)) AND (t.id = mk.movie_id)) AND (mi.movie_id = t.id))\n" +
 12732  			"         ├─ InnerJoin\n" +
 12733  			"         │   ├─ (t.id = mc.movie_id)\n" +
 12734  			"         │   ├─ Filter\n" +
 12735  			"         │   │   ├─ ((t.production_year >= 1950) AND (t.production_year <= 2000))\n" +
 12736  			"         │   │   └─ TableAlias(t)\n" +
 12737  			"         │   │       └─ Table\n" +
 12738  			"         │   │           ├─ name: title\n" +
 12739  			"         │   │           └─ columns: [id title production_year]\n" +
 12740  			"         │   └─ InnerJoin\n" +
 12741  			"         │       ├─ (mc.company_type_id = ct.id)\n" +
 12742  			"         │       ├─ InnerJoin\n" +
 12743  			"         │       │   ├─ (mc.company_id = cn.id)\n" +
 12744  			"         │       │   ├─ Filter\n" +
 12745  			"         │       │   │   ├─ mc.note IS NULL\n" +
 12746  			"         │       │   │   └─ TableAlias(mc)\n" +
 12747  			"         │       │   │       └─ Table\n" +
 12748  			"         │       │   │           ├─ name: movie_companies\n" +
 12749  			"         │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 12750  			"         │       │   └─ Filter\n" +
 12751  			"         │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 12752  			"         │       │       └─ TableAlias(cn)\n" +
 12753  			"         │       │           └─ Table\n" +
 12754  			"         │       │               ├─ name: company_name\n" +
 12755  			"         │       │               └─ columns: [id name country_code]\n" +
 12756  			"         │       └─ Filter\n" +
 12757  			"         │           ├─ (ct.kind = 'production companies')\n" +
 12758  			"         │           └─ TableAlias(ct)\n" +
 12759  			"         │               └─ Table\n" +
 12760  			"         │                   ├─ name: company_type\n" +
 12761  			"         │                   └─ columns: [id kind]\n" +
 12762  			"         └─ LookupJoin\n" +
 12763  			"             ├─ InnerJoin\n" +
 12764  			"             │   ├─ (ml.movie_id = mk.movie_id)\n" +
 12765  			"             │   ├─ InnerJoin\n" +
 12766  			"             │   │   ├─ (lt.id = ml.link_type_id)\n" +
 12767  			"             │   │   ├─ TableAlias(ml)\n" +
 12768  			"             │   │   │   └─ Table\n" +
 12769  			"             │   │   │       ├─ name: movie_link\n" +
 12770  			"             │   │   │       └─ columns: [movie_id link_type_id]\n" +
 12771  			"             │   │   └─ Filter\n" +
 12772  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 12773  			"             │   │       └─ TableAlias(lt)\n" +
 12774  			"             │   │           └─ Table\n" +
 12775  			"             │   │               ├─ name: link_type\n" +
 12776  			"             │   │               └─ columns: [id link]\n" +
 12777  			"             │   └─ InnerJoin\n" +
 12778  			"             │       ├─ (mk.keyword_id = k.id)\n" +
 12779  			"             │       ├─ TableAlias(mk)\n" +
 12780  			"             │       │   └─ Table\n" +
 12781  			"             │       │       ├─ name: movie_keyword\n" +
 12782  			"             │       │       └─ columns: [movie_id keyword_id]\n" +
 12783  			"             │       └─ Filter\n" +
 12784  			"             │           ├─ (k.keyword = 'sequel')\n" +
 12785  			"             │           └─ TableAlias(k)\n" +
 12786  			"             │               └─ Table\n" +
 12787  			"             │                   ├─ name: keyword\n" +
 12788  			"             │                   └─ columns: [id keyword]\n" +
 12789  			"             └─ Filter\n" +
 12790  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German'))\n" +
 12791  			"                 └─ TableAlias(mi)\n" +
 12792  			"                     └─ IndexedTableAccess(movie_info)\n" +
 12793  			"                         ├─ index: [movie_info.movie_id]\n" +
 12794  			"                         ├─ columns: [movie_id info]\n" +
 12795  			"                         └─ keys: mk.movie_id\n" +
 12796  			"",
 12797  		ExpectedAnalysis: "Project\n" +
 12798  			" ├─ columns: [min(cn.name) as company_name, min(lt.link) as link_type, min(t.title) as western_follow_up]\n" +
 12799  			" └─ GroupBy\n" +
 12800  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 12801  			"     ├─ Grouping()\n" +
 12802  			"     └─ InnerJoin\n" +
 12803  			"         ├─ ((((((mc.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (ml.movie_id = mc.movie_id)) AND (ml.movie_id = t.id)) AND (t.id = mk.movie_id)) AND (mi.movie_id = t.id))\n" +
 12804  			"         ├─ InnerJoin\n" +
 12805  			"         │   ├─ (t.id = mc.movie_id)\n" +
 12806  			"         │   ├─ Filter\n" +
 12807  			"         │   │   ├─ ((t.production_year >= 1950) AND (t.production_year <= 2000))\n" +
 12808  			"         │   │   └─ TableAlias(t)\n" +
 12809  			"         │   │       └─ Table\n" +
 12810  			"         │   │           ├─ name: title\n" +
 12811  			"         │   │           └─ columns: [id title production_year]\n" +
 12812  			"         │   └─ InnerJoin\n" +
 12813  			"         │       ├─ (mc.company_type_id = ct.id)\n" +
 12814  			"         │       ├─ InnerJoin\n" +
 12815  			"         │       │   ├─ (mc.company_id = cn.id)\n" +
 12816  			"         │       │   ├─ Filter\n" +
 12817  			"         │       │   │   ├─ mc.note IS NULL\n" +
 12818  			"         │       │   │   └─ TableAlias(mc)\n" +
 12819  			"         │       │   │       └─ Table\n" +
 12820  			"         │       │   │           ├─ name: movie_companies\n" +
 12821  			"         │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 12822  			"         │       │   └─ Filter\n" +
 12823  			"         │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 12824  			"         │       │       └─ TableAlias(cn)\n" +
 12825  			"         │       │           └─ Table\n" +
 12826  			"         │       │               ├─ name: company_name\n" +
 12827  			"         │       │               └─ columns: [id name country_code]\n" +
 12828  			"         │       └─ Filter\n" +
 12829  			"         │           ├─ (ct.kind = 'production companies')\n" +
 12830  			"         │           └─ TableAlias(ct)\n" +
 12831  			"         │               └─ Table\n" +
 12832  			"         │                   ├─ name: company_type\n" +
 12833  			"         │                   └─ columns: [id kind]\n" +
 12834  			"         └─ LookupJoin\n" +
 12835  			"             ├─ InnerJoin\n" +
 12836  			"             │   ├─ (ml.movie_id = mk.movie_id)\n" +
 12837  			"             │   ├─ InnerJoin\n" +
 12838  			"             │   │   ├─ (lt.id = ml.link_type_id)\n" +
 12839  			"             │   │   ├─ TableAlias(ml)\n" +
 12840  			"             │   │   │   └─ Table\n" +
 12841  			"             │   │   │       ├─ name: movie_link\n" +
 12842  			"             │   │   │       └─ columns: [movie_id link_type_id]\n" +
 12843  			"             │   │   └─ Filter\n" +
 12844  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 12845  			"             │   │       └─ TableAlias(lt)\n" +
 12846  			"             │   │           └─ Table\n" +
 12847  			"             │   │               ├─ name: link_type\n" +
 12848  			"             │   │               └─ columns: [id link]\n" +
 12849  			"             │   └─ InnerJoin\n" +
 12850  			"             │       ├─ (mk.keyword_id = k.id)\n" +
 12851  			"             │       ├─ TableAlias(mk)\n" +
 12852  			"             │       │   └─ Table\n" +
 12853  			"             │       │       ├─ name: movie_keyword\n" +
 12854  			"             │       │       └─ columns: [movie_id keyword_id]\n" +
 12855  			"             │       └─ Filter\n" +
 12856  			"             │           ├─ (k.keyword = 'sequel')\n" +
 12857  			"             │           └─ TableAlias(k)\n" +
 12858  			"             │               └─ Table\n" +
 12859  			"             │                   ├─ name: keyword\n" +
 12860  			"             │                   └─ columns: [id keyword]\n" +
 12861  			"             └─ Filter\n" +
 12862  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German'))\n" +
 12863  			"                 └─ TableAlias(mi)\n" +
 12864  			"                     └─ IndexedTableAccess(movie_info)\n" +
 12865  			"                         ├─ index: [movie_info.movie_id]\n" +
 12866  			"                         ├─ columns: [movie_id info]\n" +
 12867  			"                         └─ keys: mk.movie_id\n" +
 12868  			"",
 12869  	},
 12870  	{
 12871  		Query: `
 12872  SELECT MIN(cn.name) AS company_name,
 12873         MIN(lt.link) AS link_type,
 12874         MIN(t.title) AS german_follow_up
 12875  FROM company_name AS cn,
 12876       company_type AS ct,
 12877       keyword AS k,
 12878       link_type AS lt,
 12879       movie_companies AS mc,
 12880       movie_info AS mi,
 12881       movie_keyword AS mk,
 12882       movie_link AS ml,
 12883       title AS t
 12884  WHERE cn.country_code !='[pl]'
 12885    AND (cn.name LIKE '%Film%'
 12886         OR cn.name LIKE '%Warner%')
 12887    AND ct.kind ='production companies'
 12888    AND k.keyword ='sequel'
 12889    AND lt.link LIKE '%follow%'
 12890    AND mc.note IS NULL
 12891    AND mi.info IN ('Germany',
 12892                    'German')
 12893    AND t.production_year BETWEEN 2000 AND 2010
 12894    AND lt.id = ml.link_type_id
 12895    AND ml.movie_id = t.id
 12896    AND t.id = mk.movie_id
 12897    AND mk.keyword_id = k.id
 12898    AND t.id = mc.movie_id
 12899    AND mc.company_type_id = ct.id
 12900    AND mc.company_id = cn.id
 12901    AND mi.movie_id = t.id
 12902    AND ml.movie_id = mk.movie_id
 12903    AND ml.movie_id = mc.movie_id
 12904    AND mk.movie_id = mc.movie_id
 12905    AND ml.movie_id = mi.movie_id
 12906    AND mk.movie_id = mi.movie_id
 12907    AND mc.movie_id = mi.movie_id;
 12908  
 12909  `,
 12910  		ExpectedPlan: "Project\n" +
 12911  			" ├─ columns: [min(cn.name):0!null as company_name, min(lt.link):1!null as link_type, min(t.title):2!null as german_follow_up]\n" +
 12912  			" └─ GroupBy\n" +
 12913  			"     ├─ select: MIN(cn.name:8!null), MIN(lt.link:15!null), MIN(t.title:1!null)\n" +
 12914  			"     ├─ group: \n" +
 12915  			"     └─ InnerJoin\n" +
 12916  			"         ├─ AND\n" +
 12917  			"         │   ├─ AND\n" +
 12918  			"         │   │   ├─ AND\n" +
 12919  			"         │   │   │   ├─ AND\n" +
 12920  			"         │   │   │   │   ├─ AND\n" +
 12921  			"         │   │   │   │   │   ├─ Eq\n" +
 12922  			"         │   │   │   │   │   │   ├─ mc.movie_id:3!null\n" +
 12923  			"         │   │   │   │   │   │   └─ mi.movie_id:20!null\n" +
 12924  			"         │   │   │   │   │   └─ Eq\n" +
 12925  			"         │   │   │   │   │       ├─ mk.movie_id:16!null\n" +
 12926  			"         │   │   │   │   │       └─ mc.movie_id:3!null\n" +
 12927  			"         │   │   │   │   └─ Eq\n" +
 12928  			"         │   │   │   │       ├─ ml.movie_id:12!null\n" +
 12929  			"         │   │   │   │       └─ mc.movie_id:3!null\n" +
 12930  			"         │   │   │   └─ Eq\n" +
 12931  			"         │   │   │       ├─ ml.movie_id:12!null\n" +
 12932  			"         │   │   │       └─ t.id:0!null\n" +
 12933  			"         │   │   └─ Eq\n" +
 12934  			"         │   │       ├─ t.id:0!null\n" +
 12935  			"         │   │       └─ mk.movie_id:16!null\n" +
 12936  			"         │   └─ Eq\n" +
 12937  			"         │       ├─ mi.movie_id:20!null\n" +
 12938  			"         │       └─ t.id:0!null\n" +
 12939  			"         ├─ InnerJoin\n" +
 12940  			"         │   ├─ Eq\n" +
 12941  			"         │   │   ├─ t.id:0!null\n" +
 12942  			"         │   │   └─ mc.movie_id:3!null\n" +
 12943  			"         │   ├─ Filter\n" +
 12944  			"         │   │   ├─ AND\n" +
 12945  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
 12946  			"         │   │   │   │   ├─ t.production_year:2\n" +
 12947  			"         │   │   │   │   └─ 2000 (smallint)\n" +
 12948  			"         │   │   │   └─ LessThanOrEqual\n" +
 12949  			"         │   │   │       ├─ t.production_year:2\n" +
 12950  			"         │   │   │       └─ 2010 (smallint)\n" +
 12951  			"         │   │   └─ TableAlias(t)\n" +
 12952  			"         │   │       └─ ProcessTable\n" +
 12953  			"         │   │           └─ Table\n" +
 12954  			"         │   │               ├─ name: title\n" +
 12955  			"         │   │               └─ columns: [id title production_year]\n" +
 12956  			"         │   └─ InnerJoin\n" +
 12957  			"         │       ├─ Eq\n" +
 12958  			"         │       │   ├─ mc.company_type_id:5!null\n" +
 12959  			"         │       │   └─ ct.id:10!null\n" +
 12960  			"         │       ├─ InnerJoin\n" +
 12961  			"         │       │   ├─ Eq\n" +
 12962  			"         │       │   │   ├─ mc.company_id:4!null\n" +
 12963  			"         │       │   │   └─ cn.id:7!null\n" +
 12964  			"         │       │   ├─ Filter\n" +
 12965  			"         │       │   │   ├─ mc.note:3 IS NULL\n" +
 12966  			"         │       │   │   └─ TableAlias(mc)\n" +
 12967  			"         │       │   │       └─ ProcessTable\n" +
 12968  			"         │       │   │           └─ Table\n" +
 12969  			"         │       │   │               ├─ name: movie_companies\n" +
 12970  			"         │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 12971  			"         │       │   └─ Filter\n" +
 12972  			"         │       │       ├─ AND\n" +
 12973  			"         │       │       │   ├─ NOT\n" +
 12974  			"         │       │       │   │   └─ Eq\n" +
 12975  			"         │       │       │   │       ├─ cn.country_code:2\n" +
 12976  			"         │       │       │   │       └─ [pl] (longtext)\n" +
 12977  			"         │       │       │   └─ Or\n" +
 12978  			"         │       │       │       ├─ cn.name LIKE '%Film%'\n" +
 12979  			"         │       │       │       └─ cn.name LIKE '%Warner%'\n" +
 12980  			"         │       │       └─ TableAlias(cn)\n" +
 12981  			"         │       │           └─ ProcessTable\n" +
 12982  			"         │       │               └─ Table\n" +
 12983  			"         │       │                   ├─ name: company_name\n" +
 12984  			"         │       │                   └─ columns: [id name country_code]\n" +
 12985  			"         │       └─ Filter\n" +
 12986  			"         │           ├─ Eq\n" +
 12987  			"         │           │   ├─ ct.kind:1!null\n" +
 12988  			"         │           │   └─ production companies (longtext)\n" +
 12989  			"         │           └─ TableAlias(ct)\n" +
 12990  			"         │               └─ ProcessTable\n" +
 12991  			"         │                   └─ Table\n" +
 12992  			"         │                       ├─ name: company_type\n" +
 12993  			"         │                       └─ columns: [id kind]\n" +
 12994  			"         └─ LookupJoin\n" +
 12995  			"             ├─ InnerJoin\n" +
 12996  			"             │   ├─ Eq\n" +
 12997  			"             │   │   ├─ ml.movie_id:12!null\n" +
 12998  			"             │   │   └─ mk.movie_id:16!null\n" +
 12999  			"             │   ├─ InnerJoin\n" +
 13000  			"             │   │   ├─ Eq\n" +
 13001  			"             │   │   │   ├─ lt.id:14!null\n" +
 13002  			"             │   │   │   └─ ml.link_type_id:13!null\n" +
 13003  			"             │   │   ├─ TableAlias(ml)\n" +
 13004  			"             │   │   │   └─ ProcessTable\n" +
 13005  			"             │   │   │       └─ Table\n" +
 13006  			"             │   │   │           ├─ name: movie_link\n" +
 13007  			"             │   │   │           └─ columns: [movie_id link_type_id]\n" +
 13008  			"             │   │   └─ Filter\n" +
 13009  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 13010  			"             │   │       └─ TableAlias(lt)\n" +
 13011  			"             │   │           └─ ProcessTable\n" +
 13012  			"             │   │               └─ Table\n" +
 13013  			"             │   │                   ├─ name: link_type\n" +
 13014  			"             │   │                   └─ columns: [id link]\n" +
 13015  			"             │   └─ InnerJoin\n" +
 13016  			"             │       ├─ Eq\n" +
 13017  			"             │       │   ├─ mk.keyword_id:17!null\n" +
 13018  			"             │       │   └─ k.id:18!null\n" +
 13019  			"             │       ├─ TableAlias(mk)\n" +
 13020  			"             │       │   └─ ProcessTable\n" +
 13021  			"             │       │       └─ Table\n" +
 13022  			"             │       │           ├─ name: movie_keyword\n" +
 13023  			"             │       │           └─ columns: [movie_id keyword_id]\n" +
 13024  			"             │       └─ Filter\n" +
 13025  			"             │           ├─ Eq\n" +
 13026  			"             │           │   ├─ k.keyword:1!null\n" +
 13027  			"             │           │   └─ sequel (longtext)\n" +
 13028  			"             │           └─ TableAlias(k)\n" +
 13029  			"             │               └─ ProcessTable\n" +
 13030  			"             │                   └─ Table\n" +
 13031  			"             │                       ├─ name: keyword\n" +
 13032  			"             │                       └─ columns: [id keyword]\n" +
 13033  			"             └─ Filter\n" +
 13034  			"                 ├─ HashIn\n" +
 13035  			"                 │   ├─ mi.info:1!null\n" +
 13036  			"                 │   └─ TUPLE(Germany (longtext), German (longtext))\n" +
 13037  			"                 └─ TableAlias(mi)\n" +
 13038  			"                     └─ IndexedTableAccess(movie_info)\n" +
 13039  			"                         ├─ index: [movie_info.movie_id]\n" +
 13040  			"                         ├─ keys: [mk.movie_id:16!null]\n" +
 13041  			"                         ├─ colSet: (20-24)\n" +
 13042  			"                         ├─ tableId: 6\n" +
 13043  			"                         └─ Table\n" +
 13044  			"                             ├─ name: movie_info\n" +
 13045  			"                             └─ columns: [movie_id info]\n" +
 13046  			"",
 13047  		ExpectedEstimates: "Project\n" +
 13048  			" ├─ columns: [min(cn.name) as company_name, min(lt.link) as link_type, min(t.title) as german_follow_up]\n" +
 13049  			" └─ GroupBy\n" +
 13050  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 13051  			"     ├─ Grouping()\n" +
 13052  			"     └─ InnerJoin\n" +
 13053  			"         ├─ ((((((mc.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (ml.movie_id = mc.movie_id)) AND (ml.movie_id = t.id)) AND (t.id = mk.movie_id)) AND (mi.movie_id = t.id))\n" +
 13054  			"         ├─ InnerJoin\n" +
 13055  			"         │   ├─ (t.id = mc.movie_id)\n" +
 13056  			"         │   ├─ Filter\n" +
 13057  			"         │   │   ├─ ((t.production_year >= 2000) AND (t.production_year <= 2010))\n" +
 13058  			"         │   │   └─ TableAlias(t)\n" +
 13059  			"         │   │       └─ Table\n" +
 13060  			"         │   │           ├─ name: title\n" +
 13061  			"         │   │           └─ columns: [id title production_year]\n" +
 13062  			"         │   └─ InnerJoin\n" +
 13063  			"         │       ├─ (mc.company_type_id = ct.id)\n" +
 13064  			"         │       ├─ InnerJoin\n" +
 13065  			"         │       │   ├─ (mc.company_id = cn.id)\n" +
 13066  			"         │       │   ├─ Filter\n" +
 13067  			"         │       │   │   ├─ mc.note IS NULL\n" +
 13068  			"         │       │   │   └─ TableAlias(mc)\n" +
 13069  			"         │       │   │       └─ Table\n" +
 13070  			"         │       │   │           ├─ name: movie_companies\n" +
 13071  			"         │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 13072  			"         │       │   └─ Filter\n" +
 13073  			"         │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 13074  			"         │       │       └─ TableAlias(cn)\n" +
 13075  			"         │       │           └─ Table\n" +
 13076  			"         │       │               ├─ name: company_name\n" +
 13077  			"         │       │               └─ columns: [id name country_code]\n" +
 13078  			"         │       └─ Filter\n" +
 13079  			"         │           ├─ (ct.kind = 'production companies')\n" +
 13080  			"         │           └─ TableAlias(ct)\n" +
 13081  			"         │               └─ Table\n" +
 13082  			"         │                   ├─ name: company_type\n" +
 13083  			"         │                   └─ columns: [id kind]\n" +
 13084  			"         └─ LookupJoin\n" +
 13085  			"             ├─ InnerJoin\n" +
 13086  			"             │   ├─ (ml.movie_id = mk.movie_id)\n" +
 13087  			"             │   ├─ InnerJoin\n" +
 13088  			"             │   │   ├─ (lt.id = ml.link_type_id)\n" +
 13089  			"             │   │   ├─ TableAlias(ml)\n" +
 13090  			"             │   │   │   └─ Table\n" +
 13091  			"             │   │   │       ├─ name: movie_link\n" +
 13092  			"             │   │   │       └─ columns: [movie_id link_type_id]\n" +
 13093  			"             │   │   └─ Filter\n" +
 13094  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 13095  			"             │   │       └─ TableAlias(lt)\n" +
 13096  			"             │   │           └─ Table\n" +
 13097  			"             │   │               ├─ name: link_type\n" +
 13098  			"             │   │               └─ columns: [id link]\n" +
 13099  			"             │   └─ InnerJoin\n" +
 13100  			"             │       ├─ (mk.keyword_id = k.id)\n" +
 13101  			"             │       ├─ TableAlias(mk)\n" +
 13102  			"             │       │   └─ Table\n" +
 13103  			"             │       │       ├─ name: movie_keyword\n" +
 13104  			"             │       │       └─ columns: [movie_id keyword_id]\n" +
 13105  			"             │       └─ Filter\n" +
 13106  			"             │           ├─ (k.keyword = 'sequel')\n" +
 13107  			"             │           └─ TableAlias(k)\n" +
 13108  			"             │               └─ Table\n" +
 13109  			"             │                   ├─ name: keyword\n" +
 13110  			"             │                   └─ columns: [id keyword]\n" +
 13111  			"             └─ Filter\n" +
 13112  			"                 ├─ (mi.info HASH IN ('Germany', 'German'))\n" +
 13113  			"                 └─ TableAlias(mi)\n" +
 13114  			"                     └─ IndexedTableAccess(movie_info)\n" +
 13115  			"                         ├─ index: [movie_info.movie_id]\n" +
 13116  			"                         ├─ columns: [movie_id info]\n" +
 13117  			"                         └─ keys: mk.movie_id\n" +
 13118  			"",
 13119  		ExpectedAnalysis: "Project\n" +
 13120  			" ├─ columns: [min(cn.name) as company_name, min(lt.link) as link_type, min(t.title) as german_follow_up]\n" +
 13121  			" └─ GroupBy\n" +
 13122  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 13123  			"     ├─ Grouping()\n" +
 13124  			"     └─ InnerJoin\n" +
 13125  			"         ├─ ((((((mc.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (ml.movie_id = mc.movie_id)) AND (ml.movie_id = t.id)) AND (t.id = mk.movie_id)) AND (mi.movie_id = t.id))\n" +
 13126  			"         ├─ InnerJoin\n" +
 13127  			"         │   ├─ (t.id = mc.movie_id)\n" +
 13128  			"         │   ├─ Filter\n" +
 13129  			"         │   │   ├─ ((t.production_year >= 2000) AND (t.production_year <= 2010))\n" +
 13130  			"         │   │   └─ TableAlias(t)\n" +
 13131  			"         │   │       └─ Table\n" +
 13132  			"         │   │           ├─ name: title\n" +
 13133  			"         │   │           └─ columns: [id title production_year]\n" +
 13134  			"         │   └─ InnerJoin\n" +
 13135  			"         │       ├─ (mc.company_type_id = ct.id)\n" +
 13136  			"         │       ├─ InnerJoin\n" +
 13137  			"         │       │   ├─ (mc.company_id = cn.id)\n" +
 13138  			"         │       │   ├─ Filter\n" +
 13139  			"         │       │   │   ├─ mc.note IS NULL\n" +
 13140  			"         │       │   │   └─ TableAlias(mc)\n" +
 13141  			"         │       │   │       └─ Table\n" +
 13142  			"         │       │   │           ├─ name: movie_companies\n" +
 13143  			"         │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 13144  			"         │       │   └─ Filter\n" +
 13145  			"         │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 13146  			"         │       │       └─ TableAlias(cn)\n" +
 13147  			"         │       │           └─ Table\n" +
 13148  			"         │       │               ├─ name: company_name\n" +
 13149  			"         │       │               └─ columns: [id name country_code]\n" +
 13150  			"         │       └─ Filter\n" +
 13151  			"         │           ├─ (ct.kind = 'production companies')\n" +
 13152  			"         │           └─ TableAlias(ct)\n" +
 13153  			"         │               └─ Table\n" +
 13154  			"         │                   ├─ name: company_type\n" +
 13155  			"         │                   └─ columns: [id kind]\n" +
 13156  			"         └─ LookupJoin\n" +
 13157  			"             ├─ InnerJoin\n" +
 13158  			"             │   ├─ (ml.movie_id = mk.movie_id)\n" +
 13159  			"             │   ├─ InnerJoin\n" +
 13160  			"             │   │   ├─ (lt.id = ml.link_type_id)\n" +
 13161  			"             │   │   ├─ TableAlias(ml)\n" +
 13162  			"             │   │   │   └─ Table\n" +
 13163  			"             │   │   │       ├─ name: movie_link\n" +
 13164  			"             │   │   │       └─ columns: [movie_id link_type_id]\n" +
 13165  			"             │   │   └─ Filter\n" +
 13166  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 13167  			"             │   │       └─ TableAlias(lt)\n" +
 13168  			"             │   │           └─ Table\n" +
 13169  			"             │   │               ├─ name: link_type\n" +
 13170  			"             │   │               └─ columns: [id link]\n" +
 13171  			"             │   └─ InnerJoin\n" +
 13172  			"             │       ├─ (mk.keyword_id = k.id)\n" +
 13173  			"             │       ├─ TableAlias(mk)\n" +
 13174  			"             │       │   └─ Table\n" +
 13175  			"             │       │       ├─ name: movie_keyword\n" +
 13176  			"             │       │       └─ columns: [movie_id keyword_id]\n" +
 13177  			"             │       └─ Filter\n" +
 13178  			"             │           ├─ (k.keyword = 'sequel')\n" +
 13179  			"             │           └─ TableAlias(k)\n" +
 13180  			"             │               └─ Table\n" +
 13181  			"             │                   ├─ name: keyword\n" +
 13182  			"             │                   └─ columns: [id keyword]\n" +
 13183  			"             └─ Filter\n" +
 13184  			"                 ├─ (mi.info HASH IN ('Germany', 'German'))\n" +
 13185  			"                 └─ TableAlias(mi)\n" +
 13186  			"                     └─ IndexedTableAccess(movie_info)\n" +
 13187  			"                         ├─ index: [movie_info.movie_id]\n" +
 13188  			"                         ├─ columns: [movie_id info]\n" +
 13189  			"                         └─ keys: mk.movie_id\n" +
 13190  			"",
 13191  	},
 13192  	{
 13193  		Query: `
 13194  SELECT MIN(cn.name) AS company_name,
 13195         MIN(lt.link) AS link_type,
 13196         MIN(t.title) AS western_follow_up
 13197  FROM company_name AS cn,
 13198       company_type AS ct,
 13199       keyword AS k,
 13200       link_type AS lt,
 13201       movie_companies AS mc,
 13202       movie_info AS mi,
 13203       movie_keyword AS mk,
 13204       movie_link AS ml,
 13205       title AS t
 13206  WHERE cn.country_code !='[pl]'
 13207    AND (cn.name LIKE '%Film%'
 13208         OR cn.name LIKE '%Warner%')
 13209    AND ct.kind ='production companies'
 13210    AND k.keyword ='sequel'
 13211    AND lt.link LIKE '%follow%'
 13212    AND mc.note IS NULL
 13213    AND mi.info IN ('Sweden',
 13214                    'Norway',
 13215                    'Germany',
 13216                    'Denmark',
 13217                    'Swedish',
 13218                    'Denish',
 13219                    'Norwegian',
 13220                    'German',
 13221                    'English')
 13222    AND t.production_year BETWEEN 1950 AND 2010
 13223    AND lt.id = ml.link_type_id
 13224    AND ml.movie_id = t.id
 13225    AND t.id = mk.movie_id
 13226    AND mk.keyword_id = k.id
 13227    AND t.id = mc.movie_id
 13228    AND mc.company_type_id = ct.id
 13229    AND mc.company_id = cn.id
 13230    AND mi.movie_id = t.id
 13231    AND ml.movie_id = mk.movie_id
 13232    AND ml.movie_id = mc.movie_id
 13233    AND mk.movie_id = mc.movie_id
 13234    AND ml.movie_id = mi.movie_id
 13235    AND mk.movie_id = mi.movie_id
 13236    AND mc.movie_id = mi.movie_id;
 13237  
 13238  `,
 13239  		ExpectedPlan: "Project\n" +
 13240  			" ├─ columns: [min(cn.name):0!null as company_name, min(lt.link):1!null as link_type, min(t.title):2!null as western_follow_up]\n" +
 13241  			" └─ GroupBy\n" +
 13242  			"     ├─ select: MIN(cn.name:8!null), MIN(lt.link:15!null), MIN(t.title:1!null)\n" +
 13243  			"     ├─ group: \n" +
 13244  			"     └─ InnerJoin\n" +
 13245  			"         ├─ AND\n" +
 13246  			"         │   ├─ AND\n" +
 13247  			"         │   │   ├─ AND\n" +
 13248  			"         │   │   │   ├─ AND\n" +
 13249  			"         │   │   │   │   ├─ AND\n" +
 13250  			"         │   │   │   │   │   ├─ Eq\n" +
 13251  			"         │   │   │   │   │   │   ├─ mc.movie_id:3!null\n" +
 13252  			"         │   │   │   │   │   │   └─ mi.movie_id:20!null\n" +
 13253  			"         │   │   │   │   │   └─ Eq\n" +
 13254  			"         │   │   │   │   │       ├─ mk.movie_id:16!null\n" +
 13255  			"         │   │   │   │   │       └─ mc.movie_id:3!null\n" +
 13256  			"         │   │   │   │   └─ Eq\n" +
 13257  			"         │   │   │   │       ├─ ml.movie_id:12!null\n" +
 13258  			"         │   │   │   │       └─ mc.movie_id:3!null\n" +
 13259  			"         │   │   │   └─ Eq\n" +
 13260  			"         │   │   │       ├─ ml.movie_id:12!null\n" +
 13261  			"         │   │   │       └─ t.id:0!null\n" +
 13262  			"         │   │   └─ Eq\n" +
 13263  			"         │   │       ├─ t.id:0!null\n" +
 13264  			"         │   │       └─ mk.movie_id:16!null\n" +
 13265  			"         │   └─ Eq\n" +
 13266  			"         │       ├─ mi.movie_id:20!null\n" +
 13267  			"         │       └─ t.id:0!null\n" +
 13268  			"         ├─ InnerJoin\n" +
 13269  			"         │   ├─ Eq\n" +
 13270  			"         │   │   ├─ t.id:0!null\n" +
 13271  			"         │   │   └─ mc.movie_id:3!null\n" +
 13272  			"         │   ├─ Filter\n" +
 13273  			"         │   │   ├─ AND\n" +
 13274  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
 13275  			"         │   │   │   │   ├─ t.production_year:2\n" +
 13276  			"         │   │   │   │   └─ 1950 (smallint)\n" +
 13277  			"         │   │   │   └─ LessThanOrEqual\n" +
 13278  			"         │   │   │       ├─ t.production_year:2\n" +
 13279  			"         │   │   │       └─ 2010 (smallint)\n" +
 13280  			"         │   │   └─ TableAlias(t)\n" +
 13281  			"         │   │       └─ ProcessTable\n" +
 13282  			"         │   │           └─ Table\n" +
 13283  			"         │   │               ├─ name: title\n" +
 13284  			"         │   │               └─ columns: [id title production_year]\n" +
 13285  			"         │   └─ InnerJoin\n" +
 13286  			"         │       ├─ Eq\n" +
 13287  			"         │       │   ├─ mc.company_type_id:5!null\n" +
 13288  			"         │       │   └─ ct.id:10!null\n" +
 13289  			"         │       ├─ InnerJoin\n" +
 13290  			"         │       │   ├─ Eq\n" +
 13291  			"         │       │   │   ├─ mc.company_id:4!null\n" +
 13292  			"         │       │   │   └─ cn.id:7!null\n" +
 13293  			"         │       │   ├─ Filter\n" +
 13294  			"         │       │   │   ├─ mc.note:3 IS NULL\n" +
 13295  			"         │       │   │   └─ TableAlias(mc)\n" +
 13296  			"         │       │   │       └─ ProcessTable\n" +
 13297  			"         │       │   │           └─ Table\n" +
 13298  			"         │       │   │               ├─ name: movie_companies\n" +
 13299  			"         │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 13300  			"         │       │   └─ Filter\n" +
 13301  			"         │       │       ├─ AND\n" +
 13302  			"         │       │       │   ├─ NOT\n" +
 13303  			"         │       │       │   │   └─ Eq\n" +
 13304  			"         │       │       │   │       ├─ cn.country_code:2\n" +
 13305  			"         │       │       │   │       └─ [pl] (longtext)\n" +
 13306  			"         │       │       │   └─ Or\n" +
 13307  			"         │       │       │       ├─ cn.name LIKE '%Film%'\n" +
 13308  			"         │       │       │       └─ cn.name LIKE '%Warner%'\n" +
 13309  			"         │       │       └─ TableAlias(cn)\n" +
 13310  			"         │       │           └─ ProcessTable\n" +
 13311  			"         │       │               └─ Table\n" +
 13312  			"         │       │                   ├─ name: company_name\n" +
 13313  			"         │       │                   └─ columns: [id name country_code]\n" +
 13314  			"         │       └─ Filter\n" +
 13315  			"         │           ├─ Eq\n" +
 13316  			"         │           │   ├─ ct.kind:1!null\n" +
 13317  			"         │           │   └─ production companies (longtext)\n" +
 13318  			"         │           └─ TableAlias(ct)\n" +
 13319  			"         │               └─ ProcessTable\n" +
 13320  			"         │                   └─ Table\n" +
 13321  			"         │                       ├─ name: company_type\n" +
 13322  			"         │                       └─ columns: [id kind]\n" +
 13323  			"         └─ LookupJoin\n" +
 13324  			"             ├─ InnerJoin\n" +
 13325  			"             │   ├─ Eq\n" +
 13326  			"             │   │   ├─ ml.movie_id:12!null\n" +
 13327  			"             │   │   └─ mk.movie_id:16!null\n" +
 13328  			"             │   ├─ InnerJoin\n" +
 13329  			"             │   │   ├─ Eq\n" +
 13330  			"             │   │   │   ├─ lt.id:14!null\n" +
 13331  			"             │   │   │   └─ ml.link_type_id:13!null\n" +
 13332  			"             │   │   ├─ TableAlias(ml)\n" +
 13333  			"             │   │   │   └─ ProcessTable\n" +
 13334  			"             │   │   │       └─ Table\n" +
 13335  			"             │   │   │           ├─ name: movie_link\n" +
 13336  			"             │   │   │           └─ columns: [movie_id link_type_id]\n" +
 13337  			"             │   │   └─ Filter\n" +
 13338  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 13339  			"             │   │       └─ TableAlias(lt)\n" +
 13340  			"             │   │           └─ ProcessTable\n" +
 13341  			"             │   │               └─ Table\n" +
 13342  			"             │   │                   ├─ name: link_type\n" +
 13343  			"             │   │                   └─ columns: [id link]\n" +
 13344  			"             │   └─ InnerJoin\n" +
 13345  			"             │       ├─ Eq\n" +
 13346  			"             │       │   ├─ mk.keyword_id:17!null\n" +
 13347  			"             │       │   └─ k.id:18!null\n" +
 13348  			"             │       ├─ TableAlias(mk)\n" +
 13349  			"             │       │   └─ ProcessTable\n" +
 13350  			"             │       │       └─ Table\n" +
 13351  			"             │       │           ├─ name: movie_keyword\n" +
 13352  			"             │       │           └─ columns: [movie_id keyword_id]\n" +
 13353  			"             │       └─ Filter\n" +
 13354  			"             │           ├─ Eq\n" +
 13355  			"             │           │   ├─ k.keyword:1!null\n" +
 13356  			"             │           │   └─ sequel (longtext)\n" +
 13357  			"             │           └─ TableAlias(k)\n" +
 13358  			"             │               └─ ProcessTable\n" +
 13359  			"             │                   └─ Table\n" +
 13360  			"             │                       ├─ name: keyword\n" +
 13361  			"             │                       └─ columns: [id keyword]\n" +
 13362  			"             └─ Filter\n" +
 13363  			"                 ├─ HashIn\n" +
 13364  			"                 │   ├─ mi.info:1!null\n" +
 13365  			"                 │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext), English (longtext))\n" +
 13366  			"                 └─ TableAlias(mi)\n" +
 13367  			"                     └─ IndexedTableAccess(movie_info)\n" +
 13368  			"                         ├─ index: [movie_info.movie_id]\n" +
 13369  			"                         ├─ keys: [mk.movie_id:16!null]\n" +
 13370  			"                         ├─ colSet: (20-24)\n" +
 13371  			"                         ├─ tableId: 6\n" +
 13372  			"                         └─ Table\n" +
 13373  			"                             ├─ name: movie_info\n" +
 13374  			"                             └─ columns: [movie_id info]\n" +
 13375  			"",
 13376  		ExpectedEstimates: "Project\n" +
 13377  			" ├─ columns: [min(cn.name) as company_name, min(lt.link) as link_type, min(t.title) as western_follow_up]\n" +
 13378  			" └─ GroupBy\n" +
 13379  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 13380  			"     ├─ Grouping()\n" +
 13381  			"     └─ InnerJoin\n" +
 13382  			"         ├─ ((((((mc.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (ml.movie_id = mc.movie_id)) AND (ml.movie_id = t.id)) AND (t.id = mk.movie_id)) AND (mi.movie_id = t.id))\n" +
 13383  			"         ├─ InnerJoin\n" +
 13384  			"         │   ├─ (t.id = mc.movie_id)\n" +
 13385  			"         │   ├─ Filter\n" +
 13386  			"         │   │   ├─ ((t.production_year >= 1950) AND (t.production_year <= 2010))\n" +
 13387  			"         │   │   └─ TableAlias(t)\n" +
 13388  			"         │   │       └─ Table\n" +
 13389  			"         │   │           ├─ name: title\n" +
 13390  			"         │   │           └─ columns: [id title production_year]\n" +
 13391  			"         │   └─ InnerJoin\n" +
 13392  			"         │       ├─ (mc.company_type_id = ct.id)\n" +
 13393  			"         │       ├─ InnerJoin\n" +
 13394  			"         │       │   ├─ (mc.company_id = cn.id)\n" +
 13395  			"         │       │   ├─ Filter\n" +
 13396  			"         │       │   │   ├─ mc.note IS NULL\n" +
 13397  			"         │       │   │   └─ TableAlias(mc)\n" +
 13398  			"         │       │   │       └─ Table\n" +
 13399  			"         │       │   │           ├─ name: movie_companies\n" +
 13400  			"         │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 13401  			"         │       │   └─ Filter\n" +
 13402  			"         │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 13403  			"         │       │       └─ TableAlias(cn)\n" +
 13404  			"         │       │           └─ Table\n" +
 13405  			"         │       │               ├─ name: company_name\n" +
 13406  			"         │       │               └─ columns: [id name country_code]\n" +
 13407  			"         │       └─ Filter\n" +
 13408  			"         │           ├─ (ct.kind = 'production companies')\n" +
 13409  			"         │           └─ TableAlias(ct)\n" +
 13410  			"         │               └─ Table\n" +
 13411  			"         │                   ├─ name: company_type\n" +
 13412  			"         │                   └─ columns: [id kind]\n" +
 13413  			"         └─ LookupJoin\n" +
 13414  			"             ├─ InnerJoin\n" +
 13415  			"             │   ├─ (ml.movie_id = mk.movie_id)\n" +
 13416  			"             │   ├─ InnerJoin\n" +
 13417  			"             │   │   ├─ (lt.id = ml.link_type_id)\n" +
 13418  			"             │   │   ├─ TableAlias(ml)\n" +
 13419  			"             │   │   │   └─ Table\n" +
 13420  			"             │   │   │       ├─ name: movie_link\n" +
 13421  			"             │   │   │       └─ columns: [movie_id link_type_id]\n" +
 13422  			"             │   │   └─ Filter\n" +
 13423  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 13424  			"             │   │       └─ TableAlias(lt)\n" +
 13425  			"             │   │           └─ Table\n" +
 13426  			"             │   │               ├─ name: link_type\n" +
 13427  			"             │   │               └─ columns: [id link]\n" +
 13428  			"             │   └─ InnerJoin\n" +
 13429  			"             │       ├─ (mk.keyword_id = k.id)\n" +
 13430  			"             │       ├─ TableAlias(mk)\n" +
 13431  			"             │       │   └─ Table\n" +
 13432  			"             │       │       ├─ name: movie_keyword\n" +
 13433  			"             │       │       └─ columns: [movie_id keyword_id]\n" +
 13434  			"             │       └─ Filter\n" +
 13435  			"             │           ├─ (k.keyword = 'sequel')\n" +
 13436  			"             │           └─ TableAlias(k)\n" +
 13437  			"             │               └─ Table\n" +
 13438  			"             │                   ├─ name: keyword\n" +
 13439  			"             │                   └─ columns: [id keyword]\n" +
 13440  			"             └─ Filter\n" +
 13441  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'English'))\n" +
 13442  			"                 └─ TableAlias(mi)\n" +
 13443  			"                     └─ IndexedTableAccess(movie_info)\n" +
 13444  			"                         ├─ index: [movie_info.movie_id]\n" +
 13445  			"                         ├─ columns: [movie_id info]\n" +
 13446  			"                         └─ keys: mk.movie_id\n" +
 13447  			"",
 13448  		ExpectedAnalysis: "Project\n" +
 13449  			" ├─ columns: [min(cn.name) as company_name, min(lt.link) as link_type, min(t.title) as western_follow_up]\n" +
 13450  			" └─ GroupBy\n" +
 13451  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 13452  			"     ├─ Grouping()\n" +
 13453  			"     └─ InnerJoin\n" +
 13454  			"         ├─ ((((((mc.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (ml.movie_id = mc.movie_id)) AND (ml.movie_id = t.id)) AND (t.id = mk.movie_id)) AND (mi.movie_id = t.id))\n" +
 13455  			"         ├─ InnerJoin\n" +
 13456  			"         │   ├─ (t.id = mc.movie_id)\n" +
 13457  			"         │   ├─ Filter\n" +
 13458  			"         │   │   ├─ ((t.production_year >= 1950) AND (t.production_year <= 2010))\n" +
 13459  			"         │   │   └─ TableAlias(t)\n" +
 13460  			"         │   │       └─ Table\n" +
 13461  			"         │   │           ├─ name: title\n" +
 13462  			"         │   │           └─ columns: [id title production_year]\n" +
 13463  			"         │   └─ InnerJoin\n" +
 13464  			"         │       ├─ (mc.company_type_id = ct.id)\n" +
 13465  			"         │       ├─ InnerJoin\n" +
 13466  			"         │       │   ├─ (mc.company_id = cn.id)\n" +
 13467  			"         │       │   ├─ Filter\n" +
 13468  			"         │       │   │   ├─ mc.note IS NULL\n" +
 13469  			"         │       │   │   └─ TableAlias(mc)\n" +
 13470  			"         │       │   │       └─ Table\n" +
 13471  			"         │       │   │           ├─ name: movie_companies\n" +
 13472  			"         │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 13473  			"         │       │   └─ Filter\n" +
 13474  			"         │       │       ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 13475  			"         │       │       └─ TableAlias(cn)\n" +
 13476  			"         │       │           └─ Table\n" +
 13477  			"         │       │               ├─ name: company_name\n" +
 13478  			"         │       │               └─ columns: [id name country_code]\n" +
 13479  			"         │       └─ Filter\n" +
 13480  			"         │           ├─ (ct.kind = 'production companies')\n" +
 13481  			"         │           └─ TableAlias(ct)\n" +
 13482  			"         │               └─ Table\n" +
 13483  			"         │                   ├─ name: company_type\n" +
 13484  			"         │                   └─ columns: [id kind]\n" +
 13485  			"         └─ LookupJoin\n" +
 13486  			"             ├─ InnerJoin\n" +
 13487  			"             │   ├─ (ml.movie_id = mk.movie_id)\n" +
 13488  			"             │   ├─ InnerJoin\n" +
 13489  			"             │   │   ├─ (lt.id = ml.link_type_id)\n" +
 13490  			"             │   │   ├─ TableAlias(ml)\n" +
 13491  			"             │   │   │   └─ Table\n" +
 13492  			"             │   │   │       ├─ name: movie_link\n" +
 13493  			"             │   │   │       └─ columns: [movie_id link_type_id]\n" +
 13494  			"             │   │   └─ Filter\n" +
 13495  			"             │   │       ├─ lt.link LIKE '%follow%'\n" +
 13496  			"             │   │       └─ TableAlias(lt)\n" +
 13497  			"             │   │           └─ Table\n" +
 13498  			"             │   │               ├─ name: link_type\n" +
 13499  			"             │   │               └─ columns: [id link]\n" +
 13500  			"             │   └─ InnerJoin\n" +
 13501  			"             │       ├─ (mk.keyword_id = k.id)\n" +
 13502  			"             │       ├─ TableAlias(mk)\n" +
 13503  			"             │       │   └─ Table\n" +
 13504  			"             │       │       ├─ name: movie_keyword\n" +
 13505  			"             │       │       └─ columns: [movie_id keyword_id]\n" +
 13506  			"             │       └─ Filter\n" +
 13507  			"             │           ├─ (k.keyword = 'sequel')\n" +
 13508  			"             │           └─ TableAlias(k)\n" +
 13509  			"             │               └─ Table\n" +
 13510  			"             │                   ├─ name: keyword\n" +
 13511  			"             │                   └─ columns: [id keyword]\n" +
 13512  			"             └─ Filter\n" +
 13513  			"                 ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'English'))\n" +
 13514  			"                 └─ TableAlias(mi)\n" +
 13515  			"                     └─ IndexedTableAccess(movie_info)\n" +
 13516  			"                         ├─ index: [movie_info.movie_id]\n" +
 13517  			"                         ├─ columns: [movie_id info]\n" +
 13518  			"                         └─ keys: mk.movie_id\n" +
 13519  			"",
 13520  	},
 13521  	{
 13522  		Query: `
 13523  SELECT MIN(cn.name) AS movie_company,
 13524         MIN(mi_idx.info) AS rating,
 13525         MIN(t.title) AS western_violent_movie
 13526  FROM company_name AS cn,
 13527       company_type AS ct,
 13528       info_type AS it1,
 13529       info_type AS it2,
 13530       keyword AS k,
 13531       kind_type AS kt,
 13532       movie_companies AS mc,
 13533       movie_info AS mi,
 13534       movie_info_idx AS mi_idx,
 13535       movie_keyword AS mk,
 13536       title AS t
 13537  WHERE cn.country_code != '[us]'
 13538    AND it1.info = 'countries'
 13539    AND it2.info = 'rating'
 13540    AND k.keyword IN ('murder',
 13541                      'murder-in-title',
 13542                      'blood',
 13543                      'violence')
 13544    AND kt.kind IN ('movie',
 13545                    'episode')
 13546    AND mc.note NOT LIKE '%(USA)%'
 13547    AND mc.note LIKE '%(200%)%'
 13548    AND mi.info IN ('Germany',
 13549                    'German',
 13550                    'USA',
 13551                    'American')
 13552    AND mi_idx.info < '7.0'
 13553    AND t.production_year > 2008
 13554    AND kt.id = t.kind_id
 13555    AND t.id = mi.movie_id
 13556    AND t.id = mk.movie_id
 13557    AND t.id = mi_idx.movie_id
 13558    AND t.id = mc.movie_id
 13559    AND mk.movie_id = mi.movie_id
 13560    AND mk.movie_id = mi_idx.movie_id
 13561    AND mk.movie_id = mc.movie_id
 13562    AND mi.movie_id = mi_idx.movie_id
 13563    AND mi.movie_id = mc.movie_id
 13564    AND mc.movie_id = mi_idx.movie_id
 13565    AND k.id = mk.keyword_id
 13566    AND it1.id = mi.info_type_id
 13567    AND it2.id = mi_idx.info_type_id
 13568    AND ct.id = mc.company_type_id
 13569    AND cn.id = mc.company_id;
 13570  
 13571  `,
 13572  		ExpectedPlan: "Project\n" +
 13573  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as western_violent_movie]\n" +
 13574  			" └─ GroupBy\n" +
 13575  			"     ├─ select: MIN(cn.name:11!null), MIN(mi_idx.info:16!null), MIN(t.title:1!null)\n" +
 13576  			"     ├─ group: \n" +
 13577  			"     └─ InnerJoin\n" +
 13578  			"         ├─ AND\n" +
 13579  			"         │   ├─ AND\n" +
 13580  			"         │   │   ├─ AND\n" +
 13581  			"         │   │   │   ├─ Eq\n" +
 13582  			"         │   │   │   │   ├─ mk.movie_id:24!null\n" +
 13583  			"         │   │   │   │   └─ mi.movie_id:19!null\n" +
 13584  			"         │   │   │   └─ Eq\n" +
 13585  			"         │   │   │       ├─ mk.movie_id:24!null\n" +
 13586  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 13587  			"         │   │   └─ Eq\n" +
 13588  			"         │   │       ├─ mk.movie_id:24!null\n" +
 13589  			"         │   │       └─ mc.movie_id:6!null\n" +
 13590  			"         │   └─ Eq\n" +
 13591  			"         │       ├─ t.id:0!null\n" +
 13592  			"         │       └─ mk.movie_id:24!null\n" +
 13593  			"         ├─ InnerJoin\n" +
 13594  			"         │   ├─ AND\n" +
 13595  			"         │   │   ├─ AND\n" +
 13596  			"         │   │   │   ├─ Eq\n" +
 13597  			"         │   │   │   │   ├─ mi.movie_id:19!null\n" +
 13598  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 13599  			"         │   │   │   └─ Eq\n" +
 13600  			"         │   │   │       ├─ mi.movie_id:19!null\n" +
 13601  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 13602  			"         │   │   └─ Eq\n" +
 13603  			"         │   │       ├─ t.id:0!null\n" +
 13604  			"         │   │       └─ mi.movie_id:19!null\n" +
 13605  			"         │   ├─ InnerJoin\n" +
 13606  			"         │   │   ├─ AND\n" +
 13607  			"         │   │   │   ├─ Eq\n" +
 13608  			"         │   │   │   │   ├─ mc.movie_id:6!null\n" +
 13609  			"         │   │   │   │   └─ mi_idx.movie_id:14!null\n" +
 13610  			"         │   │   │   └─ Eq\n" +
 13611  			"         │   │   │       ├─ t.id:0!null\n" +
 13612  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 13613  			"         │   │   ├─ InnerJoin\n" +
 13614  			"         │   │   │   ├─ Eq\n" +
 13615  			"         │   │   │   │   ├─ t.id:0!null\n" +
 13616  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 13617  			"         │   │   │   ├─ InnerJoin\n" +
 13618  			"         │   │   │   │   ├─ Eq\n" +
 13619  			"         │   │   │   │   │   ├─ kt.id:4!null\n" +
 13620  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 13621  			"         │   │   │   │   ├─ Filter\n" +
 13622  			"         │   │   │   │   │   ├─ GreaterThan\n" +
 13623  			"         │   │   │   │   │   │   ├─ t.production_year:3\n" +
 13624  			"         │   │   │   │   │   │   └─ 2008 (smallint)\n" +
 13625  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 13626  			"         │   │   │   │   │       └─ ProcessTable\n" +
 13627  			"         │   │   │   │   │           └─ Table\n" +
 13628  			"         │   │   │   │   │               ├─ name: title\n" +
 13629  			"         │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 13630  			"         │   │   │   │   └─ Filter\n" +
 13631  			"         │   │   │   │       ├─ HashIn\n" +
 13632  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 13633  			"         │   │   │   │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
 13634  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 13635  			"         │   │   │   │           └─ ProcessTable\n" +
 13636  			"         │   │   │   │               └─ Table\n" +
 13637  			"         │   │   │   │                   ├─ name: kind_type\n" +
 13638  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 13639  			"         │   │   │   └─ InnerJoin\n" +
 13640  			"         │   │   │       ├─ Eq\n" +
 13641  			"         │   │   │       │   ├─ ct.id:13!null\n" +
 13642  			"         │   │   │       │   └─ mc.company_type_id:8!null\n" +
 13643  			"         │   │   │       ├─ InnerJoin\n" +
 13644  			"         │   │   │       │   ├─ Eq\n" +
 13645  			"         │   │   │       │   │   ├─ cn.id:10!null\n" +
 13646  			"         │   │   │       │   │   └─ mc.company_id:7!null\n" +
 13647  			"         │   │   │       │   ├─ Filter\n" +
 13648  			"         │   │   │       │   │   ├─ AND\n" +
 13649  			"         │   │   │       │   │   │   ├─ NOT\n" +
 13650  			"         │   │   │       │   │   │   │   └─ mc.note LIKE '%(USA)%'\n" +
 13651  			"         │   │   │       │   │   │   └─ mc.note LIKE '%(200%)%'\n" +
 13652  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 13653  			"         │   │   │       │   │       └─ ProcessTable\n" +
 13654  			"         │   │   │       │   │           └─ Table\n" +
 13655  			"         │   │   │       │   │               ├─ name: movie_companies\n" +
 13656  			"         │   │   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 13657  			"         │   │   │       │   └─ Filter\n" +
 13658  			"         │   │   │       │       ├─ NOT\n" +
 13659  			"         │   │   │       │       │   └─ Eq\n" +
 13660  			"         │   │   │       │       │       ├─ cn.country_code:2\n" +
 13661  			"         │   │   │       │       │       └─ [us] (longtext)\n" +
 13662  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 13663  			"         │   │   │       │           └─ ProcessTable\n" +
 13664  			"         │   │   │       │               └─ Table\n" +
 13665  			"         │   │   │       │                   ├─ name: company_name\n" +
 13666  			"         │   │   │       │                   └─ columns: [id name country_code]\n" +
 13667  			"         │   │   │       └─ TableAlias(ct)\n" +
 13668  			"         │   │   │           └─ ProcessTable\n" +
 13669  			"         │   │   │               └─ Table\n" +
 13670  			"         │   │   │                   ├─ name: company_type\n" +
 13671  			"         │   │   │                   └─ columns: [id]\n" +
 13672  			"         │   │   └─ InnerJoin\n" +
 13673  			"         │   │       ├─ Eq\n" +
 13674  			"         │   │       │   ├─ it2.id:17!null\n" +
 13675  			"         │   │       │   └─ mi_idx.info_type_id:15!null\n" +
 13676  			"         │   │       ├─ Filter\n" +
 13677  			"         │   │       │   ├─ LessThan\n" +
 13678  			"         │   │       │   │   ├─ mi_idx.info:2!null\n" +
 13679  			"         │   │       │   │   └─ 7.0 (longtext)\n" +
 13680  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 13681  			"         │   │       │       └─ ProcessTable\n" +
 13682  			"         │   │       │           └─ Table\n" +
 13683  			"         │   │       │               ├─ name: movie_info_idx\n" +
 13684  			"         │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 13685  			"         │   │       └─ Filter\n" +
 13686  			"         │   │           ├─ Eq\n" +
 13687  			"         │   │           │   ├─ it2.info:1!null\n" +
 13688  			"         │   │           │   └─ rating (longtext)\n" +
 13689  			"         │   │           └─ TableAlias(it2)\n" +
 13690  			"         │   │               └─ ProcessTable\n" +
 13691  			"         │   │                   └─ Table\n" +
 13692  			"         │   │                       ├─ name: info_type\n" +
 13693  			"         │   │                       └─ columns: [id info]\n" +
 13694  			"         │   └─ InnerJoin\n" +
 13695  			"         │       ├─ Eq\n" +
 13696  			"         │       │   ├─ it1.id:22!null\n" +
 13697  			"         │       │   └─ mi.info_type_id:20!null\n" +
 13698  			"         │       ├─ Filter\n" +
 13699  			"         │       │   ├─ HashIn\n" +
 13700  			"         │       │   │   ├─ mi.info:2!null\n" +
 13701  			"         │       │   │   └─ TUPLE(Germany (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 13702  			"         │       │   └─ TableAlias(mi)\n" +
 13703  			"         │       │       └─ ProcessTable\n" +
 13704  			"         │       │           └─ Table\n" +
 13705  			"         │       │               ├─ name: movie_info\n" +
 13706  			"         │       │               └─ columns: [movie_id info_type_id info]\n" +
 13707  			"         │       └─ Filter\n" +
 13708  			"         │           ├─ Eq\n" +
 13709  			"         │           │   ├─ it1.info:1!null\n" +
 13710  			"         │           │   └─ countries (longtext)\n" +
 13711  			"         │           └─ TableAlias(it1)\n" +
 13712  			"         │               └─ Table\n" +
 13713  			"         │                   ├─ name: info_type\n" +
 13714  			"         │                   ├─ columns: [id info]\n" +
 13715  			"         │                   ├─ colSet: (10,11)\n" +
 13716  			"         │                   └─ tableId: 3\n" +
 13717  			"         └─ InnerJoin\n" +
 13718  			"             ├─ Eq\n" +
 13719  			"             │   ├─ k.id:26!null\n" +
 13720  			"             │   └─ mk.keyword_id:25!null\n" +
 13721  			"             ├─ TableAlias(mk)\n" +
 13722  			"             │   └─ ProcessTable\n" +
 13723  			"             │       └─ Table\n" +
 13724  			"             │           ├─ name: movie_keyword\n" +
 13725  			"             │           └─ columns: [movie_id keyword_id]\n" +
 13726  			"             └─ Filter\n" +
 13727  			"                 ├─ HashIn\n" +
 13728  			"                 │   ├─ k.keyword:1!null\n" +
 13729  			"                 │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
 13730  			"                 └─ TableAlias(k)\n" +
 13731  			"                     └─ ProcessTable\n" +
 13732  			"                         └─ Table\n" +
 13733  			"                             ├─ name: keyword\n" +
 13734  			"                             └─ columns: [id keyword]\n" +
 13735  			"",
 13736  		ExpectedEstimates: "Project\n" +
 13737  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 13738  			" └─ GroupBy\n" +
 13739  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 13740  			"     ├─ Grouping()\n" +
 13741  			"     └─ InnerJoin\n" +
 13742  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 13743  			"         ├─ InnerJoin\n" +
 13744  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 13745  			"         │   ├─ InnerJoin\n" +
 13746  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 13747  			"         │   │   ├─ InnerJoin\n" +
 13748  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 13749  			"         │   │   │   ├─ InnerJoin\n" +
 13750  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 13751  			"         │   │   │   │   ├─ Filter\n" +
 13752  			"         │   │   │   │   │   ├─ (t.production_year > 2008)\n" +
 13753  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 13754  			"         │   │   │   │   │       └─ Table\n" +
 13755  			"         │   │   │   │   │           ├─ name: title\n" +
 13756  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 13757  			"         │   │   │   │   └─ Filter\n" +
 13758  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 13759  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 13760  			"         │   │   │   │           └─ Table\n" +
 13761  			"         │   │   │   │               ├─ name: kind_type\n" +
 13762  			"         │   │   │   │               └─ columns: [id kind]\n" +
 13763  			"         │   │   │   └─ InnerJoin\n" +
 13764  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 13765  			"         │   │   │       ├─ InnerJoin\n" +
 13766  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 13767  			"         │   │   │       │   ├─ Filter\n" +
 13768  			"         │   │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 13769  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 13770  			"         │   │   │       │   │       └─ Table\n" +
 13771  			"         │   │   │       │   │           ├─ name: movie_companies\n" +
 13772  			"         │   │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 13773  			"         │   │   │       │   └─ Filter\n" +
 13774  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 13775  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 13776  			"         │   │   │       │           └─ Table\n" +
 13777  			"         │   │   │       │               ├─ name: company_name\n" +
 13778  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 13779  			"         │   │   │       └─ TableAlias(ct)\n" +
 13780  			"         │   │   │           └─ Table\n" +
 13781  			"         │   │   │               ├─ name: company_type\n" +
 13782  			"         │   │   │               └─ columns: [id]\n" +
 13783  			"         │   │   └─ InnerJoin\n" +
 13784  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 13785  			"         │   │       ├─ Filter\n" +
 13786  			"         │   │       │   ├─ (mi_idx.info < '7.0')\n" +
 13787  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 13788  			"         │   │       │       └─ Table\n" +
 13789  			"         │   │       │           ├─ name: movie_info_idx\n" +
 13790  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 13791  			"         │   │       └─ Filter\n" +
 13792  			"         │   │           ├─ (it2.info = 'rating')\n" +
 13793  			"         │   │           └─ TableAlias(it2)\n" +
 13794  			"         │   │               └─ Table\n" +
 13795  			"         │   │                   ├─ name: info_type\n" +
 13796  			"         │   │                   └─ columns: [id info]\n" +
 13797  			"         │   └─ InnerJoin\n" +
 13798  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 13799  			"         │       ├─ Filter\n" +
 13800  			"         │       │   ├─ (mi.info HASH IN ('Germany', 'German', 'USA', 'American'))\n" +
 13801  			"         │       │   └─ TableAlias(mi)\n" +
 13802  			"         │       │       └─ Table\n" +
 13803  			"         │       │           ├─ name: movie_info\n" +
 13804  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 13805  			"         │       └─ Filter\n" +
 13806  			"         │           ├─ (it1.info = 'countries')\n" +
 13807  			"         │           └─ TableAlias(it1)\n" +
 13808  			"         │               └─ Table\n" +
 13809  			"         │                   ├─ name: info_type\n" +
 13810  			"         │                   └─ columns: [id info]\n" +
 13811  			"         └─ InnerJoin\n" +
 13812  			"             ├─ (k.id = mk.keyword_id)\n" +
 13813  			"             ├─ TableAlias(mk)\n" +
 13814  			"             │   └─ Table\n" +
 13815  			"             │       ├─ name: movie_keyword\n" +
 13816  			"             │       └─ columns: [movie_id keyword_id]\n" +
 13817  			"             └─ Filter\n" +
 13818  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 13819  			"                 └─ TableAlias(k)\n" +
 13820  			"                     └─ Table\n" +
 13821  			"                         ├─ name: keyword\n" +
 13822  			"                         └─ columns: [id keyword]\n" +
 13823  			"",
 13824  		ExpectedAnalysis: "Project\n" +
 13825  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 13826  			" └─ GroupBy\n" +
 13827  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 13828  			"     ├─ Grouping()\n" +
 13829  			"     └─ InnerJoin\n" +
 13830  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 13831  			"         ├─ InnerJoin\n" +
 13832  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 13833  			"         │   ├─ InnerJoin\n" +
 13834  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 13835  			"         │   │   ├─ InnerJoin\n" +
 13836  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 13837  			"         │   │   │   ├─ InnerJoin\n" +
 13838  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 13839  			"         │   │   │   │   ├─ Filter\n" +
 13840  			"         │   │   │   │   │   ├─ (t.production_year > 2008)\n" +
 13841  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 13842  			"         │   │   │   │   │       └─ Table\n" +
 13843  			"         │   │   │   │   │           ├─ name: title\n" +
 13844  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 13845  			"         │   │   │   │   └─ Filter\n" +
 13846  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 13847  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 13848  			"         │   │   │   │           └─ Table\n" +
 13849  			"         │   │   │   │               ├─ name: kind_type\n" +
 13850  			"         │   │   │   │               └─ columns: [id kind]\n" +
 13851  			"         │   │   │   └─ InnerJoin\n" +
 13852  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 13853  			"         │   │   │       ├─ InnerJoin\n" +
 13854  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 13855  			"         │   │   │       │   ├─ Filter\n" +
 13856  			"         │   │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 13857  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 13858  			"         │   │   │       │   │       └─ Table\n" +
 13859  			"         │   │   │       │   │           ├─ name: movie_companies\n" +
 13860  			"         │   │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 13861  			"         │   │   │       │   └─ Filter\n" +
 13862  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 13863  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 13864  			"         │   │   │       │           └─ Table\n" +
 13865  			"         │   │   │       │               ├─ name: company_name\n" +
 13866  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 13867  			"         │   │   │       └─ TableAlias(ct)\n" +
 13868  			"         │   │   │           └─ Table\n" +
 13869  			"         │   │   │               ├─ name: company_type\n" +
 13870  			"         │   │   │               └─ columns: [id]\n" +
 13871  			"         │   │   └─ InnerJoin\n" +
 13872  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 13873  			"         │   │       ├─ Filter\n" +
 13874  			"         │   │       │   ├─ (mi_idx.info < '7.0')\n" +
 13875  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 13876  			"         │   │       │       └─ Table\n" +
 13877  			"         │   │       │           ├─ name: movie_info_idx\n" +
 13878  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 13879  			"         │   │       └─ Filter\n" +
 13880  			"         │   │           ├─ (it2.info = 'rating')\n" +
 13881  			"         │   │           └─ TableAlias(it2)\n" +
 13882  			"         │   │               └─ Table\n" +
 13883  			"         │   │                   ├─ name: info_type\n" +
 13884  			"         │   │                   └─ columns: [id info]\n" +
 13885  			"         │   └─ InnerJoin\n" +
 13886  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 13887  			"         │       ├─ Filter\n" +
 13888  			"         │       │   ├─ (mi.info HASH IN ('Germany', 'German', 'USA', 'American'))\n" +
 13889  			"         │       │   └─ TableAlias(mi)\n" +
 13890  			"         │       │       └─ Table\n" +
 13891  			"         │       │           ├─ name: movie_info\n" +
 13892  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 13893  			"         │       └─ Filter\n" +
 13894  			"         │           ├─ (it1.info = 'countries')\n" +
 13895  			"         │           └─ TableAlias(it1)\n" +
 13896  			"         │               └─ Table\n" +
 13897  			"         │                   ├─ name: info_type\n" +
 13898  			"         │                   └─ columns: [id info]\n" +
 13899  			"         └─ InnerJoin\n" +
 13900  			"             ├─ (k.id = mk.keyword_id)\n" +
 13901  			"             ├─ TableAlias(mk)\n" +
 13902  			"             │   └─ Table\n" +
 13903  			"             │       ├─ name: movie_keyword\n" +
 13904  			"             │       └─ columns: [movie_id keyword_id]\n" +
 13905  			"             └─ Filter\n" +
 13906  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 13907  			"                 └─ TableAlias(k)\n" +
 13908  			"                     └─ Table\n" +
 13909  			"                         ├─ name: keyword\n" +
 13910  			"                         └─ columns: [id keyword]\n" +
 13911  			"",
 13912  	},
 13913  	{
 13914  		Query: `
 13915  SELECT MIN(cn.name) AS movie_company,
 13916         MIN(mi_idx.info) AS rating,
 13917         MIN(t.title) AS western_violent_movie
 13918  FROM company_name AS cn,
 13919       company_type AS ct,
 13920       info_type AS it1,
 13921       info_type AS it2,
 13922       keyword AS k,
 13923       kind_type AS kt,
 13924       movie_companies AS mc,
 13925       movie_info AS mi,
 13926       movie_info_idx AS mi_idx,
 13927       movie_keyword AS mk,
 13928       title AS t
 13929  WHERE cn.country_code != '[us]'
 13930    AND it1.info = 'countries'
 13931    AND it2.info = 'rating'
 13932    AND k.keyword IN ('murder',
 13933                      'murder-in-title',
 13934                      'blood',
 13935                      'violence')
 13936    AND kt.kind IN ('movie',
 13937                    'episode')
 13938    AND mc.note NOT LIKE '%(USA)%'
 13939    AND mc.note LIKE '%(200%)%'
 13940    AND mi.info IN ('Germany',
 13941                    'German',
 13942                    'USA',
 13943                    'American')
 13944    AND mi_idx.info < '7.0'
 13945    AND t.production_year > 2009
 13946    AND kt.id = t.kind_id
 13947    AND t.id = mi.movie_id
 13948    AND t.id = mk.movie_id
 13949    AND t.id = mi_idx.movie_id
 13950    AND t.id = mc.movie_id
 13951    AND mk.movie_id = mi.movie_id
 13952    AND mk.movie_id = mi_idx.movie_id
 13953    AND mk.movie_id = mc.movie_id
 13954    AND mi.movie_id = mi_idx.movie_id
 13955    AND mi.movie_id = mc.movie_id
 13956    AND mc.movie_id = mi_idx.movie_id
 13957    AND k.id = mk.keyword_id
 13958    AND it1.id = mi.info_type_id
 13959    AND it2.id = mi_idx.info_type_id
 13960    AND ct.id = mc.company_type_id
 13961    AND cn.id = mc.company_id;
 13962  
 13963  `,
 13964  		ExpectedPlan: "Project\n" +
 13965  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as western_violent_movie]\n" +
 13966  			" └─ GroupBy\n" +
 13967  			"     ├─ select: MIN(cn.name:11!null), MIN(mi_idx.info:16!null), MIN(t.title:1!null)\n" +
 13968  			"     ├─ group: \n" +
 13969  			"     └─ InnerJoin\n" +
 13970  			"         ├─ AND\n" +
 13971  			"         │   ├─ AND\n" +
 13972  			"         │   │   ├─ AND\n" +
 13973  			"         │   │   │   ├─ Eq\n" +
 13974  			"         │   │   │   │   ├─ mk.movie_id:24!null\n" +
 13975  			"         │   │   │   │   └─ mi.movie_id:19!null\n" +
 13976  			"         │   │   │   └─ Eq\n" +
 13977  			"         │   │   │       ├─ mk.movie_id:24!null\n" +
 13978  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 13979  			"         │   │   └─ Eq\n" +
 13980  			"         │   │       ├─ mk.movie_id:24!null\n" +
 13981  			"         │   │       └─ mc.movie_id:6!null\n" +
 13982  			"         │   └─ Eq\n" +
 13983  			"         │       ├─ t.id:0!null\n" +
 13984  			"         │       └─ mk.movie_id:24!null\n" +
 13985  			"         ├─ InnerJoin\n" +
 13986  			"         │   ├─ AND\n" +
 13987  			"         │   │   ├─ AND\n" +
 13988  			"         │   │   │   ├─ Eq\n" +
 13989  			"         │   │   │   │   ├─ mi.movie_id:19!null\n" +
 13990  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 13991  			"         │   │   │   └─ Eq\n" +
 13992  			"         │   │   │       ├─ mi.movie_id:19!null\n" +
 13993  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 13994  			"         │   │   └─ Eq\n" +
 13995  			"         │   │       ├─ t.id:0!null\n" +
 13996  			"         │   │       └─ mi.movie_id:19!null\n" +
 13997  			"         │   ├─ InnerJoin\n" +
 13998  			"         │   │   ├─ AND\n" +
 13999  			"         │   │   │   ├─ Eq\n" +
 14000  			"         │   │   │   │   ├─ mc.movie_id:6!null\n" +
 14001  			"         │   │   │   │   └─ mi_idx.movie_id:14!null\n" +
 14002  			"         │   │   │   └─ Eq\n" +
 14003  			"         │   │   │       ├─ t.id:0!null\n" +
 14004  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 14005  			"         │   │   ├─ InnerJoin\n" +
 14006  			"         │   │   │   ├─ Eq\n" +
 14007  			"         │   │   │   │   ├─ t.id:0!null\n" +
 14008  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 14009  			"         │   │   │   ├─ InnerJoin\n" +
 14010  			"         │   │   │   │   ├─ Eq\n" +
 14011  			"         │   │   │   │   │   ├─ kt.id:4!null\n" +
 14012  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 14013  			"         │   │   │   │   ├─ Filter\n" +
 14014  			"         │   │   │   │   │   ├─ GreaterThan\n" +
 14015  			"         │   │   │   │   │   │   ├─ t.production_year:3\n" +
 14016  			"         │   │   │   │   │   │   └─ 2009 (smallint)\n" +
 14017  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14018  			"         │   │   │   │   │       └─ ProcessTable\n" +
 14019  			"         │   │   │   │   │           └─ Table\n" +
 14020  			"         │   │   │   │   │               ├─ name: title\n" +
 14021  			"         │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 14022  			"         │   │   │   │   └─ Filter\n" +
 14023  			"         │   │   │   │       ├─ HashIn\n" +
 14024  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 14025  			"         │   │   │   │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
 14026  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14027  			"         │   │   │   │           └─ ProcessTable\n" +
 14028  			"         │   │   │   │               └─ Table\n" +
 14029  			"         │   │   │   │                   ├─ name: kind_type\n" +
 14030  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 14031  			"         │   │   │   └─ InnerJoin\n" +
 14032  			"         │   │   │       ├─ Eq\n" +
 14033  			"         │   │   │       │   ├─ ct.id:13!null\n" +
 14034  			"         │   │   │       │   └─ mc.company_type_id:8!null\n" +
 14035  			"         │   │   │       ├─ InnerJoin\n" +
 14036  			"         │   │   │       │   ├─ Eq\n" +
 14037  			"         │   │   │       │   │   ├─ cn.id:10!null\n" +
 14038  			"         │   │   │       │   │   └─ mc.company_id:7!null\n" +
 14039  			"         │   │   │       │   ├─ Filter\n" +
 14040  			"         │   │   │       │   │   ├─ AND\n" +
 14041  			"         │   │   │       │   │   │   ├─ NOT\n" +
 14042  			"         │   │   │       │   │   │   │   └─ mc.note LIKE '%(USA)%'\n" +
 14043  			"         │   │   │       │   │   │   └─ mc.note LIKE '%(200%)%'\n" +
 14044  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 14045  			"         │   │   │       │   │       └─ ProcessTable\n" +
 14046  			"         │   │   │       │   │           └─ Table\n" +
 14047  			"         │   │   │       │   │               ├─ name: movie_companies\n" +
 14048  			"         │   │   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 14049  			"         │   │   │       │   └─ Filter\n" +
 14050  			"         │   │   │       │       ├─ NOT\n" +
 14051  			"         │   │   │       │       │   └─ Eq\n" +
 14052  			"         │   │   │       │       │       ├─ cn.country_code:2\n" +
 14053  			"         │   │   │       │       │       └─ [us] (longtext)\n" +
 14054  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14055  			"         │   │   │       │           └─ ProcessTable\n" +
 14056  			"         │   │   │       │               └─ Table\n" +
 14057  			"         │   │   │       │                   ├─ name: company_name\n" +
 14058  			"         │   │   │       │                   └─ columns: [id name country_code]\n" +
 14059  			"         │   │   │       └─ TableAlias(ct)\n" +
 14060  			"         │   │   │           └─ ProcessTable\n" +
 14061  			"         │   │   │               └─ Table\n" +
 14062  			"         │   │   │                   ├─ name: company_type\n" +
 14063  			"         │   │   │                   └─ columns: [id]\n" +
 14064  			"         │   │   └─ InnerJoin\n" +
 14065  			"         │   │       ├─ Eq\n" +
 14066  			"         │   │       │   ├─ it2.id:17!null\n" +
 14067  			"         │   │       │   └─ mi_idx.info_type_id:15!null\n" +
 14068  			"         │   │       ├─ Filter\n" +
 14069  			"         │   │       │   ├─ LessThan\n" +
 14070  			"         │   │       │   │   ├─ mi_idx.info:2!null\n" +
 14071  			"         │   │       │   │   └─ 7.0 (longtext)\n" +
 14072  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14073  			"         │   │       │       └─ ProcessTable\n" +
 14074  			"         │   │       │           └─ Table\n" +
 14075  			"         │   │       │               ├─ name: movie_info_idx\n" +
 14076  			"         │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 14077  			"         │   │       └─ Filter\n" +
 14078  			"         │   │           ├─ Eq\n" +
 14079  			"         │   │           │   ├─ it2.info:1!null\n" +
 14080  			"         │   │           │   └─ rating (longtext)\n" +
 14081  			"         │   │           └─ TableAlias(it2)\n" +
 14082  			"         │   │               └─ ProcessTable\n" +
 14083  			"         │   │                   └─ Table\n" +
 14084  			"         │   │                       ├─ name: info_type\n" +
 14085  			"         │   │                       └─ columns: [id info]\n" +
 14086  			"         │   └─ InnerJoin\n" +
 14087  			"         │       ├─ Eq\n" +
 14088  			"         │       │   ├─ it1.id:22!null\n" +
 14089  			"         │       │   └─ mi.info_type_id:20!null\n" +
 14090  			"         │       ├─ Filter\n" +
 14091  			"         │       │   ├─ HashIn\n" +
 14092  			"         │       │   │   ├─ mi.info:2!null\n" +
 14093  			"         │       │   │   └─ TUPLE(Germany (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 14094  			"         │       │   └─ TableAlias(mi)\n" +
 14095  			"         │       │       └─ ProcessTable\n" +
 14096  			"         │       │           └─ Table\n" +
 14097  			"         │       │               ├─ name: movie_info\n" +
 14098  			"         │       │               └─ columns: [movie_id info_type_id info]\n" +
 14099  			"         │       └─ Filter\n" +
 14100  			"         │           ├─ Eq\n" +
 14101  			"         │           │   ├─ it1.info:1!null\n" +
 14102  			"         │           │   └─ countries (longtext)\n" +
 14103  			"         │           └─ TableAlias(it1)\n" +
 14104  			"         │               └─ Table\n" +
 14105  			"         │                   ├─ name: info_type\n" +
 14106  			"         │                   ├─ columns: [id info]\n" +
 14107  			"         │                   ├─ colSet: (10,11)\n" +
 14108  			"         │                   └─ tableId: 3\n" +
 14109  			"         └─ InnerJoin\n" +
 14110  			"             ├─ Eq\n" +
 14111  			"             │   ├─ k.id:26!null\n" +
 14112  			"             │   └─ mk.keyword_id:25!null\n" +
 14113  			"             ├─ TableAlias(mk)\n" +
 14114  			"             │   └─ ProcessTable\n" +
 14115  			"             │       └─ Table\n" +
 14116  			"             │           ├─ name: movie_keyword\n" +
 14117  			"             │           └─ columns: [movie_id keyword_id]\n" +
 14118  			"             └─ Filter\n" +
 14119  			"                 ├─ HashIn\n" +
 14120  			"                 │   ├─ k.keyword:1!null\n" +
 14121  			"                 │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
 14122  			"                 └─ TableAlias(k)\n" +
 14123  			"                     └─ ProcessTable\n" +
 14124  			"                         └─ Table\n" +
 14125  			"                             ├─ name: keyword\n" +
 14126  			"                             └─ columns: [id keyword]\n" +
 14127  			"",
 14128  		ExpectedEstimates: "Project\n" +
 14129  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 14130  			" └─ GroupBy\n" +
 14131  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 14132  			"     ├─ Grouping()\n" +
 14133  			"     └─ InnerJoin\n" +
 14134  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 14135  			"         ├─ InnerJoin\n" +
 14136  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 14137  			"         │   ├─ InnerJoin\n" +
 14138  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 14139  			"         │   │   ├─ InnerJoin\n" +
 14140  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 14141  			"         │   │   │   ├─ InnerJoin\n" +
 14142  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 14143  			"         │   │   │   │   ├─ Filter\n" +
 14144  			"         │   │   │   │   │   ├─ (t.production_year > 2009)\n" +
 14145  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14146  			"         │   │   │   │   │       └─ Table\n" +
 14147  			"         │   │   │   │   │           ├─ name: title\n" +
 14148  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 14149  			"         │   │   │   │   └─ Filter\n" +
 14150  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 14151  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14152  			"         │   │   │   │           └─ Table\n" +
 14153  			"         │   │   │   │               ├─ name: kind_type\n" +
 14154  			"         │   │   │   │               └─ columns: [id kind]\n" +
 14155  			"         │   │   │   └─ InnerJoin\n" +
 14156  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 14157  			"         │   │   │       ├─ InnerJoin\n" +
 14158  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 14159  			"         │   │   │       │   ├─ Filter\n" +
 14160  			"         │   │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 14161  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 14162  			"         │   │   │       │   │       └─ Table\n" +
 14163  			"         │   │   │       │   │           ├─ name: movie_companies\n" +
 14164  			"         │   │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 14165  			"         │   │   │       │   └─ Filter\n" +
 14166  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 14167  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14168  			"         │   │   │       │           └─ Table\n" +
 14169  			"         │   │   │       │               ├─ name: company_name\n" +
 14170  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 14171  			"         │   │   │       └─ TableAlias(ct)\n" +
 14172  			"         │   │   │           └─ Table\n" +
 14173  			"         │   │   │               ├─ name: company_type\n" +
 14174  			"         │   │   │               └─ columns: [id]\n" +
 14175  			"         │   │   └─ InnerJoin\n" +
 14176  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 14177  			"         │   │       ├─ Filter\n" +
 14178  			"         │   │       │   ├─ (mi_idx.info < '7.0')\n" +
 14179  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14180  			"         │   │       │       └─ Table\n" +
 14181  			"         │   │       │           ├─ name: movie_info_idx\n" +
 14182  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 14183  			"         │   │       └─ Filter\n" +
 14184  			"         │   │           ├─ (it2.info = 'rating')\n" +
 14185  			"         │   │           └─ TableAlias(it2)\n" +
 14186  			"         │   │               └─ Table\n" +
 14187  			"         │   │                   ├─ name: info_type\n" +
 14188  			"         │   │                   └─ columns: [id info]\n" +
 14189  			"         │   └─ InnerJoin\n" +
 14190  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 14191  			"         │       ├─ Filter\n" +
 14192  			"         │       │   ├─ (mi.info HASH IN ('Germany', 'German', 'USA', 'American'))\n" +
 14193  			"         │       │   └─ TableAlias(mi)\n" +
 14194  			"         │       │       └─ Table\n" +
 14195  			"         │       │           ├─ name: movie_info\n" +
 14196  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 14197  			"         │       └─ Filter\n" +
 14198  			"         │           ├─ (it1.info = 'countries')\n" +
 14199  			"         │           └─ TableAlias(it1)\n" +
 14200  			"         │               └─ Table\n" +
 14201  			"         │                   ├─ name: info_type\n" +
 14202  			"         │                   └─ columns: [id info]\n" +
 14203  			"         └─ InnerJoin\n" +
 14204  			"             ├─ (k.id = mk.keyword_id)\n" +
 14205  			"             ├─ TableAlias(mk)\n" +
 14206  			"             │   └─ Table\n" +
 14207  			"             │       ├─ name: movie_keyword\n" +
 14208  			"             │       └─ columns: [movie_id keyword_id]\n" +
 14209  			"             └─ Filter\n" +
 14210  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 14211  			"                 └─ TableAlias(k)\n" +
 14212  			"                     └─ Table\n" +
 14213  			"                         ├─ name: keyword\n" +
 14214  			"                         └─ columns: [id keyword]\n" +
 14215  			"",
 14216  		ExpectedAnalysis: "Project\n" +
 14217  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 14218  			" └─ GroupBy\n" +
 14219  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 14220  			"     ├─ Grouping()\n" +
 14221  			"     └─ InnerJoin\n" +
 14222  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 14223  			"         ├─ InnerJoin\n" +
 14224  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 14225  			"         │   ├─ InnerJoin\n" +
 14226  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 14227  			"         │   │   ├─ InnerJoin\n" +
 14228  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 14229  			"         │   │   │   ├─ InnerJoin\n" +
 14230  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 14231  			"         │   │   │   │   ├─ Filter\n" +
 14232  			"         │   │   │   │   │   ├─ (t.production_year > 2009)\n" +
 14233  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14234  			"         │   │   │   │   │       └─ Table\n" +
 14235  			"         │   │   │   │   │           ├─ name: title\n" +
 14236  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 14237  			"         │   │   │   │   └─ Filter\n" +
 14238  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 14239  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14240  			"         │   │   │   │           └─ Table\n" +
 14241  			"         │   │   │   │               ├─ name: kind_type\n" +
 14242  			"         │   │   │   │               └─ columns: [id kind]\n" +
 14243  			"         │   │   │   └─ InnerJoin\n" +
 14244  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 14245  			"         │   │   │       ├─ InnerJoin\n" +
 14246  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 14247  			"         │   │   │       │   ├─ Filter\n" +
 14248  			"         │   │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 14249  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 14250  			"         │   │   │       │   │       └─ Table\n" +
 14251  			"         │   │   │       │   │           ├─ name: movie_companies\n" +
 14252  			"         │   │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 14253  			"         │   │   │       │   └─ Filter\n" +
 14254  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 14255  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14256  			"         │   │   │       │           └─ Table\n" +
 14257  			"         │   │   │       │               ├─ name: company_name\n" +
 14258  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 14259  			"         │   │   │       └─ TableAlias(ct)\n" +
 14260  			"         │   │   │           └─ Table\n" +
 14261  			"         │   │   │               ├─ name: company_type\n" +
 14262  			"         │   │   │               └─ columns: [id]\n" +
 14263  			"         │   │   └─ InnerJoin\n" +
 14264  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 14265  			"         │   │       ├─ Filter\n" +
 14266  			"         │   │       │   ├─ (mi_idx.info < '7.0')\n" +
 14267  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14268  			"         │   │       │       └─ Table\n" +
 14269  			"         │   │       │           ├─ name: movie_info_idx\n" +
 14270  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 14271  			"         │   │       └─ Filter\n" +
 14272  			"         │   │           ├─ (it2.info = 'rating')\n" +
 14273  			"         │   │           └─ TableAlias(it2)\n" +
 14274  			"         │   │               └─ Table\n" +
 14275  			"         │   │                   ├─ name: info_type\n" +
 14276  			"         │   │                   └─ columns: [id info]\n" +
 14277  			"         │   └─ InnerJoin\n" +
 14278  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 14279  			"         │       ├─ Filter\n" +
 14280  			"         │       │   ├─ (mi.info HASH IN ('Germany', 'German', 'USA', 'American'))\n" +
 14281  			"         │       │   └─ TableAlias(mi)\n" +
 14282  			"         │       │       └─ Table\n" +
 14283  			"         │       │           ├─ name: movie_info\n" +
 14284  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 14285  			"         │       └─ Filter\n" +
 14286  			"         │           ├─ (it1.info = 'countries')\n" +
 14287  			"         │           └─ TableAlias(it1)\n" +
 14288  			"         │               └─ Table\n" +
 14289  			"         │                   ├─ name: info_type\n" +
 14290  			"         │                   └─ columns: [id info]\n" +
 14291  			"         └─ InnerJoin\n" +
 14292  			"             ├─ (k.id = mk.keyword_id)\n" +
 14293  			"             ├─ TableAlias(mk)\n" +
 14294  			"             │   └─ Table\n" +
 14295  			"             │       ├─ name: movie_keyword\n" +
 14296  			"             │       └─ columns: [movie_id keyword_id]\n" +
 14297  			"             └─ Filter\n" +
 14298  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 14299  			"                 └─ TableAlias(k)\n" +
 14300  			"                     └─ Table\n" +
 14301  			"                         ├─ name: keyword\n" +
 14302  			"                         └─ columns: [id keyword]\n" +
 14303  			"",
 14304  	},
 14305  	{
 14306  		Query: `
 14307  SELECT MIN(cn.name) AS movie_company,
 14308         MIN(mi_idx.info) AS rating,
 14309         MIN(t.title) AS western_violent_movie
 14310  FROM company_name AS cn,
 14311       company_type AS ct,
 14312       info_type AS it1,
 14313       info_type AS it2,
 14314       keyword AS k,
 14315       kind_type AS kt,
 14316       movie_companies AS mc,
 14317       movie_info AS mi,
 14318       movie_info_idx AS mi_idx,
 14319       movie_keyword AS mk,
 14320       title AS t
 14321  WHERE cn.country_code != '[us]'
 14322    AND it1.info = 'countries'
 14323    AND it2.info = 'rating'
 14324    AND k.keyword IN ('murder',
 14325                      'murder-in-title',
 14326                      'blood',
 14327                      'violence')
 14328    AND kt.kind IN ('movie',
 14329                    'episode')
 14330    AND mc.note NOT LIKE '%(USA)%'
 14331    AND mc.note LIKE '%(200%)%'
 14332    AND mi.info IN ('Sweden',
 14333                    'Norway',
 14334                    'Germany',
 14335                    'Denmark',
 14336                    'Swedish',
 14337                    'Danish',
 14338                    'Norwegian',
 14339                    'German',
 14340                    'USA',
 14341                    'American')
 14342    AND mi_idx.info < '8.5'
 14343    AND t.production_year > 2005
 14344    AND kt.id = t.kind_id
 14345    AND t.id = mi.movie_id
 14346    AND t.id = mk.movie_id
 14347    AND t.id = mi_idx.movie_id
 14348    AND t.id = mc.movie_id
 14349    AND mk.movie_id = mi.movie_id
 14350    AND mk.movie_id = mi_idx.movie_id
 14351    AND mk.movie_id = mc.movie_id
 14352    AND mi.movie_id = mi_idx.movie_id
 14353    AND mi.movie_id = mc.movie_id
 14354    AND mc.movie_id = mi_idx.movie_id
 14355    AND k.id = mk.keyword_id
 14356    AND it1.id = mi.info_type_id
 14357    AND it2.id = mi_idx.info_type_id
 14358    AND ct.id = mc.company_type_id
 14359    AND cn.id = mc.company_id;
 14360  
 14361  `,
 14362  		ExpectedPlan: "Project\n" +
 14363  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as western_violent_movie]\n" +
 14364  			" └─ GroupBy\n" +
 14365  			"     ├─ select: MIN(cn.name:11!null), MIN(mi_idx.info:16!null), MIN(t.title:1!null)\n" +
 14366  			"     ├─ group: \n" +
 14367  			"     └─ InnerJoin\n" +
 14368  			"         ├─ AND\n" +
 14369  			"         │   ├─ AND\n" +
 14370  			"         │   │   ├─ AND\n" +
 14371  			"         │   │   │   ├─ Eq\n" +
 14372  			"         │   │   │   │   ├─ mk.movie_id:24!null\n" +
 14373  			"         │   │   │   │   └─ mi.movie_id:19!null\n" +
 14374  			"         │   │   │   └─ Eq\n" +
 14375  			"         │   │   │       ├─ mk.movie_id:24!null\n" +
 14376  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 14377  			"         │   │   └─ Eq\n" +
 14378  			"         │   │       ├─ mk.movie_id:24!null\n" +
 14379  			"         │   │       └─ mc.movie_id:6!null\n" +
 14380  			"         │   └─ Eq\n" +
 14381  			"         │       ├─ t.id:0!null\n" +
 14382  			"         │       └─ mk.movie_id:24!null\n" +
 14383  			"         ├─ InnerJoin\n" +
 14384  			"         │   ├─ AND\n" +
 14385  			"         │   │   ├─ AND\n" +
 14386  			"         │   │   │   ├─ Eq\n" +
 14387  			"         │   │   │   │   ├─ mi.movie_id:19!null\n" +
 14388  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 14389  			"         │   │   │   └─ Eq\n" +
 14390  			"         │   │   │       ├─ mi.movie_id:19!null\n" +
 14391  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 14392  			"         │   │   └─ Eq\n" +
 14393  			"         │   │       ├─ t.id:0!null\n" +
 14394  			"         │   │       └─ mi.movie_id:19!null\n" +
 14395  			"         │   ├─ InnerJoin\n" +
 14396  			"         │   │   ├─ AND\n" +
 14397  			"         │   │   │   ├─ Eq\n" +
 14398  			"         │   │   │   │   ├─ mc.movie_id:6!null\n" +
 14399  			"         │   │   │   │   └─ mi_idx.movie_id:14!null\n" +
 14400  			"         │   │   │   └─ Eq\n" +
 14401  			"         │   │   │       ├─ t.id:0!null\n" +
 14402  			"         │   │   │       └─ mi_idx.movie_id:14!null\n" +
 14403  			"         │   │   ├─ InnerJoin\n" +
 14404  			"         │   │   │   ├─ Eq\n" +
 14405  			"         │   │   │   │   ├─ t.id:0!null\n" +
 14406  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 14407  			"         │   │   │   ├─ InnerJoin\n" +
 14408  			"         │   │   │   │   ├─ Eq\n" +
 14409  			"         │   │   │   │   │   ├─ kt.id:4!null\n" +
 14410  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 14411  			"         │   │   │   │   ├─ Filter\n" +
 14412  			"         │   │   │   │   │   ├─ GreaterThan\n" +
 14413  			"         │   │   │   │   │   │   ├─ t.production_year:3\n" +
 14414  			"         │   │   │   │   │   │   └─ 2005 (smallint)\n" +
 14415  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14416  			"         │   │   │   │   │       └─ ProcessTable\n" +
 14417  			"         │   │   │   │   │           └─ Table\n" +
 14418  			"         │   │   │   │   │               ├─ name: title\n" +
 14419  			"         │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 14420  			"         │   │   │   │   └─ Filter\n" +
 14421  			"         │   │   │   │       ├─ HashIn\n" +
 14422  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 14423  			"         │   │   │   │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
 14424  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14425  			"         │   │   │   │           └─ ProcessTable\n" +
 14426  			"         │   │   │   │               └─ Table\n" +
 14427  			"         │   │   │   │                   ├─ name: kind_type\n" +
 14428  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 14429  			"         │   │   │   └─ InnerJoin\n" +
 14430  			"         │   │   │       ├─ Eq\n" +
 14431  			"         │   │   │       │   ├─ ct.id:13!null\n" +
 14432  			"         │   │   │       │   └─ mc.company_type_id:8!null\n" +
 14433  			"         │   │   │       ├─ InnerJoin\n" +
 14434  			"         │   │   │       │   ├─ Eq\n" +
 14435  			"         │   │   │       │   │   ├─ cn.id:10!null\n" +
 14436  			"         │   │   │       │   │   └─ mc.company_id:7!null\n" +
 14437  			"         │   │   │       │   ├─ Filter\n" +
 14438  			"         │   │   │       │   │   ├─ AND\n" +
 14439  			"         │   │   │       │   │   │   ├─ NOT\n" +
 14440  			"         │   │   │       │   │   │   │   └─ mc.note LIKE '%(USA)%'\n" +
 14441  			"         │   │   │       │   │   │   └─ mc.note LIKE '%(200%)%'\n" +
 14442  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 14443  			"         │   │   │       │   │       └─ ProcessTable\n" +
 14444  			"         │   │   │       │   │           └─ Table\n" +
 14445  			"         │   │   │       │   │               ├─ name: movie_companies\n" +
 14446  			"         │   │   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 14447  			"         │   │   │       │   └─ Filter\n" +
 14448  			"         │   │   │       │       ├─ NOT\n" +
 14449  			"         │   │   │       │       │   └─ Eq\n" +
 14450  			"         │   │   │       │       │       ├─ cn.country_code:2\n" +
 14451  			"         │   │   │       │       │       └─ [us] (longtext)\n" +
 14452  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14453  			"         │   │   │       │           └─ ProcessTable\n" +
 14454  			"         │   │   │       │               └─ Table\n" +
 14455  			"         │   │   │       │                   ├─ name: company_name\n" +
 14456  			"         │   │   │       │                   └─ columns: [id name country_code]\n" +
 14457  			"         │   │   │       └─ TableAlias(ct)\n" +
 14458  			"         │   │   │           └─ ProcessTable\n" +
 14459  			"         │   │   │               └─ Table\n" +
 14460  			"         │   │   │                   ├─ name: company_type\n" +
 14461  			"         │   │   │                   └─ columns: [id]\n" +
 14462  			"         │   │   └─ InnerJoin\n" +
 14463  			"         │   │       ├─ Eq\n" +
 14464  			"         │   │       │   ├─ it2.id:17!null\n" +
 14465  			"         │   │       │   └─ mi_idx.info_type_id:15!null\n" +
 14466  			"         │   │       ├─ Filter\n" +
 14467  			"         │   │       │   ├─ LessThan\n" +
 14468  			"         │   │       │   │   ├─ mi_idx.info:2!null\n" +
 14469  			"         │   │       │   │   └─ 8.5 (longtext)\n" +
 14470  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14471  			"         │   │       │       └─ ProcessTable\n" +
 14472  			"         │   │       │           └─ Table\n" +
 14473  			"         │   │       │               ├─ name: movie_info_idx\n" +
 14474  			"         │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 14475  			"         │   │       └─ Filter\n" +
 14476  			"         │   │           ├─ Eq\n" +
 14477  			"         │   │           │   ├─ it2.info:1!null\n" +
 14478  			"         │   │           │   └─ rating (longtext)\n" +
 14479  			"         │   │           └─ TableAlias(it2)\n" +
 14480  			"         │   │               └─ ProcessTable\n" +
 14481  			"         │   │                   └─ Table\n" +
 14482  			"         │   │                       ├─ name: info_type\n" +
 14483  			"         │   │                       └─ columns: [id info]\n" +
 14484  			"         │   └─ InnerJoin\n" +
 14485  			"         │       ├─ Eq\n" +
 14486  			"         │       │   ├─ it1.id:22!null\n" +
 14487  			"         │       │   └─ mi.info_type_id:20!null\n" +
 14488  			"         │       ├─ Filter\n" +
 14489  			"         │       │   ├─ HashIn\n" +
 14490  			"         │       │   │   ├─ mi.info:2!null\n" +
 14491  			"         │       │   │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Danish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 14492  			"         │       │   └─ TableAlias(mi)\n" +
 14493  			"         │       │       └─ ProcessTable\n" +
 14494  			"         │       │           └─ Table\n" +
 14495  			"         │       │               ├─ name: movie_info\n" +
 14496  			"         │       │               └─ columns: [movie_id info_type_id info]\n" +
 14497  			"         │       └─ Filter\n" +
 14498  			"         │           ├─ Eq\n" +
 14499  			"         │           │   ├─ it1.info:1!null\n" +
 14500  			"         │           │   └─ countries (longtext)\n" +
 14501  			"         │           └─ TableAlias(it1)\n" +
 14502  			"         │               └─ Table\n" +
 14503  			"         │                   ├─ name: info_type\n" +
 14504  			"         │                   ├─ columns: [id info]\n" +
 14505  			"         │                   ├─ colSet: (10,11)\n" +
 14506  			"         │                   └─ tableId: 3\n" +
 14507  			"         └─ InnerJoin\n" +
 14508  			"             ├─ Eq\n" +
 14509  			"             │   ├─ k.id:26!null\n" +
 14510  			"             │   └─ mk.keyword_id:25!null\n" +
 14511  			"             ├─ TableAlias(mk)\n" +
 14512  			"             │   └─ ProcessTable\n" +
 14513  			"             │       └─ Table\n" +
 14514  			"             │           ├─ name: movie_keyword\n" +
 14515  			"             │           └─ columns: [movie_id keyword_id]\n" +
 14516  			"             └─ Filter\n" +
 14517  			"                 ├─ HashIn\n" +
 14518  			"                 │   ├─ k.keyword:1!null\n" +
 14519  			"                 │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
 14520  			"                 └─ TableAlias(k)\n" +
 14521  			"                     └─ ProcessTable\n" +
 14522  			"                         └─ Table\n" +
 14523  			"                             ├─ name: keyword\n" +
 14524  			"                             └─ columns: [id keyword]\n" +
 14525  			"",
 14526  		ExpectedEstimates: "Project\n" +
 14527  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 14528  			" └─ GroupBy\n" +
 14529  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 14530  			"     ├─ Grouping()\n" +
 14531  			"     └─ InnerJoin\n" +
 14532  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 14533  			"         ├─ InnerJoin\n" +
 14534  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 14535  			"         │   ├─ InnerJoin\n" +
 14536  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 14537  			"         │   │   ├─ InnerJoin\n" +
 14538  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 14539  			"         │   │   │   ├─ InnerJoin\n" +
 14540  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 14541  			"         │   │   │   │   ├─ Filter\n" +
 14542  			"         │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 14543  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14544  			"         │   │   │   │   │       └─ Table\n" +
 14545  			"         │   │   │   │   │           ├─ name: title\n" +
 14546  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 14547  			"         │   │   │   │   └─ Filter\n" +
 14548  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 14549  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14550  			"         │   │   │   │           └─ Table\n" +
 14551  			"         │   │   │   │               ├─ name: kind_type\n" +
 14552  			"         │   │   │   │               └─ columns: [id kind]\n" +
 14553  			"         │   │   │   └─ InnerJoin\n" +
 14554  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 14555  			"         │   │   │       ├─ InnerJoin\n" +
 14556  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 14557  			"         │   │   │       │   ├─ Filter\n" +
 14558  			"         │   │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 14559  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 14560  			"         │   │   │       │   │       └─ Table\n" +
 14561  			"         │   │   │       │   │           ├─ name: movie_companies\n" +
 14562  			"         │   │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 14563  			"         │   │   │       │   └─ Filter\n" +
 14564  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 14565  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14566  			"         │   │   │       │           └─ Table\n" +
 14567  			"         │   │   │       │               ├─ name: company_name\n" +
 14568  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 14569  			"         │   │   │       └─ TableAlias(ct)\n" +
 14570  			"         │   │   │           └─ Table\n" +
 14571  			"         │   │   │               ├─ name: company_type\n" +
 14572  			"         │   │   │               └─ columns: [id]\n" +
 14573  			"         │   │   └─ InnerJoin\n" +
 14574  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 14575  			"         │   │       ├─ Filter\n" +
 14576  			"         │   │       │   ├─ (mi_idx.info < '8.5')\n" +
 14577  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14578  			"         │   │       │       └─ Table\n" +
 14579  			"         │   │       │           ├─ name: movie_info_idx\n" +
 14580  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 14581  			"         │   │       └─ Filter\n" +
 14582  			"         │   │           ├─ (it2.info = 'rating')\n" +
 14583  			"         │   │           └─ TableAlias(it2)\n" +
 14584  			"         │   │               └─ Table\n" +
 14585  			"         │   │                   ├─ name: info_type\n" +
 14586  			"         │   │                   └─ columns: [id info]\n" +
 14587  			"         │   └─ InnerJoin\n" +
 14588  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 14589  			"         │       ├─ Filter\n" +
 14590  			"         │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 14591  			"         │       │   └─ TableAlias(mi)\n" +
 14592  			"         │       │       └─ Table\n" +
 14593  			"         │       │           ├─ name: movie_info\n" +
 14594  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 14595  			"         │       └─ Filter\n" +
 14596  			"         │           ├─ (it1.info = 'countries')\n" +
 14597  			"         │           └─ TableAlias(it1)\n" +
 14598  			"         │               └─ Table\n" +
 14599  			"         │                   ├─ name: info_type\n" +
 14600  			"         │                   └─ columns: [id info]\n" +
 14601  			"         └─ InnerJoin\n" +
 14602  			"             ├─ (k.id = mk.keyword_id)\n" +
 14603  			"             ├─ TableAlias(mk)\n" +
 14604  			"             │   └─ Table\n" +
 14605  			"             │       ├─ name: movie_keyword\n" +
 14606  			"             │       └─ columns: [movie_id keyword_id]\n" +
 14607  			"             └─ Filter\n" +
 14608  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 14609  			"                 └─ TableAlias(k)\n" +
 14610  			"                     └─ Table\n" +
 14611  			"                         ├─ name: keyword\n" +
 14612  			"                         └─ columns: [id keyword]\n" +
 14613  			"",
 14614  		ExpectedAnalysis: "Project\n" +
 14615  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 14616  			" └─ GroupBy\n" +
 14617  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 14618  			"     ├─ Grouping()\n" +
 14619  			"     └─ InnerJoin\n" +
 14620  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 14621  			"         ├─ InnerJoin\n" +
 14622  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 14623  			"         │   ├─ InnerJoin\n" +
 14624  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 14625  			"         │   │   ├─ InnerJoin\n" +
 14626  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 14627  			"         │   │   │   ├─ InnerJoin\n" +
 14628  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 14629  			"         │   │   │   │   ├─ Filter\n" +
 14630  			"         │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 14631  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14632  			"         │   │   │   │   │       └─ Table\n" +
 14633  			"         │   │   │   │   │           ├─ name: title\n" +
 14634  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 14635  			"         │   │   │   │   └─ Filter\n" +
 14636  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 14637  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14638  			"         │   │   │   │           └─ Table\n" +
 14639  			"         │   │   │   │               ├─ name: kind_type\n" +
 14640  			"         │   │   │   │               └─ columns: [id kind]\n" +
 14641  			"         │   │   │   └─ InnerJoin\n" +
 14642  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 14643  			"         │   │   │       ├─ InnerJoin\n" +
 14644  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 14645  			"         │   │   │       │   ├─ Filter\n" +
 14646  			"         │   │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 14647  			"         │   │   │       │   │   └─ TableAlias(mc)\n" +
 14648  			"         │   │   │       │   │       └─ Table\n" +
 14649  			"         │   │   │       │   │           ├─ name: movie_companies\n" +
 14650  			"         │   │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 14651  			"         │   │   │       │   └─ Filter\n" +
 14652  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 14653  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14654  			"         │   │   │       │           └─ Table\n" +
 14655  			"         │   │   │       │               ├─ name: company_name\n" +
 14656  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 14657  			"         │   │   │       └─ TableAlias(ct)\n" +
 14658  			"         │   │   │           └─ Table\n" +
 14659  			"         │   │   │               ├─ name: company_type\n" +
 14660  			"         │   │   │               └─ columns: [id]\n" +
 14661  			"         │   │   └─ InnerJoin\n" +
 14662  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 14663  			"         │   │       ├─ Filter\n" +
 14664  			"         │   │       │   ├─ (mi_idx.info < '8.5')\n" +
 14665  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14666  			"         │   │       │       └─ Table\n" +
 14667  			"         │   │       │           ├─ name: movie_info_idx\n" +
 14668  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 14669  			"         │   │       └─ Filter\n" +
 14670  			"         │   │           ├─ (it2.info = 'rating')\n" +
 14671  			"         │   │           └─ TableAlias(it2)\n" +
 14672  			"         │   │               └─ Table\n" +
 14673  			"         │   │                   ├─ name: info_type\n" +
 14674  			"         │   │                   └─ columns: [id info]\n" +
 14675  			"         │   └─ InnerJoin\n" +
 14676  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 14677  			"         │       ├─ Filter\n" +
 14678  			"         │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 14679  			"         │       │   └─ TableAlias(mi)\n" +
 14680  			"         │       │       └─ Table\n" +
 14681  			"         │       │           ├─ name: movie_info\n" +
 14682  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 14683  			"         │       └─ Filter\n" +
 14684  			"         │           ├─ (it1.info = 'countries')\n" +
 14685  			"         │           └─ TableAlias(it1)\n" +
 14686  			"         │               └─ Table\n" +
 14687  			"         │                   ├─ name: info_type\n" +
 14688  			"         │                   └─ columns: [id info]\n" +
 14689  			"         └─ InnerJoin\n" +
 14690  			"             ├─ (k.id = mk.keyword_id)\n" +
 14691  			"             ├─ TableAlias(mk)\n" +
 14692  			"             │   └─ Table\n" +
 14693  			"             │       ├─ name: movie_keyword\n" +
 14694  			"             │       └─ columns: [movie_id keyword_id]\n" +
 14695  			"             └─ Filter\n" +
 14696  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 14697  			"                 └─ TableAlias(k)\n" +
 14698  			"                     └─ Table\n" +
 14699  			"                         ├─ name: keyword\n" +
 14700  			"                         └─ columns: [id keyword]\n" +
 14701  			"",
 14702  	},
 14703  	{
 14704  		Query: `
 14705  SELECT MIN(cn.name) AS movie_company,
 14706         MIN(mi_idx.info) AS rating,
 14707         MIN(t.title) AS western_violent_movie
 14708  FROM company_name AS cn,
 14709       company_type AS ct,
 14710       info_type AS it1,
 14711       info_type AS it2,
 14712       keyword AS k,
 14713       kind_type AS kt,
 14714       movie_companies AS mc,
 14715       movie_info AS mi,
 14716       movie_info_idx AS mi_idx,
 14717       movie_keyword AS mk,
 14718       title AS t
 14719  WHERE cn.country_code != '[us]'
 14720    AND it1.info = 'countries'
 14721    AND it2.info = 'rating'
 14722    AND k.keyword IN ('murder',
 14723                      'murder-in-title',
 14724                      'blood',
 14725                      'violence')
 14726    AND kt.kind IN ('movie',
 14727                    'episode')
 14728    AND mi.info IN ('Sweden',
 14729                    'Norway',
 14730                    'Germany',
 14731                    'Denmark',
 14732                    'Swedish',
 14733                    'Danish',
 14734                    'Norwegian',
 14735                    'German',
 14736                    'USA',
 14737                    'American')
 14738    AND mi_idx.info < '8.5'
 14739    AND t.production_year > 2005
 14740    AND kt.id = t.kind_id
 14741    AND t.id = mi.movie_id
 14742    AND t.id = mk.movie_id
 14743    AND t.id = mi_idx.movie_id
 14744    AND t.id = mc.movie_id
 14745    AND mk.movie_id = mi.movie_id
 14746    AND mk.movie_id = mi_idx.movie_id
 14747    AND mk.movie_id = mc.movie_id
 14748    AND mi.movie_id = mi_idx.movie_id
 14749    AND mi.movie_id = mc.movie_id
 14750    AND mc.movie_id = mi_idx.movie_id
 14751    AND k.id = mk.keyword_id
 14752    AND it1.id = mi.info_type_id
 14753    AND it2.id = mi_idx.info_type_id
 14754    AND ct.id = mc.company_type_id
 14755    AND cn.id = mc.company_id;
 14756  
 14757  `,
 14758  		ExpectedPlan: "Project\n" +
 14759  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as western_violent_movie]\n" +
 14760  			" └─ GroupBy\n" +
 14761  			"     ├─ select: MIN(cn.name:10!null), MIN(mi_idx.info:15!null), MIN(t.title:1!null)\n" +
 14762  			"     ├─ group: \n" +
 14763  			"     └─ InnerJoin\n" +
 14764  			"         ├─ AND\n" +
 14765  			"         │   ├─ AND\n" +
 14766  			"         │   │   ├─ AND\n" +
 14767  			"         │   │   │   ├─ Eq\n" +
 14768  			"         │   │   │   │   ├─ mk.movie_id:23!null\n" +
 14769  			"         │   │   │   │   └─ mi.movie_id:18!null\n" +
 14770  			"         │   │   │   └─ Eq\n" +
 14771  			"         │   │   │       ├─ mk.movie_id:23!null\n" +
 14772  			"         │   │   │       └─ mi_idx.movie_id:13!null\n" +
 14773  			"         │   │   └─ Eq\n" +
 14774  			"         │   │       ├─ mk.movie_id:23!null\n" +
 14775  			"         │   │       └─ mc.movie_id:6!null\n" +
 14776  			"         │   └─ Eq\n" +
 14777  			"         │       ├─ t.id:0!null\n" +
 14778  			"         │       └─ mk.movie_id:23!null\n" +
 14779  			"         ├─ InnerJoin\n" +
 14780  			"         │   ├─ AND\n" +
 14781  			"         │   │   ├─ AND\n" +
 14782  			"         │   │   │   ├─ Eq\n" +
 14783  			"         │   │   │   │   ├─ mi.movie_id:18!null\n" +
 14784  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 14785  			"         │   │   │   └─ Eq\n" +
 14786  			"         │   │   │       ├─ mi.movie_id:18!null\n" +
 14787  			"         │   │   │       └─ mi_idx.movie_id:13!null\n" +
 14788  			"         │   │   └─ Eq\n" +
 14789  			"         │   │       ├─ t.id:0!null\n" +
 14790  			"         │   │       └─ mi.movie_id:18!null\n" +
 14791  			"         │   ├─ InnerJoin\n" +
 14792  			"         │   │   ├─ AND\n" +
 14793  			"         │   │   │   ├─ Eq\n" +
 14794  			"         │   │   │   │   ├─ mc.movie_id:6!null\n" +
 14795  			"         │   │   │   │   └─ mi_idx.movie_id:13!null\n" +
 14796  			"         │   │   │   └─ Eq\n" +
 14797  			"         │   │   │       ├─ t.id:0!null\n" +
 14798  			"         │   │   │       └─ mi_idx.movie_id:13!null\n" +
 14799  			"         │   │   ├─ InnerJoin\n" +
 14800  			"         │   │   │   ├─ Eq\n" +
 14801  			"         │   │   │   │   ├─ t.id:0!null\n" +
 14802  			"         │   │   │   │   └─ mc.movie_id:6!null\n" +
 14803  			"         │   │   │   ├─ InnerJoin\n" +
 14804  			"         │   │   │   │   ├─ Eq\n" +
 14805  			"         │   │   │   │   │   ├─ kt.id:4!null\n" +
 14806  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 14807  			"         │   │   │   │   ├─ Filter\n" +
 14808  			"         │   │   │   │   │   ├─ GreaterThan\n" +
 14809  			"         │   │   │   │   │   │   ├─ t.production_year:3\n" +
 14810  			"         │   │   │   │   │   │   └─ 2005 (smallint)\n" +
 14811  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14812  			"         │   │   │   │   │       └─ ProcessTable\n" +
 14813  			"         │   │   │   │   │           └─ Table\n" +
 14814  			"         │   │   │   │   │               ├─ name: title\n" +
 14815  			"         │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 14816  			"         │   │   │   │   └─ Filter\n" +
 14817  			"         │   │   │   │       ├─ HashIn\n" +
 14818  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 14819  			"         │   │   │   │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
 14820  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14821  			"         │   │   │   │           └─ ProcessTable\n" +
 14822  			"         │   │   │   │               └─ Table\n" +
 14823  			"         │   │   │   │                   ├─ name: kind_type\n" +
 14824  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 14825  			"         │   │   │   └─ InnerJoin\n" +
 14826  			"         │   │   │       ├─ Eq\n" +
 14827  			"         │   │   │       │   ├─ ct.id:12!null\n" +
 14828  			"         │   │   │       │   └─ mc.company_type_id:8!null\n" +
 14829  			"         │   │   │       ├─ InnerJoin\n" +
 14830  			"         │   │   │       │   ├─ Eq\n" +
 14831  			"         │   │   │       │   │   ├─ cn.id:9!null\n" +
 14832  			"         │   │   │       │   │   └─ mc.company_id:7!null\n" +
 14833  			"         │   │   │       │   ├─ TableAlias(mc)\n" +
 14834  			"         │   │   │       │   │   └─ ProcessTable\n" +
 14835  			"         │   │   │       │   │       └─ Table\n" +
 14836  			"         │   │   │       │   │           ├─ name: movie_companies\n" +
 14837  			"         │   │   │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
 14838  			"         │   │   │       │   └─ Filter\n" +
 14839  			"         │   │   │       │       ├─ NOT\n" +
 14840  			"         │   │   │       │       │   └─ Eq\n" +
 14841  			"         │   │   │       │       │       ├─ cn.country_code:2\n" +
 14842  			"         │   │   │       │       │       └─ [us] (longtext)\n" +
 14843  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14844  			"         │   │   │       │           └─ ProcessTable\n" +
 14845  			"         │   │   │       │               └─ Table\n" +
 14846  			"         │   │   │       │                   ├─ name: company_name\n" +
 14847  			"         │   │   │       │                   └─ columns: [id name country_code]\n" +
 14848  			"         │   │   │       └─ TableAlias(ct)\n" +
 14849  			"         │   │   │           └─ ProcessTable\n" +
 14850  			"         │   │   │               └─ Table\n" +
 14851  			"         │   │   │                   ├─ name: company_type\n" +
 14852  			"         │   │   │                   └─ columns: [id]\n" +
 14853  			"         │   │   └─ InnerJoin\n" +
 14854  			"         │   │       ├─ Eq\n" +
 14855  			"         │   │       │   ├─ it2.id:16!null\n" +
 14856  			"         │   │       │   └─ mi_idx.info_type_id:14!null\n" +
 14857  			"         │   │       ├─ Filter\n" +
 14858  			"         │   │       │   ├─ LessThan\n" +
 14859  			"         │   │       │   │   ├─ mi_idx.info:2!null\n" +
 14860  			"         │   │       │   │   └─ 8.5 (longtext)\n" +
 14861  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14862  			"         │   │       │       └─ ProcessTable\n" +
 14863  			"         │   │       │           └─ Table\n" +
 14864  			"         │   │       │               ├─ name: movie_info_idx\n" +
 14865  			"         │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 14866  			"         │   │       └─ Filter\n" +
 14867  			"         │   │           ├─ Eq\n" +
 14868  			"         │   │           │   ├─ it2.info:1!null\n" +
 14869  			"         │   │           │   └─ rating (longtext)\n" +
 14870  			"         │   │           └─ TableAlias(it2)\n" +
 14871  			"         │   │               └─ ProcessTable\n" +
 14872  			"         │   │                   └─ Table\n" +
 14873  			"         │   │                       ├─ name: info_type\n" +
 14874  			"         │   │                       └─ columns: [id info]\n" +
 14875  			"         │   └─ InnerJoin\n" +
 14876  			"         │       ├─ Eq\n" +
 14877  			"         │       │   ├─ it1.id:21!null\n" +
 14878  			"         │       │   └─ mi.info_type_id:19!null\n" +
 14879  			"         │       ├─ Filter\n" +
 14880  			"         │       │   ├─ HashIn\n" +
 14881  			"         │       │   │   ├─ mi.info:2!null\n" +
 14882  			"         │       │   │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Danish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 14883  			"         │       │   └─ TableAlias(mi)\n" +
 14884  			"         │       │       └─ ProcessTable\n" +
 14885  			"         │       │           └─ Table\n" +
 14886  			"         │       │               ├─ name: movie_info\n" +
 14887  			"         │       │               └─ columns: [movie_id info_type_id info]\n" +
 14888  			"         │       └─ Filter\n" +
 14889  			"         │           ├─ Eq\n" +
 14890  			"         │           │   ├─ it1.info:1!null\n" +
 14891  			"         │           │   └─ countries (longtext)\n" +
 14892  			"         │           └─ TableAlias(it1)\n" +
 14893  			"         │               └─ Table\n" +
 14894  			"         │                   ├─ name: info_type\n" +
 14895  			"         │                   ├─ columns: [id info]\n" +
 14896  			"         │                   ├─ colSet: (10,11)\n" +
 14897  			"         │                   └─ tableId: 3\n" +
 14898  			"         └─ InnerJoin\n" +
 14899  			"             ├─ Eq\n" +
 14900  			"             │   ├─ k.id:25!null\n" +
 14901  			"             │   └─ mk.keyword_id:24!null\n" +
 14902  			"             ├─ TableAlias(mk)\n" +
 14903  			"             │   └─ ProcessTable\n" +
 14904  			"             │       └─ Table\n" +
 14905  			"             │           ├─ name: movie_keyword\n" +
 14906  			"             │           └─ columns: [movie_id keyword_id]\n" +
 14907  			"             └─ Filter\n" +
 14908  			"                 ├─ HashIn\n" +
 14909  			"                 │   ├─ k.keyword:1!null\n" +
 14910  			"                 │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
 14911  			"                 └─ TableAlias(k)\n" +
 14912  			"                     └─ ProcessTable\n" +
 14913  			"                         └─ Table\n" +
 14914  			"                             ├─ name: keyword\n" +
 14915  			"                             └─ columns: [id keyword]\n" +
 14916  			"",
 14917  		ExpectedEstimates: "Project\n" +
 14918  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 14919  			" └─ GroupBy\n" +
 14920  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 14921  			"     ├─ Grouping()\n" +
 14922  			"     └─ InnerJoin\n" +
 14923  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 14924  			"         ├─ InnerJoin\n" +
 14925  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 14926  			"         │   ├─ InnerJoin\n" +
 14927  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 14928  			"         │   │   ├─ InnerJoin\n" +
 14929  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 14930  			"         │   │   │   ├─ InnerJoin\n" +
 14931  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 14932  			"         │   │   │   │   ├─ Filter\n" +
 14933  			"         │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 14934  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 14935  			"         │   │   │   │   │       └─ Table\n" +
 14936  			"         │   │   │   │   │           ├─ name: title\n" +
 14937  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 14938  			"         │   │   │   │   └─ Filter\n" +
 14939  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 14940  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 14941  			"         │   │   │   │           └─ Table\n" +
 14942  			"         │   │   │   │               ├─ name: kind_type\n" +
 14943  			"         │   │   │   │               └─ columns: [id kind]\n" +
 14944  			"         │   │   │   └─ InnerJoin\n" +
 14945  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 14946  			"         │   │   │       ├─ InnerJoin\n" +
 14947  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 14948  			"         │   │   │       │   ├─ TableAlias(mc)\n" +
 14949  			"         │   │   │       │   │   └─ Table\n" +
 14950  			"         │   │   │       │   │       ├─ name: movie_companies\n" +
 14951  			"         │   │   │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 14952  			"         │   │   │       │   └─ Filter\n" +
 14953  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 14954  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 14955  			"         │   │   │       │           └─ Table\n" +
 14956  			"         │   │   │       │               ├─ name: company_name\n" +
 14957  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 14958  			"         │   │   │       └─ TableAlias(ct)\n" +
 14959  			"         │   │   │           └─ Table\n" +
 14960  			"         │   │   │               ├─ name: company_type\n" +
 14961  			"         │   │   │               └─ columns: [id]\n" +
 14962  			"         │   │   └─ InnerJoin\n" +
 14963  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 14964  			"         │   │       ├─ Filter\n" +
 14965  			"         │   │       │   ├─ (mi_idx.info < '8.5')\n" +
 14966  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 14967  			"         │   │       │       └─ Table\n" +
 14968  			"         │   │       │           ├─ name: movie_info_idx\n" +
 14969  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 14970  			"         │   │       └─ Filter\n" +
 14971  			"         │   │           ├─ (it2.info = 'rating')\n" +
 14972  			"         │   │           └─ TableAlias(it2)\n" +
 14973  			"         │   │               └─ Table\n" +
 14974  			"         │   │                   ├─ name: info_type\n" +
 14975  			"         │   │                   └─ columns: [id info]\n" +
 14976  			"         │   └─ InnerJoin\n" +
 14977  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 14978  			"         │       ├─ Filter\n" +
 14979  			"         │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 14980  			"         │       │   └─ TableAlias(mi)\n" +
 14981  			"         │       │       └─ Table\n" +
 14982  			"         │       │           ├─ name: movie_info\n" +
 14983  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 14984  			"         │       └─ Filter\n" +
 14985  			"         │           ├─ (it1.info = 'countries')\n" +
 14986  			"         │           └─ TableAlias(it1)\n" +
 14987  			"         │               └─ Table\n" +
 14988  			"         │                   ├─ name: info_type\n" +
 14989  			"         │                   └─ columns: [id info]\n" +
 14990  			"         └─ InnerJoin\n" +
 14991  			"             ├─ (k.id = mk.keyword_id)\n" +
 14992  			"             ├─ TableAlias(mk)\n" +
 14993  			"             │   └─ Table\n" +
 14994  			"             │       ├─ name: movie_keyword\n" +
 14995  			"             │       └─ columns: [movie_id keyword_id]\n" +
 14996  			"             └─ Filter\n" +
 14997  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 14998  			"                 └─ TableAlias(k)\n" +
 14999  			"                     └─ Table\n" +
 15000  			"                         ├─ name: keyword\n" +
 15001  			"                         └─ columns: [id keyword]\n" +
 15002  			"",
 15003  		ExpectedAnalysis: "Project\n" +
 15004  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as western_violent_movie]\n" +
 15005  			" └─ GroupBy\n" +
 15006  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 15007  			"     ├─ Grouping()\n" +
 15008  			"     └─ InnerJoin\n" +
 15009  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mi_idx.movie_id)) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 15010  			"         ├─ InnerJoin\n" +
 15011  			"         │   ├─ (((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id)) AND (t.id = mi.movie_id))\n" +
 15012  			"         │   ├─ InnerJoin\n" +
 15013  			"         │   │   ├─ ((mc.movie_id = mi_idx.movie_id) AND (t.id = mi_idx.movie_id))\n" +
 15014  			"         │   │   ├─ InnerJoin\n" +
 15015  			"         │   │   │   ├─ (t.id = mc.movie_id)\n" +
 15016  			"         │   │   │   ├─ InnerJoin\n" +
 15017  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 15018  			"         │   │   │   │   ├─ Filter\n" +
 15019  			"         │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 15020  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15021  			"         │   │   │   │   │       └─ Table\n" +
 15022  			"         │   │   │   │   │           ├─ name: title\n" +
 15023  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 15024  			"         │   │   │   │   └─ Filter\n" +
 15025  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 15026  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 15027  			"         │   │   │   │           └─ Table\n" +
 15028  			"         │   │   │   │               ├─ name: kind_type\n" +
 15029  			"         │   │   │   │               └─ columns: [id kind]\n" +
 15030  			"         │   │   │   └─ InnerJoin\n" +
 15031  			"         │   │   │       ├─ (ct.id = mc.company_type_id)\n" +
 15032  			"         │   │   │       ├─ InnerJoin\n" +
 15033  			"         │   │   │       │   ├─ (cn.id = mc.company_id)\n" +
 15034  			"         │   │   │       │   ├─ TableAlias(mc)\n" +
 15035  			"         │   │   │       │   │   └─ Table\n" +
 15036  			"         │   │   │       │   │       ├─ name: movie_companies\n" +
 15037  			"         │   │   │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 15038  			"         │   │   │       │   └─ Filter\n" +
 15039  			"         │   │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 15040  			"         │   │   │       │       └─ TableAlias(cn)\n" +
 15041  			"         │   │   │       │           └─ Table\n" +
 15042  			"         │   │   │       │               ├─ name: company_name\n" +
 15043  			"         │   │   │       │               └─ columns: [id name country_code]\n" +
 15044  			"         │   │   │       └─ TableAlias(ct)\n" +
 15045  			"         │   │   │           └─ Table\n" +
 15046  			"         │   │   │               ├─ name: company_type\n" +
 15047  			"         │   │   │               └─ columns: [id]\n" +
 15048  			"         │   │   └─ InnerJoin\n" +
 15049  			"         │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 15050  			"         │   │       ├─ Filter\n" +
 15051  			"         │   │       │   ├─ (mi_idx.info < '8.5')\n" +
 15052  			"         │   │       │   └─ TableAlias(mi_idx)\n" +
 15053  			"         │   │       │       └─ Table\n" +
 15054  			"         │   │       │           ├─ name: movie_info_idx\n" +
 15055  			"         │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 15056  			"         │   │       └─ Filter\n" +
 15057  			"         │   │           ├─ (it2.info = 'rating')\n" +
 15058  			"         │   │           └─ TableAlias(it2)\n" +
 15059  			"         │   │               └─ Table\n" +
 15060  			"         │   │                   ├─ name: info_type\n" +
 15061  			"         │   │                   └─ columns: [id info]\n" +
 15062  			"         │   └─ InnerJoin\n" +
 15063  			"         │       ├─ (it1.id = mi.info_type_id)\n" +
 15064  			"         │       ├─ Filter\n" +
 15065  			"         │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 15066  			"         │       │   └─ TableAlias(mi)\n" +
 15067  			"         │       │       └─ Table\n" +
 15068  			"         │       │           ├─ name: movie_info\n" +
 15069  			"         │       │           └─ columns: [movie_id info_type_id info]\n" +
 15070  			"         │       └─ Filter\n" +
 15071  			"         │           ├─ (it1.info = 'countries')\n" +
 15072  			"         │           └─ TableAlias(it1)\n" +
 15073  			"         │               └─ Table\n" +
 15074  			"         │                   ├─ name: info_type\n" +
 15075  			"         │                   └─ columns: [id info]\n" +
 15076  			"         └─ InnerJoin\n" +
 15077  			"             ├─ (k.id = mk.keyword_id)\n" +
 15078  			"             ├─ TableAlias(mk)\n" +
 15079  			"             │   └─ Table\n" +
 15080  			"             │       ├─ name: movie_keyword\n" +
 15081  			"             │       └─ columns: [movie_id keyword_id]\n" +
 15082  			"             └─ Filter\n" +
 15083  			"                 ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 15084  			"                 └─ TableAlias(k)\n" +
 15085  			"                     └─ Table\n" +
 15086  			"                         ├─ name: keyword\n" +
 15087  			"                         └─ columns: [id keyword]\n" +
 15088  			"",
 15089  	},
 15090  	{
 15091  		Query: `
 15092  SELECT MIN(kt.kind) AS movie_kind,
 15093         MIN(t.title) AS complete_us_internet_movie
 15094  FROM complete_cast AS cc,
 15095       comp_cast_type AS cct1,
 15096       company_name AS cn,
 15097       company_type AS ct,
 15098       info_type AS it1,
 15099       keyword AS k,
 15100       kind_type AS kt,
 15101       movie_companies AS mc,
 15102       movie_info AS mi,
 15103       movie_keyword AS mk,
 15104       title AS t
 15105  WHERE cct1.kind = 'complete+verified'
 15106    AND cn.country_code = '[us]'
 15107    AND it1.info = 'release dates'
 15108    AND kt.kind IN ('movie')
 15109    AND mi.note LIKE '%internet%'
 15110    AND mi.info IS NOT NULL
 15111    AND (mi.info LIKE 'USA:% 199%'
 15112         OR mi.info LIKE 'USA:% 200%')
 15113    AND t.production_year > 2000
 15114    AND kt.id = t.kind_id
 15115    AND t.id = mi.movie_id
 15116    AND t.id = mk.movie_id
 15117    AND t.id = mc.movie_id
 15118    AND t.id = cc.movie_id
 15119    AND mk.movie_id = mi.movie_id
 15120    AND mk.movie_id = mc.movie_id
 15121    AND mk.movie_id = cc.movie_id
 15122    AND mi.movie_id = mc.movie_id
 15123    AND mi.movie_id = cc.movie_id
 15124    AND mc.movie_id = cc.movie_id
 15125    AND k.id = mk.keyword_id
 15126    AND it1.id = mi.info_type_id
 15127    AND cn.id = mc.company_id
 15128    AND ct.id = mc.company_type_id
 15129    AND cct1.id = cc.status_id;
 15130  
 15131  `,
 15132  		ExpectedPlan: "Project\n" +
 15133  			" ├─ columns: [min(kt.kind):0!null as movie_kind, min(t.title):1!null as complete_us_internet_movie]\n" +
 15134  			" └─ GroupBy\n" +
 15135  			"     ├─ select: MIN(kt.kind:9!null), MIN(t.title:1!null)\n" +
 15136  			"     ├─ group: \n" +
 15137  			"     └─ InnerJoin\n" +
 15138  			"         ├─ AND\n" +
 15139  			"         │   ├─ AND\n" +
 15140  			"         │   │   ├─ AND\n" +
 15141  			"         │   │   │   ├─ Eq\n" +
 15142  			"         │   │   │   │   ├─ mk.movie_id:22!null\n" +
 15143  			"         │   │   │   │   └─ mi.movie_id:10!null\n" +
 15144  			"         │   │   │   └─ Eq\n" +
 15145  			"         │   │   │       ├─ mk.movie_id:22!null\n" +
 15146  			"         │   │   │       └─ mc.movie_id:16!null\n" +
 15147  			"         │   │   └─ Eq\n" +
 15148  			"         │   │       ├─ mk.movie_id:22!null\n" +
 15149  			"         │   │       └─ cc.movie_id:6\n" +
 15150  			"         │   └─ Eq\n" +
 15151  			"         │       ├─ t.id:0!null\n" +
 15152  			"         │       └─ mk.movie_id:22!null\n" +
 15153  			"         ├─ InnerJoin\n" +
 15154  			"         │   ├─ AND\n" +
 15155  			"         │   │   ├─ Eq\n" +
 15156  			"         │   │   │   ├─ mi.movie_id:10!null\n" +
 15157  			"         │   │   │   └─ mc.movie_id:16!null\n" +
 15158  			"         │   │   └─ Eq\n" +
 15159  			"         │   │       ├─ t.id:0!null\n" +
 15160  			"         │   │       └─ mc.movie_id:16!null\n" +
 15161  			"         │   ├─ InnerJoin\n" +
 15162  			"         │   │   ├─ Eq\n" +
 15163  			"         │   │   │   ├─ t.id:0!null\n" +
 15164  			"         │   │   │   └─ mi.movie_id:10!null\n" +
 15165  			"         │   │   ├─ InnerJoin\n" +
 15166  			"         │   │   │   ├─ Eq\n" +
 15167  			"         │   │   │   │   ├─ kt.id:8!null\n" +
 15168  			"         │   │   │   │   └─ t.kind_id:2!null\n" +
 15169  			"         │   │   │   ├─ InnerJoin\n" +
 15170  			"         │   │   │   │   ├─ Eq\n" +
 15171  			"         │   │   │   │   │   ├─ t.id:0!null\n" +
 15172  			"         │   │   │   │   │   └─ cc.movie_id:6\n" +
 15173  			"         │   │   │   │   ├─ Filter\n" +
 15174  			"         │   │   │   │   │   ├─ GreaterThan\n" +
 15175  			"         │   │   │   │   │   │   ├─ t.production_year:3\n" +
 15176  			"         │   │   │   │   │   │   └─ 2000 (smallint)\n" +
 15177  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15178  			"         │   │   │   │   │       └─ ProcessTable\n" +
 15179  			"         │   │   │   │   │           └─ Table\n" +
 15180  			"         │   │   │   │   │               ├─ name: title\n" +
 15181  			"         │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 15182  			"         │   │   │   │   └─ InnerJoin\n" +
 15183  			"         │   │   │   │       ├─ Eq\n" +
 15184  			"         │   │   │   │       │   ├─ cct1.id:4!null\n" +
 15185  			"         │   │   │   │       │   └─ cc.status_id:7!null\n" +
 15186  			"         │   │   │   │       ├─ Filter\n" +
 15187  			"         │   │   │   │       │   ├─ Eq\n" +
 15188  			"         │   │   │   │       │   │   ├─ cct1.kind:1!null\n" +
 15189  			"         │   │   │   │       │   │   └─ complete+verified (longtext)\n" +
 15190  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 15191  			"         │   │   │   │       │       └─ ProcessTable\n" +
 15192  			"         │   │   │   │       │           └─ Table\n" +
 15193  			"         │   │   │   │       │               ├─ name: comp_cast_type\n" +
 15194  			"         │   │   │   │       │               └─ columns: [id kind]\n" +
 15195  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 15196  			"         │   │   │   │           └─ ProcessTable\n" +
 15197  			"         │   │   │   │               └─ Table\n" +
 15198  			"         │   │   │   │                   ├─ name: complete_cast\n" +
 15199  			"         │   │   │   │                   └─ columns: [movie_id status_id]\n" +
 15200  			"         │   │   │   └─ Filter\n" +
 15201  			"         │   │   │       ├─ HashIn\n" +
 15202  			"         │   │   │       │   ├─ kt.kind:1!null\n" +
 15203  			"         │   │   │       │   └─ TUPLE(movie (longtext))\n" +
 15204  			"         │   │   │       └─ TableAlias(kt)\n" +
 15205  			"         │   │   │           └─ ProcessTable\n" +
 15206  			"         │   │   │               └─ Table\n" +
 15207  			"         │   │   │                   ├─ name: kind_type\n" +
 15208  			"         │   │   │                   └─ columns: [id kind]\n" +
 15209  			"         │   │   └─ InnerJoin\n" +
 15210  			"         │   │       ├─ Eq\n" +
 15211  			"         │   │       │   ├─ it1.id:14!null\n" +
 15212  			"         │   │       │   └─ mi.info_type_id:11!null\n" +
 15213  			"         │   │       ├─ Filter\n" +
 15214  			"         │   │       │   ├─ AND\n" +
 15215  			"         │   │       │   │   ├─ AND\n" +
 15216  			"         │   │       │   │   │   ├─ mi.note LIKE '%internet%'\n" +
 15217  			"         │   │       │   │   │   └─ NOT\n" +
 15218  			"         │   │       │   │   │       └─ mi.info:2!null IS NULL\n" +
 15219  			"         │   │       │   │   └─ Or\n" +
 15220  			"         │   │       │   │       ├─ mi.info LIKE 'USA:% 199%'\n" +
 15221  			"         │   │       │   │       └─ mi.info LIKE 'USA:% 200%'\n" +
 15222  			"         │   │       │   └─ TableAlias(mi)\n" +
 15223  			"         │   │       │       └─ ProcessTable\n" +
 15224  			"         │   │       │           └─ Table\n" +
 15225  			"         │   │       │               ├─ name: movie_info\n" +
 15226  			"         │   │       │               └─ columns: [movie_id info_type_id info note]\n" +
 15227  			"         │   │       └─ Filter\n" +
 15228  			"         │   │           ├─ Eq\n" +
 15229  			"         │   │           │   ├─ it1.info:1!null\n" +
 15230  			"         │   │           │   └─ release dates (longtext)\n" +
 15231  			"         │   │           └─ TableAlias(it1)\n" +
 15232  			"         │   │               └─ ProcessTable\n" +
 15233  			"         │   │                   └─ Table\n" +
 15234  			"         │   │                       ├─ name: info_type\n" +
 15235  			"         │   │                       └─ columns: [id info]\n" +
 15236  			"         │   └─ InnerJoin\n" +
 15237  			"         │       ├─ Eq\n" +
 15238  			"         │       │   ├─ ct.id:21!null\n" +
 15239  			"         │       │   └─ mc.company_type_id:18!null\n" +
 15240  			"         │       ├─ InnerJoin\n" +
 15241  			"         │       │   ├─ Eq\n" +
 15242  			"         │       │   │   ├─ cn.id:19!null\n" +
 15243  			"         │       │   │   └─ mc.company_id:17!null\n" +
 15244  			"         │       │   ├─ TableAlias(mc)\n" +
 15245  			"         │       │   │   └─ ProcessTable\n" +
 15246  			"         │       │   │       └─ Table\n" +
 15247  			"         │       │   │           ├─ name: movie_companies\n" +
 15248  			"         │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
 15249  			"         │       │   └─ Filter\n" +
 15250  			"         │       │       ├─ Eq\n" +
 15251  			"         │       │       │   ├─ cn.country_code:1\n" +
 15252  			"         │       │       │   └─ [us] (longtext)\n" +
 15253  			"         │       │       └─ TableAlias(cn)\n" +
 15254  			"         │       │           └─ ProcessTable\n" +
 15255  			"         │       │               └─ Table\n" +
 15256  			"         │       │                   ├─ name: company_name\n" +
 15257  			"         │       │                   └─ columns: [id country_code]\n" +
 15258  			"         │       └─ TableAlias(ct)\n" +
 15259  			"         │           └─ ProcessTable\n" +
 15260  			"         │               └─ Table\n" +
 15261  			"         │                   ├─ name: company_type\n" +
 15262  			"         │                   └─ columns: [id]\n" +
 15263  			"         └─ InnerJoin\n" +
 15264  			"             ├─ Eq\n" +
 15265  			"             │   ├─ k.id:24!null\n" +
 15266  			"             │   └─ mk.keyword_id:23!null\n" +
 15267  			"             ├─ TableAlias(mk)\n" +
 15268  			"             │   └─ ProcessTable\n" +
 15269  			"             │       └─ Table\n" +
 15270  			"             │           ├─ name: movie_keyword\n" +
 15271  			"             │           └─ columns: [movie_id keyword_id]\n" +
 15272  			"             └─ TableAlias(k)\n" +
 15273  			"                 └─ ProcessTable\n" +
 15274  			"                     └─ Table\n" +
 15275  			"                         ├─ name: keyword\n" +
 15276  			"                         └─ columns: [id]\n" +
 15277  			"",
 15278  		ExpectedEstimates: "Project\n" +
 15279  			" ├─ columns: [min(kt.kind) as movie_kind, min(t.title) as complete_us_internet_movie]\n" +
 15280  			" └─ GroupBy\n" +
 15281  			"     ├─ SelectedExprs(MIN(kt.kind), MIN(t.title))\n" +
 15282  			"     ├─ Grouping()\n" +
 15283  			"     └─ InnerJoin\n" +
 15284  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (t.id = mk.movie_id))\n" +
 15285  			"         ├─ InnerJoin\n" +
 15286  			"         │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 15287  			"         │   ├─ InnerJoin\n" +
 15288  			"         │   │   ├─ (t.id = mi.movie_id)\n" +
 15289  			"         │   │   ├─ InnerJoin\n" +
 15290  			"         │   │   │   ├─ (kt.id = t.kind_id)\n" +
 15291  			"         │   │   │   ├─ InnerJoin\n" +
 15292  			"         │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 15293  			"         │   │   │   │   ├─ Filter\n" +
 15294  			"         │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 15295  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15296  			"         │   │   │   │   │       └─ Table\n" +
 15297  			"         │   │   │   │   │           ├─ name: title\n" +
 15298  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 15299  			"         │   │   │   │   └─ InnerJoin\n" +
 15300  			"         │   │   │   │       ├─ (cct1.id = cc.status_id)\n" +
 15301  			"         │   │   │   │       ├─ Filter\n" +
 15302  			"         │   │   │   │       │   ├─ (cct1.kind = 'complete+verified')\n" +
 15303  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 15304  			"         │   │   │   │       │       └─ Table\n" +
 15305  			"         │   │   │   │       │           ├─ name: comp_cast_type\n" +
 15306  			"         │   │   │   │       │           └─ columns: [id kind]\n" +
 15307  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 15308  			"         │   │   │   │           └─ Table\n" +
 15309  			"         │   │   │   │               ├─ name: complete_cast\n" +
 15310  			"         │   │   │   │               └─ columns: [movie_id status_id]\n" +
 15311  			"         │   │   │   └─ Filter\n" +
 15312  			"         │   │   │       ├─ (kt.kind HASH IN ('movie'))\n" +
 15313  			"         │   │   │       └─ TableAlias(kt)\n" +
 15314  			"         │   │   │           └─ Table\n" +
 15315  			"         │   │   │               ├─ name: kind_type\n" +
 15316  			"         │   │   │               └─ columns: [id kind]\n" +
 15317  			"         │   │   └─ InnerJoin\n" +
 15318  			"         │   │       ├─ (it1.id = mi.info_type_id)\n" +
 15319  			"         │   │       ├─ Filter\n" +
 15320  			"         │   │       │   ├─ ((mi.note LIKE '%internet%' AND (NOT(mi.info IS NULL))) AND (mi.info LIKE 'USA:% 199%' OR mi.info LIKE 'USA:% 200%'))\n" +
 15321  			"         │   │       │   └─ TableAlias(mi)\n" +
 15322  			"         │   │       │       └─ Table\n" +
 15323  			"         │   │       │           ├─ name: movie_info\n" +
 15324  			"         │   │       │           └─ columns: [movie_id info_type_id info note]\n" +
 15325  			"         │   │       └─ Filter\n" +
 15326  			"         │   │           ├─ (it1.info = 'release dates')\n" +
 15327  			"         │   │           └─ TableAlias(it1)\n" +
 15328  			"         │   │               └─ Table\n" +
 15329  			"         │   │                   ├─ name: info_type\n" +
 15330  			"         │   │                   └─ columns: [id info]\n" +
 15331  			"         │   └─ InnerJoin\n" +
 15332  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
 15333  			"         │       ├─ InnerJoin\n" +
 15334  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
 15335  			"         │       │   ├─ TableAlias(mc)\n" +
 15336  			"         │       │   │   └─ Table\n" +
 15337  			"         │       │   │       ├─ name: movie_companies\n" +
 15338  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 15339  			"         │       │   └─ Filter\n" +
 15340  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
 15341  			"         │       │       └─ TableAlias(cn)\n" +
 15342  			"         │       │           └─ Table\n" +
 15343  			"         │       │               ├─ name: company_name\n" +
 15344  			"         │       │               └─ columns: [id country_code]\n" +
 15345  			"         │       └─ TableAlias(ct)\n" +
 15346  			"         │           └─ Table\n" +
 15347  			"         │               ├─ name: company_type\n" +
 15348  			"         │               └─ columns: [id]\n" +
 15349  			"         └─ InnerJoin\n" +
 15350  			"             ├─ (k.id = mk.keyword_id)\n" +
 15351  			"             ├─ TableAlias(mk)\n" +
 15352  			"             │   └─ Table\n" +
 15353  			"             │       ├─ name: movie_keyword\n" +
 15354  			"             │       └─ columns: [movie_id keyword_id]\n" +
 15355  			"             └─ TableAlias(k)\n" +
 15356  			"                 └─ Table\n" +
 15357  			"                     ├─ name: keyword\n" +
 15358  			"                     └─ columns: [id]\n" +
 15359  			"",
 15360  		ExpectedAnalysis: "Project\n" +
 15361  			" ├─ columns: [min(kt.kind) as movie_kind, min(t.title) as complete_us_internet_movie]\n" +
 15362  			" └─ GroupBy\n" +
 15363  			"     ├─ SelectedExprs(MIN(kt.kind), MIN(t.title))\n" +
 15364  			"     ├─ Grouping()\n" +
 15365  			"     └─ InnerJoin\n" +
 15366  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (t.id = mk.movie_id))\n" +
 15367  			"         ├─ InnerJoin\n" +
 15368  			"         │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 15369  			"         │   ├─ InnerJoin\n" +
 15370  			"         │   │   ├─ (t.id = mi.movie_id)\n" +
 15371  			"         │   │   ├─ InnerJoin\n" +
 15372  			"         │   │   │   ├─ (kt.id = t.kind_id)\n" +
 15373  			"         │   │   │   ├─ InnerJoin\n" +
 15374  			"         │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 15375  			"         │   │   │   │   ├─ Filter\n" +
 15376  			"         │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 15377  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15378  			"         │   │   │   │   │       └─ Table\n" +
 15379  			"         │   │   │   │   │           ├─ name: title\n" +
 15380  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 15381  			"         │   │   │   │   └─ InnerJoin\n" +
 15382  			"         │   │   │   │       ├─ (cct1.id = cc.status_id)\n" +
 15383  			"         │   │   │   │       ├─ Filter\n" +
 15384  			"         │   │   │   │       │   ├─ (cct1.kind = 'complete+verified')\n" +
 15385  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 15386  			"         │   │   │   │       │       └─ Table\n" +
 15387  			"         │   │   │   │       │           ├─ name: comp_cast_type\n" +
 15388  			"         │   │   │   │       │           └─ columns: [id kind]\n" +
 15389  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 15390  			"         │   │   │   │           └─ Table\n" +
 15391  			"         │   │   │   │               ├─ name: complete_cast\n" +
 15392  			"         │   │   │   │               └─ columns: [movie_id status_id]\n" +
 15393  			"         │   │   │   └─ Filter\n" +
 15394  			"         │   │   │       ├─ (kt.kind HASH IN ('movie'))\n" +
 15395  			"         │   │   │       └─ TableAlias(kt)\n" +
 15396  			"         │   │   │           └─ Table\n" +
 15397  			"         │   │   │               ├─ name: kind_type\n" +
 15398  			"         │   │   │               └─ columns: [id kind]\n" +
 15399  			"         │   │   └─ InnerJoin\n" +
 15400  			"         │   │       ├─ (it1.id = mi.info_type_id)\n" +
 15401  			"         │   │       ├─ Filter\n" +
 15402  			"         │   │       │   ├─ ((mi.note LIKE '%internet%' AND (NOT(mi.info IS NULL))) AND (mi.info LIKE 'USA:% 199%' OR mi.info LIKE 'USA:% 200%'))\n" +
 15403  			"         │   │       │   └─ TableAlias(mi)\n" +
 15404  			"         │   │       │       └─ Table\n" +
 15405  			"         │   │       │           ├─ name: movie_info\n" +
 15406  			"         │   │       │           └─ columns: [movie_id info_type_id info note]\n" +
 15407  			"         │   │       └─ Filter\n" +
 15408  			"         │   │           ├─ (it1.info = 'release dates')\n" +
 15409  			"         │   │           └─ TableAlias(it1)\n" +
 15410  			"         │   │               └─ Table\n" +
 15411  			"         │   │                   ├─ name: info_type\n" +
 15412  			"         │   │                   └─ columns: [id info]\n" +
 15413  			"         │   └─ InnerJoin\n" +
 15414  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
 15415  			"         │       ├─ InnerJoin\n" +
 15416  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
 15417  			"         │       │   ├─ TableAlias(mc)\n" +
 15418  			"         │       │   │   └─ Table\n" +
 15419  			"         │       │   │       ├─ name: movie_companies\n" +
 15420  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 15421  			"         │       │   └─ Filter\n" +
 15422  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
 15423  			"         │       │       └─ TableAlias(cn)\n" +
 15424  			"         │       │           └─ Table\n" +
 15425  			"         │       │               ├─ name: company_name\n" +
 15426  			"         │       │               └─ columns: [id country_code]\n" +
 15427  			"         │       └─ TableAlias(ct)\n" +
 15428  			"         │           └─ Table\n" +
 15429  			"         │               ├─ name: company_type\n" +
 15430  			"         │               └─ columns: [id]\n" +
 15431  			"         └─ InnerJoin\n" +
 15432  			"             ├─ (k.id = mk.keyword_id)\n" +
 15433  			"             ├─ TableAlias(mk)\n" +
 15434  			"             │   └─ Table\n" +
 15435  			"             │       ├─ name: movie_keyword\n" +
 15436  			"             │       └─ columns: [movie_id keyword_id]\n" +
 15437  			"             └─ TableAlias(k)\n" +
 15438  			"                 └─ Table\n" +
 15439  			"                     ├─ name: keyword\n" +
 15440  			"                     └─ columns: [id]\n" +
 15441  			"",
 15442  	},
 15443  	{
 15444  		Query: `
 15445  SELECT MIN(kt.kind) AS movie_kind,
 15446         MIN(t.title) AS complete_nerdy_internet_movie
 15447  FROM complete_cast AS cc,
 15448       comp_cast_type AS cct1,
 15449       company_name AS cn,
 15450       company_type AS ct,
 15451       info_type AS it1,
 15452       keyword AS k,
 15453       kind_type AS kt,
 15454       movie_companies AS mc,
 15455       movie_info AS mi,
 15456       movie_keyword AS mk,
 15457       title AS t
 15458  WHERE cct1.kind = 'complete+verified'
 15459    AND cn.country_code = '[us]'
 15460    AND it1.info = 'release dates'
 15461    AND k.keyword IN ('nerd',
 15462                      'loner',
 15463                      'alienation',
 15464                      'dignity')
 15465    AND kt.kind IN ('movie')
 15466    AND mi.note LIKE '%internet%'
 15467    AND mi.info LIKE 'USA:% 200%'
 15468    AND t.production_year > 2000
 15469    AND kt.id = t.kind_id
 15470    AND t.id = mi.movie_id
 15471    AND t.id = mk.movie_id
 15472    AND t.id = mc.movie_id
 15473    AND t.id = cc.movie_id
 15474    AND mk.movie_id = mi.movie_id
 15475    AND mk.movie_id = mc.movie_id
 15476    AND mk.movie_id = cc.movie_id
 15477    AND mi.movie_id = mc.movie_id
 15478    AND mi.movie_id = cc.movie_id
 15479    AND mc.movie_id = cc.movie_id
 15480    AND k.id = mk.keyword_id
 15481    AND it1.id = mi.info_type_id
 15482    AND cn.id = mc.company_id
 15483    AND ct.id = mc.company_type_id
 15484    AND cct1.id = cc.status_id;
 15485  
 15486  `,
 15487  		ExpectedPlan: "Project\n" +
 15488  			" ├─ columns: [min(kt.kind):0!null as movie_kind, min(t.title):1!null as complete_nerdy_internet_movie]\n" +
 15489  			" └─ GroupBy\n" +
 15490  			"     ├─ select: MIN(kt.kind:9!null), MIN(t.title:1!null)\n" +
 15491  			"     ├─ group: \n" +
 15492  			"     └─ InnerJoin\n" +
 15493  			"         ├─ AND\n" +
 15494  			"         │   ├─ AND\n" +
 15495  			"         │   │   ├─ AND\n" +
 15496  			"         │   │   │   ├─ Eq\n" +
 15497  			"         │   │   │   │   ├─ mk.movie_id:22!null\n" +
 15498  			"         │   │   │   │   └─ mi.movie_id:10!null\n" +
 15499  			"         │   │   │   └─ Eq\n" +
 15500  			"         │   │   │       ├─ mk.movie_id:22!null\n" +
 15501  			"         │   │   │       └─ mc.movie_id:16!null\n" +
 15502  			"         │   │   └─ Eq\n" +
 15503  			"         │   │       ├─ mk.movie_id:22!null\n" +
 15504  			"         │   │       └─ cc.movie_id:6\n" +
 15505  			"         │   └─ Eq\n" +
 15506  			"         │       ├─ t.id:0!null\n" +
 15507  			"         │       └─ mk.movie_id:22!null\n" +
 15508  			"         ├─ InnerJoin\n" +
 15509  			"         │   ├─ AND\n" +
 15510  			"         │   │   ├─ Eq\n" +
 15511  			"         │   │   │   ├─ mi.movie_id:10!null\n" +
 15512  			"         │   │   │   └─ mc.movie_id:16!null\n" +
 15513  			"         │   │   └─ Eq\n" +
 15514  			"         │   │       ├─ t.id:0!null\n" +
 15515  			"         │   │       └─ mc.movie_id:16!null\n" +
 15516  			"         │   ├─ InnerJoin\n" +
 15517  			"         │   │   ├─ Eq\n" +
 15518  			"         │   │   │   ├─ t.id:0!null\n" +
 15519  			"         │   │   │   └─ mi.movie_id:10!null\n" +
 15520  			"         │   │   ├─ InnerJoin\n" +
 15521  			"         │   │   │   ├─ Eq\n" +
 15522  			"         │   │   │   │   ├─ kt.id:8!null\n" +
 15523  			"         │   │   │   │   └─ t.kind_id:2!null\n" +
 15524  			"         │   │   │   ├─ InnerJoin\n" +
 15525  			"         │   │   │   │   ├─ Eq\n" +
 15526  			"         │   │   │   │   │   ├─ t.id:0!null\n" +
 15527  			"         │   │   │   │   │   └─ cc.movie_id:6\n" +
 15528  			"         │   │   │   │   ├─ Filter\n" +
 15529  			"         │   │   │   │   │   ├─ GreaterThan\n" +
 15530  			"         │   │   │   │   │   │   ├─ t.production_year:3\n" +
 15531  			"         │   │   │   │   │   │   └─ 2000 (smallint)\n" +
 15532  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15533  			"         │   │   │   │   │       └─ ProcessTable\n" +
 15534  			"         │   │   │   │   │           └─ Table\n" +
 15535  			"         │   │   │   │   │               ├─ name: title\n" +
 15536  			"         │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 15537  			"         │   │   │   │   └─ InnerJoin\n" +
 15538  			"         │   │   │   │       ├─ Eq\n" +
 15539  			"         │   │   │   │       │   ├─ cct1.id:4!null\n" +
 15540  			"         │   │   │   │       │   └─ cc.status_id:7!null\n" +
 15541  			"         │   │   │   │       ├─ Filter\n" +
 15542  			"         │   │   │   │       │   ├─ Eq\n" +
 15543  			"         │   │   │   │       │   │   ├─ cct1.kind:1!null\n" +
 15544  			"         │   │   │   │       │   │   └─ complete+verified (longtext)\n" +
 15545  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 15546  			"         │   │   │   │       │       └─ ProcessTable\n" +
 15547  			"         │   │   │   │       │           └─ Table\n" +
 15548  			"         │   │   │   │       │               ├─ name: comp_cast_type\n" +
 15549  			"         │   │   │   │       │               └─ columns: [id kind]\n" +
 15550  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 15551  			"         │   │   │   │           └─ ProcessTable\n" +
 15552  			"         │   │   │   │               └─ Table\n" +
 15553  			"         │   │   │   │                   ├─ name: complete_cast\n" +
 15554  			"         │   │   │   │                   └─ columns: [movie_id status_id]\n" +
 15555  			"         │   │   │   └─ Filter\n" +
 15556  			"         │   │   │       ├─ HashIn\n" +
 15557  			"         │   │   │       │   ├─ kt.kind:1!null\n" +
 15558  			"         │   │   │       │   └─ TUPLE(movie (longtext))\n" +
 15559  			"         │   │   │       └─ TableAlias(kt)\n" +
 15560  			"         │   │   │           └─ ProcessTable\n" +
 15561  			"         │   │   │               └─ Table\n" +
 15562  			"         │   │   │                   ├─ name: kind_type\n" +
 15563  			"         │   │   │                   └─ columns: [id kind]\n" +
 15564  			"         │   │   └─ InnerJoin\n" +
 15565  			"         │   │       ├─ Eq\n" +
 15566  			"         │   │       │   ├─ it1.id:14!null\n" +
 15567  			"         │   │       │   └─ mi.info_type_id:11!null\n" +
 15568  			"         │   │       ├─ Filter\n" +
 15569  			"         │   │       │   ├─ AND\n" +
 15570  			"         │   │       │   │   ├─ mi.note LIKE '%internet%'\n" +
 15571  			"         │   │       │   │   └─ mi.info LIKE 'USA:% 200%'\n" +
 15572  			"         │   │       │   └─ TableAlias(mi)\n" +
 15573  			"         │   │       │       └─ ProcessTable\n" +
 15574  			"         │   │       │           └─ Table\n" +
 15575  			"         │   │       │               ├─ name: movie_info\n" +
 15576  			"         │   │       │               └─ columns: [movie_id info_type_id info note]\n" +
 15577  			"         │   │       └─ Filter\n" +
 15578  			"         │   │           ├─ Eq\n" +
 15579  			"         │   │           │   ├─ it1.info:1!null\n" +
 15580  			"         │   │           │   └─ release dates (longtext)\n" +
 15581  			"         │   │           └─ TableAlias(it1)\n" +
 15582  			"         │   │               └─ ProcessTable\n" +
 15583  			"         │   │                   └─ Table\n" +
 15584  			"         │   │                       ├─ name: info_type\n" +
 15585  			"         │   │                       └─ columns: [id info]\n" +
 15586  			"         │   └─ InnerJoin\n" +
 15587  			"         │       ├─ Eq\n" +
 15588  			"         │       │   ├─ ct.id:21!null\n" +
 15589  			"         │       │   └─ mc.company_type_id:18!null\n" +
 15590  			"         │       ├─ InnerJoin\n" +
 15591  			"         │       │   ├─ Eq\n" +
 15592  			"         │       │   │   ├─ cn.id:19!null\n" +
 15593  			"         │       │   │   └─ mc.company_id:17!null\n" +
 15594  			"         │       │   ├─ TableAlias(mc)\n" +
 15595  			"         │       │   │   └─ ProcessTable\n" +
 15596  			"         │       │   │       └─ Table\n" +
 15597  			"         │       │   │           ├─ name: movie_companies\n" +
 15598  			"         │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
 15599  			"         │       │   └─ Filter\n" +
 15600  			"         │       │       ├─ Eq\n" +
 15601  			"         │       │       │   ├─ cn.country_code:1\n" +
 15602  			"         │       │       │   └─ [us] (longtext)\n" +
 15603  			"         │       │       └─ TableAlias(cn)\n" +
 15604  			"         │       │           └─ ProcessTable\n" +
 15605  			"         │       │               └─ Table\n" +
 15606  			"         │       │                   ├─ name: company_name\n" +
 15607  			"         │       │                   └─ columns: [id country_code]\n" +
 15608  			"         │       └─ TableAlias(ct)\n" +
 15609  			"         │           └─ ProcessTable\n" +
 15610  			"         │               └─ Table\n" +
 15611  			"         │                   ├─ name: company_type\n" +
 15612  			"         │                   └─ columns: [id]\n" +
 15613  			"         └─ InnerJoin\n" +
 15614  			"             ├─ Eq\n" +
 15615  			"             │   ├─ k.id:24!null\n" +
 15616  			"             │   └─ mk.keyword_id:23!null\n" +
 15617  			"             ├─ TableAlias(mk)\n" +
 15618  			"             │   └─ ProcessTable\n" +
 15619  			"             │       └─ Table\n" +
 15620  			"             │           ├─ name: movie_keyword\n" +
 15621  			"             │           └─ columns: [movie_id keyword_id]\n" +
 15622  			"             └─ Filter\n" +
 15623  			"                 ├─ HashIn\n" +
 15624  			"                 │   ├─ k.keyword:1!null\n" +
 15625  			"                 │   └─ TUPLE(nerd (longtext), loner (longtext), alienation (longtext), dignity (longtext))\n" +
 15626  			"                 └─ TableAlias(k)\n" +
 15627  			"                     └─ ProcessTable\n" +
 15628  			"                         └─ Table\n" +
 15629  			"                             ├─ name: keyword\n" +
 15630  			"                             └─ columns: [id keyword]\n" +
 15631  			"",
 15632  		ExpectedEstimates: "Project\n" +
 15633  			" ├─ columns: [min(kt.kind) as movie_kind, min(t.title) as complete_nerdy_internet_movie]\n" +
 15634  			" └─ GroupBy\n" +
 15635  			"     ├─ SelectedExprs(MIN(kt.kind), MIN(t.title))\n" +
 15636  			"     ├─ Grouping()\n" +
 15637  			"     └─ InnerJoin\n" +
 15638  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (t.id = mk.movie_id))\n" +
 15639  			"         ├─ InnerJoin\n" +
 15640  			"         │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 15641  			"         │   ├─ InnerJoin\n" +
 15642  			"         │   │   ├─ (t.id = mi.movie_id)\n" +
 15643  			"         │   │   ├─ InnerJoin\n" +
 15644  			"         │   │   │   ├─ (kt.id = t.kind_id)\n" +
 15645  			"         │   │   │   ├─ InnerJoin\n" +
 15646  			"         │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 15647  			"         │   │   │   │   ├─ Filter\n" +
 15648  			"         │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 15649  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15650  			"         │   │   │   │   │       └─ Table\n" +
 15651  			"         │   │   │   │   │           ├─ name: title\n" +
 15652  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 15653  			"         │   │   │   │   └─ InnerJoin\n" +
 15654  			"         │   │   │   │       ├─ (cct1.id = cc.status_id)\n" +
 15655  			"         │   │   │   │       ├─ Filter\n" +
 15656  			"         │   │   │   │       │   ├─ (cct1.kind = 'complete+verified')\n" +
 15657  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 15658  			"         │   │   │   │       │       └─ Table\n" +
 15659  			"         │   │   │   │       │           ├─ name: comp_cast_type\n" +
 15660  			"         │   │   │   │       │           └─ columns: [id kind]\n" +
 15661  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 15662  			"         │   │   │   │           └─ Table\n" +
 15663  			"         │   │   │   │               ├─ name: complete_cast\n" +
 15664  			"         │   │   │   │               └─ columns: [movie_id status_id]\n" +
 15665  			"         │   │   │   └─ Filter\n" +
 15666  			"         │   │   │       ├─ (kt.kind HASH IN ('movie'))\n" +
 15667  			"         │   │   │       └─ TableAlias(kt)\n" +
 15668  			"         │   │   │           └─ Table\n" +
 15669  			"         │   │   │               ├─ name: kind_type\n" +
 15670  			"         │   │   │               └─ columns: [id kind]\n" +
 15671  			"         │   │   └─ InnerJoin\n" +
 15672  			"         │   │       ├─ (it1.id = mi.info_type_id)\n" +
 15673  			"         │   │       ├─ Filter\n" +
 15674  			"         │   │       │   ├─ (mi.note LIKE '%internet%' AND mi.info LIKE 'USA:% 200%')\n" +
 15675  			"         │   │       │   └─ TableAlias(mi)\n" +
 15676  			"         │   │       │       └─ Table\n" +
 15677  			"         │   │       │           ├─ name: movie_info\n" +
 15678  			"         │   │       │           └─ columns: [movie_id info_type_id info note]\n" +
 15679  			"         │   │       └─ Filter\n" +
 15680  			"         │   │           ├─ (it1.info = 'release dates')\n" +
 15681  			"         │   │           └─ TableAlias(it1)\n" +
 15682  			"         │   │               └─ Table\n" +
 15683  			"         │   │                   ├─ name: info_type\n" +
 15684  			"         │   │                   └─ columns: [id info]\n" +
 15685  			"         │   └─ InnerJoin\n" +
 15686  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
 15687  			"         │       ├─ InnerJoin\n" +
 15688  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
 15689  			"         │       │   ├─ TableAlias(mc)\n" +
 15690  			"         │       │   │   └─ Table\n" +
 15691  			"         │       │   │       ├─ name: movie_companies\n" +
 15692  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 15693  			"         │       │   └─ Filter\n" +
 15694  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
 15695  			"         │       │       └─ TableAlias(cn)\n" +
 15696  			"         │       │           └─ Table\n" +
 15697  			"         │       │               ├─ name: company_name\n" +
 15698  			"         │       │               └─ columns: [id country_code]\n" +
 15699  			"         │       └─ TableAlias(ct)\n" +
 15700  			"         │           └─ Table\n" +
 15701  			"         │               ├─ name: company_type\n" +
 15702  			"         │               └─ columns: [id]\n" +
 15703  			"         └─ InnerJoin\n" +
 15704  			"             ├─ (k.id = mk.keyword_id)\n" +
 15705  			"             ├─ TableAlias(mk)\n" +
 15706  			"             │   └─ Table\n" +
 15707  			"             │       ├─ name: movie_keyword\n" +
 15708  			"             │       └─ columns: [movie_id keyword_id]\n" +
 15709  			"             └─ Filter\n" +
 15710  			"                 ├─ (k.keyword HASH IN ('nerd', 'loner', 'alienation', 'dignity'))\n" +
 15711  			"                 └─ TableAlias(k)\n" +
 15712  			"                     └─ Table\n" +
 15713  			"                         ├─ name: keyword\n" +
 15714  			"                         └─ columns: [id keyword]\n" +
 15715  			"",
 15716  		ExpectedAnalysis: "Project\n" +
 15717  			" ├─ columns: [min(kt.kind) as movie_kind, min(t.title) as complete_nerdy_internet_movie]\n" +
 15718  			" └─ GroupBy\n" +
 15719  			"     ├─ SelectedExprs(MIN(kt.kind), MIN(t.title))\n" +
 15720  			"     ├─ Grouping()\n" +
 15721  			"     └─ InnerJoin\n" +
 15722  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (t.id = mk.movie_id))\n" +
 15723  			"         ├─ InnerJoin\n" +
 15724  			"         │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 15725  			"         │   ├─ InnerJoin\n" +
 15726  			"         │   │   ├─ (t.id = mi.movie_id)\n" +
 15727  			"         │   │   ├─ InnerJoin\n" +
 15728  			"         │   │   │   ├─ (kt.id = t.kind_id)\n" +
 15729  			"         │   │   │   ├─ InnerJoin\n" +
 15730  			"         │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 15731  			"         │   │   │   │   ├─ Filter\n" +
 15732  			"         │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 15733  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15734  			"         │   │   │   │   │       └─ Table\n" +
 15735  			"         │   │   │   │   │           ├─ name: title\n" +
 15736  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 15737  			"         │   │   │   │   └─ InnerJoin\n" +
 15738  			"         │   │   │   │       ├─ (cct1.id = cc.status_id)\n" +
 15739  			"         │   │   │   │       ├─ Filter\n" +
 15740  			"         │   │   │   │       │   ├─ (cct1.kind = 'complete+verified')\n" +
 15741  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 15742  			"         │   │   │   │       │       └─ Table\n" +
 15743  			"         │   │   │   │       │           ├─ name: comp_cast_type\n" +
 15744  			"         │   │   │   │       │           └─ columns: [id kind]\n" +
 15745  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 15746  			"         │   │   │   │           └─ Table\n" +
 15747  			"         │   │   │   │               ├─ name: complete_cast\n" +
 15748  			"         │   │   │   │               └─ columns: [movie_id status_id]\n" +
 15749  			"         │   │   │   └─ Filter\n" +
 15750  			"         │   │   │       ├─ (kt.kind HASH IN ('movie'))\n" +
 15751  			"         │   │   │       └─ TableAlias(kt)\n" +
 15752  			"         │   │   │           └─ Table\n" +
 15753  			"         │   │   │               ├─ name: kind_type\n" +
 15754  			"         │   │   │               └─ columns: [id kind]\n" +
 15755  			"         │   │   └─ InnerJoin\n" +
 15756  			"         │   │       ├─ (it1.id = mi.info_type_id)\n" +
 15757  			"         │   │       ├─ Filter\n" +
 15758  			"         │   │       │   ├─ (mi.note LIKE '%internet%' AND mi.info LIKE 'USA:% 200%')\n" +
 15759  			"         │   │       │   └─ TableAlias(mi)\n" +
 15760  			"         │   │       │       └─ Table\n" +
 15761  			"         │   │       │           ├─ name: movie_info\n" +
 15762  			"         │   │       │           └─ columns: [movie_id info_type_id info note]\n" +
 15763  			"         │   │       └─ Filter\n" +
 15764  			"         │   │           ├─ (it1.info = 'release dates')\n" +
 15765  			"         │   │           └─ TableAlias(it1)\n" +
 15766  			"         │   │               └─ Table\n" +
 15767  			"         │   │                   ├─ name: info_type\n" +
 15768  			"         │   │                   └─ columns: [id info]\n" +
 15769  			"         │   └─ InnerJoin\n" +
 15770  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
 15771  			"         │       ├─ InnerJoin\n" +
 15772  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
 15773  			"         │       │   ├─ TableAlias(mc)\n" +
 15774  			"         │       │   │   └─ Table\n" +
 15775  			"         │       │   │       ├─ name: movie_companies\n" +
 15776  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 15777  			"         │       │   └─ Filter\n" +
 15778  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
 15779  			"         │       │       └─ TableAlias(cn)\n" +
 15780  			"         │       │           └─ Table\n" +
 15781  			"         │       │               ├─ name: company_name\n" +
 15782  			"         │       │               └─ columns: [id country_code]\n" +
 15783  			"         │       └─ TableAlias(ct)\n" +
 15784  			"         │           └─ Table\n" +
 15785  			"         │               ├─ name: company_type\n" +
 15786  			"         │               └─ columns: [id]\n" +
 15787  			"         └─ InnerJoin\n" +
 15788  			"             ├─ (k.id = mk.keyword_id)\n" +
 15789  			"             ├─ TableAlias(mk)\n" +
 15790  			"             │   └─ Table\n" +
 15791  			"             │       ├─ name: movie_keyword\n" +
 15792  			"             │       └─ columns: [movie_id keyword_id]\n" +
 15793  			"             └─ Filter\n" +
 15794  			"                 ├─ (k.keyword HASH IN ('nerd', 'loner', 'alienation', 'dignity'))\n" +
 15795  			"                 └─ TableAlias(k)\n" +
 15796  			"                     └─ Table\n" +
 15797  			"                         ├─ name: keyword\n" +
 15798  			"                         └─ columns: [id keyword]\n" +
 15799  			"",
 15800  	},
 15801  	{
 15802  		Query: `
 15803  SELECT MIN(kt.kind) AS movie_kind,
 15804         MIN(t.title) AS complete_us_internet_movie
 15805  FROM complete_cast AS cc,
 15806       comp_cast_type AS cct1,
 15807       company_name AS cn,
 15808       company_type AS ct,
 15809       info_type AS it1,
 15810       keyword AS k,
 15811       kind_type AS kt,
 15812       movie_companies AS mc,
 15813       movie_info AS mi,
 15814       movie_keyword AS mk,
 15815       title AS t
 15816  WHERE cct1.kind = 'complete+verified'
 15817    AND cn.country_code = '[us]'
 15818    AND it1.info = 'release dates'
 15819    AND kt.kind IN ('movie',
 15820                    'tv movie',
 15821                    'video movie',
 15822                    'video game')
 15823    AND mi.note LIKE '%internet%'
 15824    AND mi.info IS NOT NULL
 15825    AND (mi.info LIKE 'USA:% 199%'
 15826         OR mi.info LIKE 'USA:% 200%')
 15827    AND t.production_year > 1990
 15828    AND kt.id = t.kind_id
 15829    AND t.id = mi.movie_id
 15830    AND t.id = mk.movie_id
 15831    AND t.id = mc.movie_id
 15832    AND t.id = cc.movie_id
 15833    AND mk.movie_id = mi.movie_id
 15834    AND mk.movie_id = mc.movie_id
 15835    AND mk.movie_id = cc.movie_id
 15836    AND mi.movie_id = mc.movie_id
 15837    AND mi.movie_id = cc.movie_id
 15838    AND mc.movie_id = cc.movie_id
 15839    AND k.id = mk.keyword_id
 15840    AND it1.id = mi.info_type_id
 15841    AND cn.id = mc.company_id
 15842    AND ct.id = mc.company_type_id
 15843    AND cct1.id = cc.status_id;
 15844  
 15845  `,
 15846  		ExpectedPlan: "Project\n" +
 15847  			" ├─ columns: [min(kt.kind):0!null as movie_kind, min(t.title):1!null as complete_us_internet_movie]\n" +
 15848  			" └─ GroupBy\n" +
 15849  			"     ├─ select: MIN(kt.kind:9!null), MIN(t.title:1!null)\n" +
 15850  			"     ├─ group: \n" +
 15851  			"     └─ InnerJoin\n" +
 15852  			"         ├─ AND\n" +
 15853  			"         │   ├─ AND\n" +
 15854  			"         │   │   ├─ AND\n" +
 15855  			"         │   │   │   ├─ Eq\n" +
 15856  			"         │   │   │   │   ├─ mk.movie_id:22!null\n" +
 15857  			"         │   │   │   │   └─ mi.movie_id:10!null\n" +
 15858  			"         │   │   │   └─ Eq\n" +
 15859  			"         │   │   │       ├─ mk.movie_id:22!null\n" +
 15860  			"         │   │   │       └─ mc.movie_id:16!null\n" +
 15861  			"         │   │   └─ Eq\n" +
 15862  			"         │   │       ├─ mk.movie_id:22!null\n" +
 15863  			"         │   │       └─ cc.movie_id:6\n" +
 15864  			"         │   └─ Eq\n" +
 15865  			"         │       ├─ t.id:0!null\n" +
 15866  			"         │       └─ mk.movie_id:22!null\n" +
 15867  			"         ├─ InnerJoin\n" +
 15868  			"         │   ├─ AND\n" +
 15869  			"         │   │   ├─ Eq\n" +
 15870  			"         │   │   │   ├─ mi.movie_id:10!null\n" +
 15871  			"         │   │   │   └─ mc.movie_id:16!null\n" +
 15872  			"         │   │   └─ Eq\n" +
 15873  			"         │   │       ├─ t.id:0!null\n" +
 15874  			"         │   │       └─ mc.movie_id:16!null\n" +
 15875  			"         │   ├─ InnerJoin\n" +
 15876  			"         │   │   ├─ Eq\n" +
 15877  			"         │   │   │   ├─ t.id:0!null\n" +
 15878  			"         │   │   │   └─ mi.movie_id:10!null\n" +
 15879  			"         │   │   ├─ InnerJoin\n" +
 15880  			"         │   │   │   ├─ Eq\n" +
 15881  			"         │   │   │   │   ├─ kt.id:8!null\n" +
 15882  			"         │   │   │   │   └─ t.kind_id:2!null\n" +
 15883  			"         │   │   │   ├─ InnerJoin\n" +
 15884  			"         │   │   │   │   ├─ Eq\n" +
 15885  			"         │   │   │   │   │   ├─ t.id:0!null\n" +
 15886  			"         │   │   │   │   │   └─ cc.movie_id:6\n" +
 15887  			"         │   │   │   │   ├─ Filter\n" +
 15888  			"         │   │   │   │   │   ├─ GreaterThan\n" +
 15889  			"         │   │   │   │   │   │   ├─ t.production_year:3\n" +
 15890  			"         │   │   │   │   │   │   └─ 1990 (smallint)\n" +
 15891  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 15892  			"         │   │   │   │   │       └─ ProcessTable\n" +
 15893  			"         │   │   │   │   │           └─ Table\n" +
 15894  			"         │   │   │   │   │               ├─ name: title\n" +
 15895  			"         │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 15896  			"         │   │   │   │   └─ InnerJoin\n" +
 15897  			"         │   │   │   │       ├─ Eq\n" +
 15898  			"         │   │   │   │       │   ├─ cct1.id:4!null\n" +
 15899  			"         │   │   │   │       │   └─ cc.status_id:7!null\n" +
 15900  			"         │   │   │   │       ├─ Filter\n" +
 15901  			"         │   │   │   │       │   ├─ Eq\n" +
 15902  			"         │   │   │   │       │   │   ├─ cct1.kind:1!null\n" +
 15903  			"         │   │   │   │       │   │   └─ complete+verified (longtext)\n" +
 15904  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 15905  			"         │   │   │   │       │       └─ ProcessTable\n" +
 15906  			"         │   │   │   │       │           └─ Table\n" +
 15907  			"         │   │   │   │       │               ├─ name: comp_cast_type\n" +
 15908  			"         │   │   │   │       │               └─ columns: [id kind]\n" +
 15909  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 15910  			"         │   │   │   │           └─ ProcessTable\n" +
 15911  			"         │   │   │   │               └─ Table\n" +
 15912  			"         │   │   │   │                   ├─ name: complete_cast\n" +
 15913  			"         │   │   │   │                   └─ columns: [movie_id status_id]\n" +
 15914  			"         │   │   │   └─ Filter\n" +
 15915  			"         │   │   │       ├─ HashIn\n" +
 15916  			"         │   │   │       │   ├─ kt.kind:1!null\n" +
 15917  			"         │   │   │       │   └─ TUPLE(movie (longtext), tv movie (longtext), video movie (longtext), video game (longtext))\n" +
 15918  			"         │   │   │       └─ TableAlias(kt)\n" +
 15919  			"         │   │   │           └─ ProcessTable\n" +
 15920  			"         │   │   │               └─ Table\n" +
 15921  			"         │   │   │                   ├─ name: kind_type\n" +
 15922  			"         │   │   │                   └─ columns: [id kind]\n" +
 15923  			"         │   │   └─ InnerJoin\n" +
 15924  			"         │   │       ├─ Eq\n" +
 15925  			"         │   │       │   ├─ it1.id:14!null\n" +
 15926  			"         │   │       │   └─ mi.info_type_id:11!null\n" +
 15927  			"         │   │       ├─ Filter\n" +
 15928  			"         │   │       │   ├─ AND\n" +
 15929  			"         │   │       │   │   ├─ AND\n" +
 15930  			"         │   │       │   │   │   ├─ mi.note LIKE '%internet%'\n" +
 15931  			"         │   │       │   │   │   └─ NOT\n" +
 15932  			"         │   │       │   │   │       └─ mi.info:2!null IS NULL\n" +
 15933  			"         │   │       │   │   └─ Or\n" +
 15934  			"         │   │       │   │       ├─ mi.info LIKE 'USA:% 199%'\n" +
 15935  			"         │   │       │   │       └─ mi.info LIKE 'USA:% 200%'\n" +
 15936  			"         │   │       │   └─ TableAlias(mi)\n" +
 15937  			"         │   │       │       └─ ProcessTable\n" +
 15938  			"         │   │       │           └─ Table\n" +
 15939  			"         │   │       │               ├─ name: movie_info\n" +
 15940  			"         │   │       │               └─ columns: [movie_id info_type_id info note]\n" +
 15941  			"         │   │       └─ Filter\n" +
 15942  			"         │   │           ├─ Eq\n" +
 15943  			"         │   │           │   ├─ it1.info:1!null\n" +
 15944  			"         │   │           │   └─ release dates (longtext)\n" +
 15945  			"         │   │           └─ TableAlias(it1)\n" +
 15946  			"         │   │               └─ ProcessTable\n" +
 15947  			"         │   │                   └─ Table\n" +
 15948  			"         │   │                       ├─ name: info_type\n" +
 15949  			"         │   │                       └─ columns: [id info]\n" +
 15950  			"         │   └─ InnerJoin\n" +
 15951  			"         │       ├─ Eq\n" +
 15952  			"         │       │   ├─ ct.id:21!null\n" +
 15953  			"         │       │   └─ mc.company_type_id:18!null\n" +
 15954  			"         │       ├─ InnerJoin\n" +
 15955  			"         │       │   ├─ Eq\n" +
 15956  			"         │       │   │   ├─ cn.id:19!null\n" +
 15957  			"         │       │   │   └─ mc.company_id:17!null\n" +
 15958  			"         │       │   ├─ TableAlias(mc)\n" +
 15959  			"         │       │   │   └─ ProcessTable\n" +
 15960  			"         │       │   │       └─ Table\n" +
 15961  			"         │       │   │           ├─ name: movie_companies\n" +
 15962  			"         │       │   │           └─ columns: [movie_id company_id company_type_id]\n" +
 15963  			"         │       │   └─ Filter\n" +
 15964  			"         │       │       ├─ Eq\n" +
 15965  			"         │       │       │   ├─ cn.country_code:1\n" +
 15966  			"         │       │       │   └─ [us] (longtext)\n" +
 15967  			"         │       │       └─ TableAlias(cn)\n" +
 15968  			"         │       │           └─ ProcessTable\n" +
 15969  			"         │       │               └─ Table\n" +
 15970  			"         │       │                   ├─ name: company_name\n" +
 15971  			"         │       │                   └─ columns: [id country_code]\n" +
 15972  			"         │       └─ TableAlias(ct)\n" +
 15973  			"         │           └─ ProcessTable\n" +
 15974  			"         │               └─ Table\n" +
 15975  			"         │                   ├─ name: company_type\n" +
 15976  			"         │                   └─ columns: [id]\n" +
 15977  			"         └─ InnerJoin\n" +
 15978  			"             ├─ Eq\n" +
 15979  			"             │   ├─ k.id:24!null\n" +
 15980  			"             │   └─ mk.keyword_id:23!null\n" +
 15981  			"             ├─ TableAlias(mk)\n" +
 15982  			"             │   └─ ProcessTable\n" +
 15983  			"             │       └─ Table\n" +
 15984  			"             │           ├─ name: movie_keyword\n" +
 15985  			"             │           └─ columns: [movie_id keyword_id]\n" +
 15986  			"             └─ TableAlias(k)\n" +
 15987  			"                 └─ ProcessTable\n" +
 15988  			"                     └─ Table\n" +
 15989  			"                         ├─ name: keyword\n" +
 15990  			"                         └─ columns: [id]\n" +
 15991  			"",
 15992  		ExpectedEstimates: "Project\n" +
 15993  			" ├─ columns: [min(kt.kind) as movie_kind, min(t.title) as complete_us_internet_movie]\n" +
 15994  			" └─ GroupBy\n" +
 15995  			"     ├─ SelectedExprs(MIN(kt.kind), MIN(t.title))\n" +
 15996  			"     ├─ Grouping()\n" +
 15997  			"     └─ InnerJoin\n" +
 15998  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (t.id = mk.movie_id))\n" +
 15999  			"         ├─ InnerJoin\n" +
 16000  			"         │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 16001  			"         │   ├─ InnerJoin\n" +
 16002  			"         │   │   ├─ (t.id = mi.movie_id)\n" +
 16003  			"         │   │   ├─ InnerJoin\n" +
 16004  			"         │   │   │   ├─ (kt.id = t.kind_id)\n" +
 16005  			"         │   │   │   ├─ InnerJoin\n" +
 16006  			"         │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 16007  			"         │   │   │   │   ├─ Filter\n" +
 16008  			"         │   │   │   │   │   ├─ (t.production_year > 1990)\n" +
 16009  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 16010  			"         │   │   │   │   │       └─ Table\n" +
 16011  			"         │   │   │   │   │           ├─ name: title\n" +
 16012  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 16013  			"         │   │   │   │   └─ InnerJoin\n" +
 16014  			"         │   │   │   │       ├─ (cct1.id = cc.status_id)\n" +
 16015  			"         │   │   │   │       ├─ Filter\n" +
 16016  			"         │   │   │   │       │   ├─ (cct1.kind = 'complete+verified')\n" +
 16017  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 16018  			"         │   │   │   │       │       └─ Table\n" +
 16019  			"         │   │   │   │       │           ├─ name: comp_cast_type\n" +
 16020  			"         │   │   │   │       │           └─ columns: [id kind]\n" +
 16021  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 16022  			"         │   │   │   │           └─ Table\n" +
 16023  			"         │   │   │   │               ├─ name: complete_cast\n" +
 16024  			"         │   │   │   │               └─ columns: [movie_id status_id]\n" +
 16025  			"         │   │   │   └─ Filter\n" +
 16026  			"         │   │   │       ├─ (kt.kind HASH IN ('movie', 'tv movie', 'video movie', 'video game'))\n" +
 16027  			"         │   │   │       └─ TableAlias(kt)\n" +
 16028  			"         │   │   │           └─ Table\n" +
 16029  			"         │   │   │               ├─ name: kind_type\n" +
 16030  			"         │   │   │               └─ columns: [id kind]\n" +
 16031  			"         │   │   └─ InnerJoin\n" +
 16032  			"         │   │       ├─ (it1.id = mi.info_type_id)\n" +
 16033  			"         │   │       ├─ Filter\n" +
 16034  			"         │   │       │   ├─ ((mi.note LIKE '%internet%' AND (NOT(mi.info IS NULL))) AND (mi.info LIKE 'USA:% 199%' OR mi.info LIKE 'USA:% 200%'))\n" +
 16035  			"         │   │       │   └─ TableAlias(mi)\n" +
 16036  			"         │   │       │       └─ Table\n" +
 16037  			"         │   │       │           ├─ name: movie_info\n" +
 16038  			"         │   │       │           └─ columns: [movie_id info_type_id info note]\n" +
 16039  			"         │   │       └─ Filter\n" +
 16040  			"         │   │           ├─ (it1.info = 'release dates')\n" +
 16041  			"         │   │           └─ TableAlias(it1)\n" +
 16042  			"         │   │               └─ Table\n" +
 16043  			"         │   │                   ├─ name: info_type\n" +
 16044  			"         │   │                   └─ columns: [id info]\n" +
 16045  			"         │   └─ InnerJoin\n" +
 16046  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
 16047  			"         │       ├─ InnerJoin\n" +
 16048  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
 16049  			"         │       │   ├─ TableAlias(mc)\n" +
 16050  			"         │       │   │   └─ Table\n" +
 16051  			"         │       │   │       ├─ name: movie_companies\n" +
 16052  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 16053  			"         │       │   └─ Filter\n" +
 16054  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
 16055  			"         │       │       └─ TableAlias(cn)\n" +
 16056  			"         │       │           └─ Table\n" +
 16057  			"         │       │               ├─ name: company_name\n" +
 16058  			"         │       │               └─ columns: [id country_code]\n" +
 16059  			"         │       └─ TableAlias(ct)\n" +
 16060  			"         │           └─ Table\n" +
 16061  			"         │               ├─ name: company_type\n" +
 16062  			"         │               └─ columns: [id]\n" +
 16063  			"         └─ InnerJoin\n" +
 16064  			"             ├─ (k.id = mk.keyword_id)\n" +
 16065  			"             ├─ TableAlias(mk)\n" +
 16066  			"             │   └─ Table\n" +
 16067  			"             │       ├─ name: movie_keyword\n" +
 16068  			"             │       └─ columns: [movie_id keyword_id]\n" +
 16069  			"             └─ TableAlias(k)\n" +
 16070  			"                 └─ Table\n" +
 16071  			"                     ├─ name: keyword\n" +
 16072  			"                     └─ columns: [id]\n" +
 16073  			"",
 16074  		ExpectedAnalysis: "Project\n" +
 16075  			" ├─ columns: [min(kt.kind) as movie_kind, min(t.title) as complete_us_internet_movie]\n" +
 16076  			" └─ GroupBy\n" +
 16077  			"     ├─ SelectedExprs(MIN(kt.kind), MIN(t.title))\n" +
 16078  			"     ├─ Grouping()\n" +
 16079  			"     └─ InnerJoin\n" +
 16080  			"         ├─ ((((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (t.id = mk.movie_id))\n" +
 16081  			"         ├─ InnerJoin\n" +
 16082  			"         │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 16083  			"         │   ├─ InnerJoin\n" +
 16084  			"         │   │   ├─ (t.id = mi.movie_id)\n" +
 16085  			"         │   │   ├─ InnerJoin\n" +
 16086  			"         │   │   │   ├─ (kt.id = t.kind_id)\n" +
 16087  			"         │   │   │   ├─ InnerJoin\n" +
 16088  			"         │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 16089  			"         │   │   │   │   ├─ Filter\n" +
 16090  			"         │   │   │   │   │   ├─ (t.production_year > 1990)\n" +
 16091  			"         │   │   │   │   │   └─ TableAlias(t)\n" +
 16092  			"         │   │   │   │   │       └─ Table\n" +
 16093  			"         │   │   │   │   │           ├─ name: title\n" +
 16094  			"         │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 16095  			"         │   │   │   │   └─ InnerJoin\n" +
 16096  			"         │   │   │   │       ├─ (cct1.id = cc.status_id)\n" +
 16097  			"         │   │   │   │       ├─ Filter\n" +
 16098  			"         │   │   │   │       │   ├─ (cct1.kind = 'complete+verified')\n" +
 16099  			"         │   │   │   │       │   └─ TableAlias(cct1)\n" +
 16100  			"         │   │   │   │       │       └─ Table\n" +
 16101  			"         │   │   │   │       │           ├─ name: comp_cast_type\n" +
 16102  			"         │   │   │   │       │           └─ columns: [id kind]\n" +
 16103  			"         │   │   │   │       └─ TableAlias(cc)\n" +
 16104  			"         │   │   │   │           └─ Table\n" +
 16105  			"         │   │   │   │               ├─ name: complete_cast\n" +
 16106  			"         │   │   │   │               └─ columns: [movie_id status_id]\n" +
 16107  			"         │   │   │   └─ Filter\n" +
 16108  			"         │   │   │       ├─ (kt.kind HASH IN ('movie', 'tv movie', 'video movie', 'video game'))\n" +
 16109  			"         │   │   │       └─ TableAlias(kt)\n" +
 16110  			"         │   │   │           └─ Table\n" +
 16111  			"         │   │   │               ├─ name: kind_type\n" +
 16112  			"         │   │   │               └─ columns: [id kind]\n" +
 16113  			"         │   │   └─ InnerJoin\n" +
 16114  			"         │   │       ├─ (it1.id = mi.info_type_id)\n" +
 16115  			"         │   │       ├─ Filter\n" +
 16116  			"         │   │       │   ├─ ((mi.note LIKE '%internet%' AND (NOT(mi.info IS NULL))) AND (mi.info LIKE 'USA:% 199%' OR mi.info LIKE 'USA:% 200%'))\n" +
 16117  			"         │   │       │   └─ TableAlias(mi)\n" +
 16118  			"         │   │       │       └─ Table\n" +
 16119  			"         │   │       │           ├─ name: movie_info\n" +
 16120  			"         │   │       │           └─ columns: [movie_id info_type_id info note]\n" +
 16121  			"         │   │       └─ Filter\n" +
 16122  			"         │   │           ├─ (it1.info = 'release dates')\n" +
 16123  			"         │   │           └─ TableAlias(it1)\n" +
 16124  			"         │   │               └─ Table\n" +
 16125  			"         │   │                   ├─ name: info_type\n" +
 16126  			"         │   │                   └─ columns: [id info]\n" +
 16127  			"         │   └─ InnerJoin\n" +
 16128  			"         │       ├─ (ct.id = mc.company_type_id)\n" +
 16129  			"         │       ├─ InnerJoin\n" +
 16130  			"         │       │   ├─ (cn.id = mc.company_id)\n" +
 16131  			"         │       │   ├─ TableAlias(mc)\n" +
 16132  			"         │       │   │   └─ Table\n" +
 16133  			"         │       │   │       ├─ name: movie_companies\n" +
 16134  			"         │       │   │       └─ columns: [movie_id company_id company_type_id]\n" +
 16135  			"         │       │   └─ Filter\n" +
 16136  			"         │       │       ├─ (cn.country_code = '[us]')\n" +
 16137  			"         │       │       └─ TableAlias(cn)\n" +
 16138  			"         │       │           └─ Table\n" +
 16139  			"         │       │               ├─ name: company_name\n" +
 16140  			"         │       │               └─ columns: [id country_code]\n" +
 16141  			"         │       └─ TableAlias(ct)\n" +
 16142  			"         │           └─ Table\n" +
 16143  			"         │               ├─ name: company_type\n" +
 16144  			"         │               └─ columns: [id]\n" +
 16145  			"         └─ InnerJoin\n" +
 16146  			"             ├─ (k.id = mk.keyword_id)\n" +
 16147  			"             ├─ TableAlias(mk)\n" +
 16148  			"             │   └─ Table\n" +
 16149  			"             │       ├─ name: movie_keyword\n" +
 16150  			"             │       └─ columns: [movie_id keyword_id]\n" +
 16151  			"             └─ TableAlias(k)\n" +
 16152  			"                 └─ Table\n" +
 16153  			"                     ├─ name: keyword\n" +
 16154  			"                     └─ columns: [id]\n" +
 16155  			"",
 16156  	},
 16157  	{
 16158  		Query: `
 16159  SELECT MIN(chn.name) AS voiced_char_name,
 16160         MIN(n.name) AS voicing_actress_name,
 16161         MIN(t.title) AS voiced_action_movie_jap_eng
 16162  FROM aka_name AS an,
 16163       char_name AS chn,
 16164       cast_info AS ci,
 16165       company_name AS cn,
 16166       info_type AS it,
 16167       keyword AS k,
 16168       movie_companies AS mc,
 16169       movie_info AS mi,
 16170       movie_keyword AS mk,
 16171       name AS n,
 16172       role_type AS rt,
 16173       title AS t
 16174  WHERE ci.note IN ('(voice)',
 16175                    '(voice: Japanese version)',
 16176                    '(voice) (uncredited)',
 16177                    '(voice: English version)')
 16178    AND cn.country_code ='[us]'
 16179    AND it.info = 'release dates'
 16180    AND k.keyword IN ('hero',
 16181                      'martial-arts',
 16182                      'hand-to-hand-combat')
 16183    AND mi.info IS NOT NULL
 16184    AND (mi.info LIKE 'Japan:%201%'
 16185         OR mi.info LIKE 'USA:%201%')
 16186    AND n.gender ='f'
 16187    AND n.name LIKE '%An%'
 16188    AND rt.role ='actress'
 16189    AND t.production_year > 2010
 16190    AND t.id = mi.movie_id
 16191    AND t.id = mc.movie_id
 16192    AND t.id = ci.movie_id
 16193    AND t.id = mk.movie_id
 16194    AND mc.movie_id = ci.movie_id
 16195    AND mc.movie_id = mi.movie_id
 16196    AND mc.movie_id = mk.movie_id
 16197    AND mi.movie_id = ci.movie_id
 16198    AND mi.movie_id = mk.movie_id
 16199    AND ci.movie_id = mk.movie_id
 16200    AND cn.id = mc.company_id
 16201    AND it.id = mi.info_type_id
 16202    AND n.id = ci.person_id
 16203    AND rt.id = ci.role_id
 16204    AND n.id = an.person_id
 16205    AND ci.person_id = an.person_id
 16206    AND chn.id = ci.person_role_id
 16207    AND k.id = mk.keyword_id;
 16208  
 16209  `,
 16210  		ExpectedPlan: "Project\n" +
 16211  			" ├─ columns: [min(chn.name):0!null as voiced_char_name, min(n.name):1!null as voicing_actress_name, min(t.title):2!null as voiced_action_movie_jap_eng]\n" +
 16212  			" └─ GroupBy\n" +
 16213  			"     ├─ select: MIN(chn.name:25!null), MIN(n.name:6!null), MIN(t.title:1!null)\n" +
 16214  			"     ├─ group: \n" +
 16215  			"     └─ InnerJoin\n" +
 16216  			"         ├─ AND\n" +
 16217  			"         │   ├─ AND\n" +
 16218  			"         │   │   ├─ AND\n" +
 16219  			"         │   │   │   ├─ Eq\n" +
 16220  			"         │   │   │   │   ├─ t.id:0!null\n" +
 16221  			"         │   │   │   │   └─ mi.movie_id:12!null\n" +
 16222  			"         │   │   │   └─ Eq\n" +
 16223  			"         │   │   │       ├─ t.id:0!null\n" +
 16224  			"         │   │   │       └─ mc.movie_id:17!null\n" +
 16225  			"         │   │   └─ Eq\n" +
 16226  			"         │   │       ├─ t.id:0!null\n" +
 16227  			"         │   │       └─ ci.movie_id:20!null\n" +
 16228  			"         │   └─ Eq\n" +
 16229  			"         │       ├─ t.id:0!null\n" +
 16230  			"         │       └─ mk.movie_id:8!null\n" +
 16231  			"         ├─ Filter\n" +
 16232  			"         │   ├─ GreaterThan\n" +
 16233  			"         │   │   ├─ t.production_year:2\n" +
 16234  			"         │   │   └─ 2010 (smallint)\n" +
 16235  			"         │   └─ TableAlias(t)\n" +
 16236  			"         │       └─ ProcessTable\n" +
 16237  			"         │           └─ Table\n" +
 16238  			"         │               ├─ name: title\n" +
 16239  			"         │               └─ columns: [id title production_year]\n" +
 16240  			"         └─ InnerJoin\n" +
 16241  			"             ├─ Eq\n" +
 16242  			"             │   ├─ rt.id:3!null\n" +
 16243  			"             │   └─ ci.role_id:23!null\n" +
 16244  			"             ├─ Filter\n" +
 16245  			"             │   ├─ Eq\n" +
 16246  			"             │   │   ├─ rt.role:1!null\n" +
 16247  			"             │   │   └─ actress (longtext)\n" +
 16248  			"             │   └─ TableAlias(rt)\n" +
 16249  			"             │       └─ ProcessTable\n" +
 16250  			"             │           └─ Table\n" +
 16251  			"             │               ├─ name: role_type\n" +
 16252  			"             │               └─ columns: [id role]\n" +
 16253  			"             └─ InnerJoin\n" +
 16254  			"                 ├─ AND\n" +
 16255  			"                 │   ├─ Eq\n" +
 16256  			"                 │   │   ├─ n.id:5!null\n" +
 16257  			"                 │   │   └─ ci.person_id:19!null\n" +
 16258  			"                 │   └─ Eq\n" +
 16259  			"                 │       ├─ n.id:5!null\n" +
 16260  			"                 │       └─ an.person_id:26!null\n" +
 16261  			"                 ├─ Filter\n" +
 16262  			"                 │   ├─ AND\n" +
 16263  			"                 │   │   ├─ Eq\n" +
 16264  			"                 │   │   │   ├─ n.gender:2\n" +
 16265  			"                 │   │   │   └─ f (longtext)\n" +
 16266  			"                 │   │   └─ n.name LIKE '%An%'\n" +
 16267  			"                 │   └─ TableAlias(n)\n" +
 16268  			"                 │       └─ ProcessTable\n" +
 16269  			"                 │           └─ Table\n" +
 16270  			"                 │               ├─ name: name\n" +
 16271  			"                 │               └─ columns: [id name gender]\n" +
 16272  			"                 └─ InnerJoin\n" +
 16273  			"                     ├─ AND\n" +
 16274  			"                     │   ├─ AND\n" +
 16275  			"                     │   │   ├─ Eq\n" +
 16276  			"                     │   │   │   ├─ mc.movie_id:17!null\n" +
 16277  			"                     │   │   │   └─ mk.movie_id:8!null\n" +
 16278  			"                     │   │   └─ Eq\n" +
 16279  			"                     │   │       ├─ mi.movie_id:12!null\n" +
 16280  			"                     │   │       └─ mk.movie_id:8!null\n" +
 16281  			"                     │   └─ Eq\n" +
 16282  			"                     │       ├─ ci.movie_id:20!null\n" +
 16283  			"                     │       └─ mk.movie_id:8!null\n" +
 16284  			"                     ├─ InnerJoin\n" +
 16285  			"                     │   ├─ Eq\n" +
 16286  			"                     │   │   ├─ k.id:10!null\n" +
 16287  			"                     │   │   └─ mk.keyword_id:9!null\n" +
 16288  			"                     │   ├─ TableAlias(mk)\n" +
 16289  			"                     │   │   └─ ProcessTable\n" +
 16290  			"                     │   │       └─ Table\n" +
 16291  			"                     │   │           ├─ name: movie_keyword\n" +
 16292  			"                     │   │           └─ columns: [movie_id keyword_id]\n" +
 16293  			"                     │   └─ Filter\n" +
 16294  			"                     │       ├─ HashIn\n" +
 16295  			"                     │       │   ├─ k.keyword:1!null\n" +
 16296  			"                     │       │   └─ TUPLE(hero (longtext), martial-arts (longtext), hand-to-hand-combat (longtext))\n" +
 16297  			"                     │       └─ TableAlias(k)\n" +
 16298  			"                     │           └─ ProcessTable\n" +
 16299  			"                     │               └─ Table\n" +
 16300  			"                     │                   ├─ name: keyword\n" +
 16301  			"                     │                   └─ columns: [id keyword]\n" +
 16302  			"                     └─ InnerJoin\n" +
 16303  			"                         ├─ AND\n" +
 16304  			"                         │   ├─ Eq\n" +
 16305  			"                         │   │   ├─ mc.movie_id:17!null\n" +
 16306  			"                         │   │   └─ mi.movie_id:12!null\n" +
 16307  			"                         │   └─ Eq\n" +
 16308  			"                         │       ├─ mi.movie_id:12!null\n" +
 16309  			"                         │       └─ ci.movie_id:20!null\n" +
 16310  			"                         ├─ InnerJoin\n" +
 16311  			"                         │   ├─ Eq\n" +
 16312  			"                         │   │   ├─ it.id:15!null\n" +
 16313  			"                         │   │   └─ mi.info_type_id:13!null\n" +
 16314  			"                         │   ├─ Filter\n" +
 16315  			"                         │   │   ├─ AND\n" +
 16316  			"                         │   │   │   ├─ NOT\n" +
 16317  			"                         │   │   │   │   └─ mi.info:2!null IS NULL\n" +
 16318  			"                         │   │   │   └─ Or\n" +
 16319  			"                         │   │   │       ├─ mi.info LIKE 'Japan:%201%'\n" +
 16320  			"                         │   │   │       └─ mi.info LIKE 'USA:%201%'\n" +
 16321  			"                         │   │   └─ TableAlias(mi)\n" +
 16322  			"                         │   │       └─ ProcessTable\n" +
 16323  			"                         │   │           └─ Table\n" +
 16324  			"                         │   │               ├─ name: movie_info\n" +
 16325  			"                         │   │               └─ columns: [movie_id info_type_id info]\n" +
 16326  			"                         │   └─ Filter\n" +
 16327  			"                         │       ├─ Eq\n" +
 16328  			"                         │       │   ├─ it.info:1!null\n" +
 16329  			"                         │       │   └─ release dates (longtext)\n" +
 16330  			"                         │       └─ TableAlias(it)\n" +
 16331  			"                         │           └─ ProcessTable\n" +
 16332  			"                         │               └─ Table\n" +
 16333  			"                         │                   ├─ name: info_type\n" +
 16334  			"                         │                   └─ columns: [id info]\n" +
 16335  			"                         └─ InnerJoin\n" +
 16336  			"                             ├─ Eq\n" +
 16337  			"                             │   ├─ cn.id:27!null\n" +
 16338  			"                             │   └─ mc.company_id:18!null\n" +
 16339  			"                             ├─ InnerJoin\n" +
 16340  			"                             │   ├─ Eq\n" +
 16341  			"                             │   │   ├─ mc.movie_id:17!null\n" +
 16342  			"                             │   │   └─ ci.movie_id:20!null\n" +
 16343  			"                             │   ├─ TableAlias(mc)\n" +
 16344  			"                             │   │   └─ ProcessTable\n" +
 16345  			"                             │   │       └─ Table\n" +
 16346  			"                             │   │           ├─ name: movie_companies\n" +
 16347  			"                             │   │           └─ columns: [movie_id company_id]\n" +
 16348  			"                             │   └─ LookupJoin\n" +
 16349  			"                             │       ├─ InnerJoin\n" +
 16350  			"                             │       │   ├─ Eq\n" +
 16351  			"                             │       │   │   ├─ chn.id:24!null\n" +
 16352  			"                             │       │   │   └─ ci.person_role_id:21\n" +
 16353  			"                             │       │   ├─ Filter\n" +
 16354  			"                             │       │   │   ├─ HashIn\n" +
 16355  			"                             │       │   │   │   ├─ ci.note:3\n" +
 16356  			"                             │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 16357  			"                             │       │   │   └─ TableAlias(ci)\n" +
 16358  			"                             │       │   │       └─ ProcessTable\n" +
 16359  			"                             │       │   │           └─ Table\n" +
 16360  			"                             │       │   │               ├─ name: cast_info\n" +
 16361  			"                             │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 16362  			"                             │       │   └─ TableAlias(chn)\n" +
 16363  			"                             │       │       └─ ProcessTable\n" +
 16364  			"                             │       │           └─ Table\n" +
 16365  			"                             │       │               ├─ name: char_name\n" +
 16366  			"                             │       │               └─ columns: [id name]\n" +
 16367  			"                             │       └─ TableAlias(an)\n" +
 16368  			"                             │           └─ IndexedTableAccess(aka_name)\n" +
 16369  			"                             │               ├─ index: [aka_name.person_id]\n" +
 16370  			"                             │               ├─ keys: [ci.person_id:19!null]\n" +
 16371  			"                             │               ├─ colSet: (1-8)\n" +
 16372  			"                             │               ├─ tableId: 1\n" +
 16373  			"                             │               └─ Table\n" +
 16374  			"                             │                   ├─ name: aka_name\n" +
 16375  			"                             │                   └─ columns: [person_id]\n" +
 16376  			"                             └─ Filter\n" +
 16377  			"                                 ├─ Eq\n" +
 16378  			"                                 │   ├─ cn.country_code:1\n" +
 16379  			"                                 │   └─ [us] (longtext)\n" +
 16380  			"                                 └─ TableAlias(cn)\n" +
 16381  			"                                     └─ ProcessTable\n" +
 16382  			"                                         └─ Table\n" +
 16383  			"                                             ├─ name: company_name\n" +
 16384  			"                                             └─ columns: [id country_code]\n" +
 16385  			"",
 16386  		ExpectedEstimates: "Project\n" +
 16387  			" ├─ columns: [min(chn.name) as voiced_char_name, min(n.name) as voicing_actress_name, min(t.title) as voiced_action_movie_jap_eng]\n" +
 16388  			" └─ GroupBy\n" +
 16389  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 16390  			"     ├─ Grouping()\n" +
 16391  			"     └─ InnerJoin\n" +
 16392  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 16393  			"         ├─ Filter\n" +
 16394  			"         │   ├─ (t.production_year > 2010)\n" +
 16395  			"         │   └─ TableAlias(t)\n" +
 16396  			"         │       └─ Table\n" +
 16397  			"         │           ├─ name: title\n" +
 16398  			"         │           └─ columns: [id title production_year]\n" +
 16399  			"         └─ InnerJoin\n" +
 16400  			"             ├─ (rt.id = ci.role_id)\n" +
 16401  			"             ├─ Filter\n" +
 16402  			"             │   ├─ (rt.role = 'actress')\n" +
 16403  			"             │   └─ TableAlias(rt)\n" +
 16404  			"             │       └─ Table\n" +
 16405  			"             │           ├─ name: role_type\n" +
 16406  			"             │           └─ columns: [id role]\n" +
 16407  			"             └─ InnerJoin\n" +
 16408  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 16409  			"                 ├─ Filter\n" +
 16410  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 16411  			"                 │   └─ TableAlias(n)\n" +
 16412  			"                 │       └─ Table\n" +
 16413  			"                 │           ├─ name: name\n" +
 16414  			"                 │           └─ columns: [id name gender]\n" +
 16415  			"                 └─ InnerJoin\n" +
 16416  			"                     ├─ (((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id))\n" +
 16417  			"                     ├─ InnerJoin\n" +
 16418  			"                     │   ├─ (k.id = mk.keyword_id)\n" +
 16419  			"                     │   ├─ TableAlias(mk)\n" +
 16420  			"                     │   │   └─ Table\n" +
 16421  			"                     │   │       ├─ name: movie_keyword\n" +
 16422  			"                     │   │       └─ columns: [movie_id keyword_id]\n" +
 16423  			"                     │   └─ Filter\n" +
 16424  			"                     │       ├─ (k.keyword HASH IN ('hero', 'martial-arts', 'hand-to-hand-combat'))\n" +
 16425  			"                     │       └─ TableAlias(k)\n" +
 16426  			"                     │           └─ Table\n" +
 16427  			"                     │               ├─ name: keyword\n" +
 16428  			"                     │               └─ columns: [id keyword]\n" +
 16429  			"                     └─ InnerJoin\n" +
 16430  			"                         ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 16431  			"                         ├─ InnerJoin\n" +
 16432  			"                         │   ├─ (it.id = mi.info_type_id)\n" +
 16433  			"                         │   ├─ Filter\n" +
 16434  			"                         │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%201%' OR mi.info LIKE 'USA:%201%'))\n" +
 16435  			"                         │   │   └─ TableAlias(mi)\n" +
 16436  			"                         │   │       └─ Table\n" +
 16437  			"                         │   │           ├─ name: movie_info\n" +
 16438  			"                         │   │           └─ columns: [movie_id info_type_id info]\n" +
 16439  			"                         │   └─ Filter\n" +
 16440  			"                         │       ├─ (it.info = 'release dates')\n" +
 16441  			"                         │       └─ TableAlias(it)\n" +
 16442  			"                         │           └─ Table\n" +
 16443  			"                         │               ├─ name: info_type\n" +
 16444  			"                         │               └─ columns: [id info]\n" +
 16445  			"                         └─ InnerJoin\n" +
 16446  			"                             ├─ (cn.id = mc.company_id)\n" +
 16447  			"                             ├─ InnerJoin\n" +
 16448  			"                             │   ├─ (mc.movie_id = ci.movie_id)\n" +
 16449  			"                             │   ├─ TableAlias(mc)\n" +
 16450  			"                             │   │   └─ Table\n" +
 16451  			"                             │   │       ├─ name: movie_companies\n" +
 16452  			"                             │   │       └─ columns: [movie_id company_id]\n" +
 16453  			"                             │   └─ LookupJoin\n" +
 16454  			"                             │       ├─ InnerJoin\n" +
 16455  			"                             │       │   ├─ (chn.id = ci.person_role_id)\n" +
 16456  			"                             │       │   ├─ Filter\n" +
 16457  			"                             │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 16458  			"                             │       │   │   └─ TableAlias(ci)\n" +
 16459  			"                             │       │   │       └─ Table\n" +
 16460  			"                             │       │   │           ├─ name: cast_info\n" +
 16461  			"                             │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 16462  			"                             │       │   └─ TableAlias(chn)\n" +
 16463  			"                             │       │       └─ Table\n" +
 16464  			"                             │       │           ├─ name: char_name\n" +
 16465  			"                             │       │           └─ columns: [id name]\n" +
 16466  			"                             │       └─ TableAlias(an)\n" +
 16467  			"                             │           └─ IndexedTableAccess(aka_name)\n" +
 16468  			"                             │               ├─ index: [aka_name.person_id]\n" +
 16469  			"                             │               ├─ columns: [person_id]\n" +
 16470  			"                             │               └─ keys: ci.person_id\n" +
 16471  			"                             └─ Filter\n" +
 16472  			"                                 ├─ (cn.country_code = '[us]')\n" +
 16473  			"                                 └─ TableAlias(cn)\n" +
 16474  			"                                     └─ Table\n" +
 16475  			"                                         ├─ name: company_name\n" +
 16476  			"                                         └─ columns: [id country_code]\n" +
 16477  			"",
 16478  		ExpectedAnalysis: "Project\n" +
 16479  			" ├─ columns: [min(chn.name) as voiced_char_name, min(n.name) as voicing_actress_name, min(t.title) as voiced_action_movie_jap_eng]\n" +
 16480  			" └─ GroupBy\n" +
 16481  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 16482  			"     ├─ Grouping()\n" +
 16483  			"     └─ InnerJoin\n" +
 16484  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 16485  			"         ├─ Filter\n" +
 16486  			"         │   ├─ (t.production_year > 2010)\n" +
 16487  			"         │   └─ TableAlias(t)\n" +
 16488  			"         │       └─ Table\n" +
 16489  			"         │           ├─ name: title\n" +
 16490  			"         │           └─ columns: [id title production_year]\n" +
 16491  			"         └─ InnerJoin\n" +
 16492  			"             ├─ (rt.id = ci.role_id)\n" +
 16493  			"             ├─ Filter\n" +
 16494  			"             │   ├─ (rt.role = 'actress')\n" +
 16495  			"             │   └─ TableAlias(rt)\n" +
 16496  			"             │       └─ Table\n" +
 16497  			"             │           ├─ name: role_type\n" +
 16498  			"             │           └─ columns: [id role]\n" +
 16499  			"             └─ InnerJoin\n" +
 16500  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 16501  			"                 ├─ Filter\n" +
 16502  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 16503  			"                 │   └─ TableAlias(n)\n" +
 16504  			"                 │       └─ Table\n" +
 16505  			"                 │           ├─ name: name\n" +
 16506  			"                 │           └─ columns: [id name gender]\n" +
 16507  			"                 └─ InnerJoin\n" +
 16508  			"                     ├─ (((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id))\n" +
 16509  			"                     ├─ InnerJoin\n" +
 16510  			"                     │   ├─ (k.id = mk.keyword_id)\n" +
 16511  			"                     │   ├─ TableAlias(mk)\n" +
 16512  			"                     │   │   └─ Table\n" +
 16513  			"                     │   │       ├─ name: movie_keyword\n" +
 16514  			"                     │   │       └─ columns: [movie_id keyword_id]\n" +
 16515  			"                     │   └─ Filter\n" +
 16516  			"                     │       ├─ (k.keyword HASH IN ('hero', 'martial-arts', 'hand-to-hand-combat'))\n" +
 16517  			"                     │       └─ TableAlias(k)\n" +
 16518  			"                     │           └─ Table\n" +
 16519  			"                     │               ├─ name: keyword\n" +
 16520  			"                     │               └─ columns: [id keyword]\n" +
 16521  			"                     └─ InnerJoin\n" +
 16522  			"                         ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 16523  			"                         ├─ InnerJoin\n" +
 16524  			"                         │   ├─ (it.id = mi.info_type_id)\n" +
 16525  			"                         │   ├─ Filter\n" +
 16526  			"                         │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%201%' OR mi.info LIKE 'USA:%201%'))\n" +
 16527  			"                         │   │   └─ TableAlias(mi)\n" +
 16528  			"                         │   │       └─ Table\n" +
 16529  			"                         │   │           ├─ name: movie_info\n" +
 16530  			"                         │   │           └─ columns: [movie_id info_type_id info]\n" +
 16531  			"                         │   └─ Filter\n" +
 16532  			"                         │       ├─ (it.info = 'release dates')\n" +
 16533  			"                         │       └─ TableAlias(it)\n" +
 16534  			"                         │           └─ Table\n" +
 16535  			"                         │               ├─ name: info_type\n" +
 16536  			"                         │               └─ columns: [id info]\n" +
 16537  			"                         └─ InnerJoin\n" +
 16538  			"                             ├─ (cn.id = mc.company_id)\n" +
 16539  			"                             ├─ InnerJoin\n" +
 16540  			"                             │   ├─ (mc.movie_id = ci.movie_id)\n" +
 16541  			"                             │   ├─ TableAlias(mc)\n" +
 16542  			"                             │   │   └─ Table\n" +
 16543  			"                             │   │       ├─ name: movie_companies\n" +
 16544  			"                             │   │       └─ columns: [movie_id company_id]\n" +
 16545  			"                             │   └─ LookupJoin\n" +
 16546  			"                             │       ├─ InnerJoin\n" +
 16547  			"                             │       │   ├─ (chn.id = ci.person_role_id)\n" +
 16548  			"                             │       │   ├─ Filter\n" +
 16549  			"                             │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 16550  			"                             │       │   │   └─ TableAlias(ci)\n" +
 16551  			"                             │       │   │       └─ Table\n" +
 16552  			"                             │       │   │           ├─ name: cast_info\n" +
 16553  			"                             │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 16554  			"                             │       │   └─ TableAlias(chn)\n" +
 16555  			"                             │       │       └─ Table\n" +
 16556  			"                             │       │           ├─ name: char_name\n" +
 16557  			"                             │       │           └─ columns: [id name]\n" +
 16558  			"                             │       └─ TableAlias(an)\n" +
 16559  			"                             │           └─ IndexedTableAccess(aka_name)\n" +
 16560  			"                             │               ├─ index: [aka_name.person_id]\n" +
 16561  			"                             │               ├─ columns: [person_id]\n" +
 16562  			"                             │               └─ keys: ci.person_id\n" +
 16563  			"                             └─ Filter\n" +
 16564  			"                                 ├─ (cn.country_code = '[us]')\n" +
 16565  			"                                 └─ TableAlias(cn)\n" +
 16566  			"                                     └─ Table\n" +
 16567  			"                                         ├─ name: company_name\n" +
 16568  			"                                         └─ columns: [id country_code]\n" +
 16569  			"",
 16570  	},
 16571  	{
 16572  		Query: `
 16573  SELECT MIN(chn.name) AS voiced_char_name,
 16574         MIN(n.name) AS voicing_actress_name,
 16575         MIN(t.title) AS kung_fu_panda
 16576  FROM aka_name AS an,
 16577       char_name AS chn,
 16578       cast_info AS ci,
 16579       company_name AS cn,
 16580       info_type AS it,
 16581       keyword AS k,
 16582       movie_companies AS mc,
 16583       movie_info AS mi,
 16584       movie_keyword AS mk,
 16585       name AS n,
 16586       role_type AS rt,
 16587       title AS t
 16588  WHERE ci.note IN ('(voice)',
 16589                    '(voice: Japanese version)',
 16590                    '(voice) (uncredited)',
 16591                    '(voice: English version)')
 16592    AND cn.country_code ='[us]'
 16593    AND cn.name = 'DreamWorks Animation'
 16594    AND it.info = 'release dates'
 16595    AND k.keyword IN ('hero',
 16596                      'martial-arts',
 16597                      'hand-to-hand-combat',
 16598                      'computer-animated-movie')
 16599    AND mi.info IS NOT NULL
 16600    AND (mi.info LIKE 'Japan:%201%'
 16601         OR mi.info LIKE 'USA:%201%')
 16602    AND n.gender ='f'
 16603    AND n.name LIKE '%An%'
 16604    AND rt.role ='actress'
 16605    AND t.production_year > 2010
 16606    AND t.title LIKE 'Kung Fu Panda%'
 16607    AND t.id = mi.movie_id
 16608    AND t.id = mc.movie_id
 16609    AND t.id = ci.movie_id
 16610    AND t.id = mk.movie_id
 16611    AND mc.movie_id = ci.movie_id
 16612    AND mc.movie_id = mi.movie_id
 16613    AND mc.movie_id = mk.movie_id
 16614    AND mi.movie_id = ci.movie_id
 16615    AND mi.movie_id = mk.movie_id
 16616    AND ci.movie_id = mk.movie_id
 16617    AND cn.id = mc.company_id
 16618    AND it.id = mi.info_type_id
 16619    AND n.id = ci.person_id
 16620    AND rt.id = ci.role_id
 16621    AND n.id = an.person_id
 16622    AND ci.person_id = an.person_id
 16623    AND chn.id = ci.person_role_id
 16624    AND k.id = mk.keyword_id;
 16625  
 16626  `,
 16627  		ExpectedPlan: "Project\n" +
 16628  			" ├─ columns: [min(chn.name):0!null as voiced_char_name, min(n.name):1!null as voicing_actress_name, min(t.title):2!null as kung_fu_panda]\n" +
 16629  			" └─ GroupBy\n" +
 16630  			"     ├─ select: MIN(chn.name:25!null), MIN(n.name:6!null), MIN(t.title:1!null)\n" +
 16631  			"     ├─ group: \n" +
 16632  			"     └─ InnerJoin\n" +
 16633  			"         ├─ AND\n" +
 16634  			"         │   ├─ AND\n" +
 16635  			"         │   │   ├─ AND\n" +
 16636  			"         │   │   │   ├─ Eq\n" +
 16637  			"         │   │   │   │   ├─ t.id:0!null\n" +
 16638  			"         │   │   │   │   └─ mi.movie_id:12!null\n" +
 16639  			"         │   │   │   └─ Eq\n" +
 16640  			"         │   │   │       ├─ t.id:0!null\n" +
 16641  			"         │   │   │       └─ mc.movie_id:17!null\n" +
 16642  			"         │   │   └─ Eq\n" +
 16643  			"         │   │       ├─ t.id:0!null\n" +
 16644  			"         │   │       └─ ci.movie_id:20!null\n" +
 16645  			"         │   └─ Eq\n" +
 16646  			"         │       ├─ t.id:0!null\n" +
 16647  			"         │       └─ mk.movie_id:8!null\n" +
 16648  			"         ├─ Filter\n" +
 16649  			"         │   ├─ AND\n" +
 16650  			"         │   │   ├─ AND\n" +
 16651  			"         │   │   │   ├─ GreaterThan\n" +
 16652  			"         │   │   │   │   ├─ t.production_year:2\n" +
 16653  			"         │   │   │   │   └─ 2010 (smallint)\n" +
 16654  			"         │   │   │   └─ GreaterThanOrEqual\n" +
 16655  			"         │   │   │       ├─ t.title:1!null\n" +
 16656  			"         │   │   │       └─ Kung Fu Panda (longtext)\n" +
 16657  			"         │   │   └─ LessThanOrEqual\n" +
 16658  			"         │   │       ├─ t.title:1!null\n" +
 16659  			"         │   │       └─ Kung Fu Pandaÿ (longtext)\n" +
 16660  			"         │   └─ TableAlias(t)\n" +
 16661  			"         │       └─ ProcessTable\n" +
 16662  			"         │           └─ Table\n" +
 16663  			"         │               ├─ name: title\n" +
 16664  			"         │               └─ columns: [id title production_year]\n" +
 16665  			"         └─ InnerJoin\n" +
 16666  			"             ├─ Eq\n" +
 16667  			"             │   ├─ rt.id:3!null\n" +
 16668  			"             │   └─ ci.role_id:23!null\n" +
 16669  			"             ├─ Filter\n" +
 16670  			"             │   ├─ Eq\n" +
 16671  			"             │   │   ├─ rt.role:1!null\n" +
 16672  			"             │   │   └─ actress (longtext)\n" +
 16673  			"             │   └─ TableAlias(rt)\n" +
 16674  			"             │       └─ ProcessTable\n" +
 16675  			"             │           └─ Table\n" +
 16676  			"             │               ├─ name: role_type\n" +
 16677  			"             │               └─ columns: [id role]\n" +
 16678  			"             └─ InnerJoin\n" +
 16679  			"                 ├─ AND\n" +
 16680  			"                 │   ├─ Eq\n" +
 16681  			"                 │   │   ├─ n.id:5!null\n" +
 16682  			"                 │   │   └─ ci.person_id:19!null\n" +
 16683  			"                 │   └─ Eq\n" +
 16684  			"                 │       ├─ n.id:5!null\n" +
 16685  			"                 │       └─ an.person_id:26!null\n" +
 16686  			"                 ├─ Filter\n" +
 16687  			"                 │   ├─ AND\n" +
 16688  			"                 │   │   ├─ Eq\n" +
 16689  			"                 │   │   │   ├─ n.gender:2\n" +
 16690  			"                 │   │   │   └─ f (longtext)\n" +
 16691  			"                 │   │   └─ n.name LIKE '%An%'\n" +
 16692  			"                 │   └─ TableAlias(n)\n" +
 16693  			"                 │       └─ ProcessTable\n" +
 16694  			"                 │           └─ Table\n" +
 16695  			"                 │               ├─ name: name\n" +
 16696  			"                 │               └─ columns: [id name gender]\n" +
 16697  			"                 └─ InnerJoin\n" +
 16698  			"                     ├─ AND\n" +
 16699  			"                     │   ├─ AND\n" +
 16700  			"                     │   │   ├─ Eq\n" +
 16701  			"                     │   │   │   ├─ mc.movie_id:17!null\n" +
 16702  			"                     │   │   │   └─ mk.movie_id:8!null\n" +
 16703  			"                     │   │   └─ Eq\n" +
 16704  			"                     │   │       ├─ mi.movie_id:12!null\n" +
 16705  			"                     │   │       └─ mk.movie_id:8!null\n" +
 16706  			"                     │   └─ Eq\n" +
 16707  			"                     │       ├─ ci.movie_id:20!null\n" +
 16708  			"                     │       └─ mk.movie_id:8!null\n" +
 16709  			"                     ├─ InnerJoin\n" +
 16710  			"                     │   ├─ Eq\n" +
 16711  			"                     │   │   ├─ k.id:10!null\n" +
 16712  			"                     │   │   └─ mk.keyword_id:9!null\n" +
 16713  			"                     │   ├─ TableAlias(mk)\n" +
 16714  			"                     │   │   └─ ProcessTable\n" +
 16715  			"                     │   │       └─ Table\n" +
 16716  			"                     │   │           ├─ name: movie_keyword\n" +
 16717  			"                     │   │           └─ columns: [movie_id keyword_id]\n" +
 16718  			"                     │   └─ Filter\n" +
 16719  			"                     │       ├─ HashIn\n" +
 16720  			"                     │       │   ├─ k.keyword:1!null\n" +
 16721  			"                     │       │   └─ TUPLE(hero (longtext), martial-arts (longtext), hand-to-hand-combat (longtext), computer-animated-movie (longtext))\n" +
 16722  			"                     │       └─ TableAlias(k)\n" +
 16723  			"                     │           └─ ProcessTable\n" +
 16724  			"                     │               └─ Table\n" +
 16725  			"                     │                   ├─ name: keyword\n" +
 16726  			"                     │                   └─ columns: [id keyword]\n" +
 16727  			"                     └─ InnerJoin\n" +
 16728  			"                         ├─ AND\n" +
 16729  			"                         │   ├─ Eq\n" +
 16730  			"                         │   │   ├─ mc.movie_id:17!null\n" +
 16731  			"                         │   │   └─ mi.movie_id:12!null\n" +
 16732  			"                         │   └─ Eq\n" +
 16733  			"                         │       ├─ mi.movie_id:12!null\n" +
 16734  			"                         │       └─ ci.movie_id:20!null\n" +
 16735  			"                         ├─ InnerJoin\n" +
 16736  			"                         │   ├─ Eq\n" +
 16737  			"                         │   │   ├─ it.id:15!null\n" +
 16738  			"                         │   │   └─ mi.info_type_id:13!null\n" +
 16739  			"                         │   ├─ Filter\n" +
 16740  			"                         │   │   ├─ AND\n" +
 16741  			"                         │   │   │   ├─ NOT\n" +
 16742  			"                         │   │   │   │   └─ mi.info:2!null IS NULL\n" +
 16743  			"                         │   │   │   └─ Or\n" +
 16744  			"                         │   │   │       ├─ mi.info LIKE 'Japan:%201%'\n" +
 16745  			"                         │   │   │       └─ mi.info LIKE 'USA:%201%'\n" +
 16746  			"                         │   │   └─ TableAlias(mi)\n" +
 16747  			"                         │   │       └─ ProcessTable\n" +
 16748  			"                         │   │           └─ Table\n" +
 16749  			"                         │   │               ├─ name: movie_info\n" +
 16750  			"                         │   │               └─ columns: [movie_id info_type_id info]\n" +
 16751  			"                         │   └─ Filter\n" +
 16752  			"                         │       ├─ Eq\n" +
 16753  			"                         │       │   ├─ it.info:1!null\n" +
 16754  			"                         │       │   └─ release dates (longtext)\n" +
 16755  			"                         │       └─ TableAlias(it)\n" +
 16756  			"                         │           └─ ProcessTable\n" +
 16757  			"                         │               └─ Table\n" +
 16758  			"                         │                   ├─ name: info_type\n" +
 16759  			"                         │                   └─ columns: [id info]\n" +
 16760  			"                         └─ InnerJoin\n" +
 16761  			"                             ├─ Eq\n" +
 16762  			"                             │   ├─ cn.id:27!null\n" +
 16763  			"                             │   └─ mc.company_id:18!null\n" +
 16764  			"                             ├─ InnerJoin\n" +
 16765  			"                             │   ├─ Eq\n" +
 16766  			"                             │   │   ├─ mc.movie_id:17!null\n" +
 16767  			"                             │   │   └─ ci.movie_id:20!null\n" +
 16768  			"                             │   ├─ TableAlias(mc)\n" +
 16769  			"                             │   │   └─ ProcessTable\n" +
 16770  			"                             │   │       └─ Table\n" +
 16771  			"                             │   │           ├─ name: movie_companies\n" +
 16772  			"                             │   │           └─ columns: [movie_id company_id]\n" +
 16773  			"                             │   └─ LookupJoin\n" +
 16774  			"                             │       ├─ InnerJoin\n" +
 16775  			"                             │       │   ├─ Eq\n" +
 16776  			"                             │       │   │   ├─ chn.id:24!null\n" +
 16777  			"                             │       │   │   └─ ci.person_role_id:21\n" +
 16778  			"                             │       │   ├─ Filter\n" +
 16779  			"                             │       │   │   ├─ HashIn\n" +
 16780  			"                             │       │   │   │   ├─ ci.note:3\n" +
 16781  			"                             │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 16782  			"                             │       │   │   └─ TableAlias(ci)\n" +
 16783  			"                             │       │   │       └─ ProcessTable\n" +
 16784  			"                             │       │   │           └─ Table\n" +
 16785  			"                             │       │   │               ├─ name: cast_info\n" +
 16786  			"                             │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 16787  			"                             │       │   └─ TableAlias(chn)\n" +
 16788  			"                             │       │       └─ ProcessTable\n" +
 16789  			"                             │       │           └─ Table\n" +
 16790  			"                             │       │               ├─ name: char_name\n" +
 16791  			"                             │       │               └─ columns: [id name]\n" +
 16792  			"                             │       └─ TableAlias(an)\n" +
 16793  			"                             │           └─ IndexedTableAccess(aka_name)\n" +
 16794  			"                             │               ├─ index: [aka_name.person_id]\n" +
 16795  			"                             │               ├─ keys: [ci.person_id:19!null]\n" +
 16796  			"                             │               ├─ colSet: (1-8)\n" +
 16797  			"                             │               ├─ tableId: 1\n" +
 16798  			"                             │               └─ Table\n" +
 16799  			"                             │                   ├─ name: aka_name\n" +
 16800  			"                             │                   └─ columns: [person_id]\n" +
 16801  			"                             └─ Filter\n" +
 16802  			"                                 ├─ AND\n" +
 16803  			"                                 │   ├─ Eq\n" +
 16804  			"                                 │   │   ├─ cn.country_code:2\n" +
 16805  			"                                 │   │   └─ [us] (longtext)\n" +
 16806  			"                                 │   └─ Eq\n" +
 16807  			"                                 │       ├─ cn.name:1!null\n" +
 16808  			"                                 │       └─ DreamWorks Animation (longtext)\n" +
 16809  			"                                 └─ TableAlias(cn)\n" +
 16810  			"                                     └─ ProcessTable\n" +
 16811  			"                                         └─ Table\n" +
 16812  			"                                             ├─ name: company_name\n" +
 16813  			"                                             └─ columns: [id name country_code]\n" +
 16814  			"",
 16815  		ExpectedEstimates: "Project\n" +
 16816  			" ├─ columns: [min(chn.name) as voiced_char_name, min(n.name) as voicing_actress_name, min(t.title) as kung_fu_panda]\n" +
 16817  			" └─ GroupBy\n" +
 16818  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 16819  			"     ├─ Grouping()\n" +
 16820  			"     └─ InnerJoin\n" +
 16821  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 16822  			"         ├─ Filter\n" +
 16823  			"         │   ├─ (((t.production_year > 2010) AND (t.title >= 'Kung Fu Panda')) AND (t.title <= 'Kung Fu Pandaÿ'))\n" +
 16824  			"         │   └─ TableAlias(t)\n" +
 16825  			"         │       └─ Table\n" +
 16826  			"         │           ├─ name: title\n" +
 16827  			"         │           └─ columns: [id title production_year]\n" +
 16828  			"         └─ InnerJoin\n" +
 16829  			"             ├─ (rt.id = ci.role_id)\n" +
 16830  			"             ├─ Filter\n" +
 16831  			"             │   ├─ (rt.role = 'actress')\n" +
 16832  			"             │   └─ TableAlias(rt)\n" +
 16833  			"             │       └─ Table\n" +
 16834  			"             │           ├─ name: role_type\n" +
 16835  			"             │           └─ columns: [id role]\n" +
 16836  			"             └─ InnerJoin\n" +
 16837  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 16838  			"                 ├─ Filter\n" +
 16839  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 16840  			"                 │   └─ TableAlias(n)\n" +
 16841  			"                 │       └─ Table\n" +
 16842  			"                 │           ├─ name: name\n" +
 16843  			"                 │           └─ columns: [id name gender]\n" +
 16844  			"                 └─ InnerJoin\n" +
 16845  			"                     ├─ (((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id))\n" +
 16846  			"                     ├─ InnerJoin\n" +
 16847  			"                     │   ├─ (k.id = mk.keyword_id)\n" +
 16848  			"                     │   ├─ TableAlias(mk)\n" +
 16849  			"                     │   │   └─ Table\n" +
 16850  			"                     │   │       ├─ name: movie_keyword\n" +
 16851  			"                     │   │       └─ columns: [movie_id keyword_id]\n" +
 16852  			"                     │   └─ Filter\n" +
 16853  			"                     │       ├─ (k.keyword HASH IN ('hero', 'martial-arts', 'hand-to-hand-combat', 'computer-animated-movie'))\n" +
 16854  			"                     │       └─ TableAlias(k)\n" +
 16855  			"                     │           └─ Table\n" +
 16856  			"                     │               ├─ name: keyword\n" +
 16857  			"                     │               └─ columns: [id keyword]\n" +
 16858  			"                     └─ InnerJoin\n" +
 16859  			"                         ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 16860  			"                         ├─ InnerJoin\n" +
 16861  			"                         │   ├─ (it.id = mi.info_type_id)\n" +
 16862  			"                         │   ├─ Filter\n" +
 16863  			"                         │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%201%' OR mi.info LIKE 'USA:%201%'))\n" +
 16864  			"                         │   │   └─ TableAlias(mi)\n" +
 16865  			"                         │   │       └─ Table\n" +
 16866  			"                         │   │           ├─ name: movie_info\n" +
 16867  			"                         │   │           └─ columns: [movie_id info_type_id info]\n" +
 16868  			"                         │   └─ Filter\n" +
 16869  			"                         │       ├─ (it.info = 'release dates')\n" +
 16870  			"                         │       └─ TableAlias(it)\n" +
 16871  			"                         │           └─ Table\n" +
 16872  			"                         │               ├─ name: info_type\n" +
 16873  			"                         │               └─ columns: [id info]\n" +
 16874  			"                         └─ InnerJoin\n" +
 16875  			"                             ├─ (cn.id = mc.company_id)\n" +
 16876  			"                             ├─ InnerJoin\n" +
 16877  			"                             │   ├─ (mc.movie_id = ci.movie_id)\n" +
 16878  			"                             │   ├─ TableAlias(mc)\n" +
 16879  			"                             │   │   └─ Table\n" +
 16880  			"                             │   │       ├─ name: movie_companies\n" +
 16881  			"                             │   │       └─ columns: [movie_id company_id]\n" +
 16882  			"                             │   └─ LookupJoin\n" +
 16883  			"                             │       ├─ InnerJoin\n" +
 16884  			"                             │       │   ├─ (chn.id = ci.person_role_id)\n" +
 16885  			"                             │       │   ├─ Filter\n" +
 16886  			"                             │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 16887  			"                             │       │   │   └─ TableAlias(ci)\n" +
 16888  			"                             │       │   │       └─ Table\n" +
 16889  			"                             │       │   │           ├─ name: cast_info\n" +
 16890  			"                             │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 16891  			"                             │       │   └─ TableAlias(chn)\n" +
 16892  			"                             │       │       └─ Table\n" +
 16893  			"                             │       │           ├─ name: char_name\n" +
 16894  			"                             │       │           └─ columns: [id name]\n" +
 16895  			"                             │       └─ TableAlias(an)\n" +
 16896  			"                             │           └─ IndexedTableAccess(aka_name)\n" +
 16897  			"                             │               ├─ index: [aka_name.person_id]\n" +
 16898  			"                             │               ├─ columns: [person_id]\n" +
 16899  			"                             │               └─ keys: ci.person_id\n" +
 16900  			"                             └─ Filter\n" +
 16901  			"                                 ├─ ((cn.country_code = '[us]') AND (cn.name = 'DreamWorks Animation'))\n" +
 16902  			"                                 └─ TableAlias(cn)\n" +
 16903  			"                                     └─ Table\n" +
 16904  			"                                         ├─ name: company_name\n" +
 16905  			"                                         └─ columns: [id name country_code]\n" +
 16906  			"",
 16907  		ExpectedAnalysis: "Project\n" +
 16908  			" ├─ columns: [min(chn.name) as voiced_char_name, min(n.name) as voicing_actress_name, min(t.title) as kung_fu_panda]\n" +
 16909  			" └─ GroupBy\n" +
 16910  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 16911  			"     ├─ Grouping()\n" +
 16912  			"     └─ InnerJoin\n" +
 16913  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 16914  			"         ├─ Filter\n" +
 16915  			"         │   ├─ (((t.production_year > 2010) AND (t.title >= 'Kung Fu Panda')) AND (t.title <= 'Kung Fu Pandaÿ'))\n" +
 16916  			"         │   └─ TableAlias(t)\n" +
 16917  			"         │       └─ Table\n" +
 16918  			"         │           ├─ name: title\n" +
 16919  			"         │           └─ columns: [id title production_year]\n" +
 16920  			"         └─ InnerJoin\n" +
 16921  			"             ├─ (rt.id = ci.role_id)\n" +
 16922  			"             ├─ Filter\n" +
 16923  			"             │   ├─ (rt.role = 'actress')\n" +
 16924  			"             │   └─ TableAlias(rt)\n" +
 16925  			"             │       └─ Table\n" +
 16926  			"             │           ├─ name: role_type\n" +
 16927  			"             │           └─ columns: [id role]\n" +
 16928  			"             └─ InnerJoin\n" +
 16929  			"                 ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 16930  			"                 ├─ Filter\n" +
 16931  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 16932  			"                 │   └─ TableAlias(n)\n" +
 16933  			"                 │       └─ Table\n" +
 16934  			"                 │           ├─ name: name\n" +
 16935  			"                 │           └─ columns: [id name gender]\n" +
 16936  			"                 └─ InnerJoin\n" +
 16937  			"                     ├─ (((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id))\n" +
 16938  			"                     ├─ InnerJoin\n" +
 16939  			"                     │   ├─ (k.id = mk.keyword_id)\n" +
 16940  			"                     │   ├─ TableAlias(mk)\n" +
 16941  			"                     │   │   └─ Table\n" +
 16942  			"                     │   │       ├─ name: movie_keyword\n" +
 16943  			"                     │   │       └─ columns: [movie_id keyword_id]\n" +
 16944  			"                     │   └─ Filter\n" +
 16945  			"                     │       ├─ (k.keyword HASH IN ('hero', 'martial-arts', 'hand-to-hand-combat', 'computer-animated-movie'))\n" +
 16946  			"                     │       └─ TableAlias(k)\n" +
 16947  			"                     │           └─ Table\n" +
 16948  			"                     │               ├─ name: keyword\n" +
 16949  			"                     │               └─ columns: [id keyword]\n" +
 16950  			"                     └─ InnerJoin\n" +
 16951  			"                         ├─ ((mc.movie_id = mi.movie_id) AND (mi.movie_id = ci.movie_id))\n" +
 16952  			"                         ├─ InnerJoin\n" +
 16953  			"                         │   ├─ (it.id = mi.info_type_id)\n" +
 16954  			"                         │   ├─ Filter\n" +
 16955  			"                         │   │   ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%201%' OR mi.info LIKE 'USA:%201%'))\n" +
 16956  			"                         │   │   └─ TableAlias(mi)\n" +
 16957  			"                         │   │       └─ Table\n" +
 16958  			"                         │   │           ├─ name: movie_info\n" +
 16959  			"                         │   │           └─ columns: [movie_id info_type_id info]\n" +
 16960  			"                         │   └─ Filter\n" +
 16961  			"                         │       ├─ (it.info = 'release dates')\n" +
 16962  			"                         │       └─ TableAlias(it)\n" +
 16963  			"                         │           └─ Table\n" +
 16964  			"                         │               ├─ name: info_type\n" +
 16965  			"                         │               └─ columns: [id info]\n" +
 16966  			"                         └─ InnerJoin\n" +
 16967  			"                             ├─ (cn.id = mc.company_id)\n" +
 16968  			"                             ├─ InnerJoin\n" +
 16969  			"                             │   ├─ (mc.movie_id = ci.movie_id)\n" +
 16970  			"                             │   ├─ TableAlias(mc)\n" +
 16971  			"                             │   │   └─ Table\n" +
 16972  			"                             │   │       ├─ name: movie_companies\n" +
 16973  			"                             │   │       └─ columns: [movie_id company_id]\n" +
 16974  			"                             │   └─ LookupJoin\n" +
 16975  			"                             │       ├─ InnerJoin\n" +
 16976  			"                             │       │   ├─ (chn.id = ci.person_role_id)\n" +
 16977  			"                             │       │   ├─ Filter\n" +
 16978  			"                             │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 16979  			"                             │       │   │   └─ TableAlias(ci)\n" +
 16980  			"                             │       │   │       └─ Table\n" +
 16981  			"                             │       │   │           ├─ name: cast_info\n" +
 16982  			"                             │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 16983  			"                             │       │   └─ TableAlias(chn)\n" +
 16984  			"                             │       │       └─ Table\n" +
 16985  			"                             │       │           ├─ name: char_name\n" +
 16986  			"                             │       │           └─ columns: [id name]\n" +
 16987  			"                             │       └─ TableAlias(an)\n" +
 16988  			"                             │           └─ IndexedTableAccess(aka_name)\n" +
 16989  			"                             │               ├─ index: [aka_name.person_id]\n" +
 16990  			"                             │               ├─ columns: [person_id]\n" +
 16991  			"                             │               └─ keys: ci.person_id\n" +
 16992  			"                             └─ Filter\n" +
 16993  			"                                 ├─ ((cn.country_code = '[us]') AND (cn.name = 'DreamWorks Animation'))\n" +
 16994  			"                                 └─ TableAlias(cn)\n" +
 16995  			"                                     └─ Table\n" +
 16996  			"                                         ├─ name: company_name\n" +
 16997  			"                                         └─ columns: [id name country_code]\n" +
 16998  			"",
 16999  	},
 17000  	{
 17001  		Query: `
 17002  SELECT MIN(mi.info) AS movie_budget,
 17003         MIN(mi_idx.info) AS movie_votes,
 17004         MIN(n.name) AS male_writer,
 17005         MIN(t.title) AS violent_movie_title
 17006  FROM cast_info AS ci,
 17007       info_type AS it1,
 17008       info_type AS it2,
 17009       keyword AS k,
 17010       movie_info AS mi,
 17011       movie_info_idx AS mi_idx,
 17012       movie_keyword AS mk,
 17013       name AS n,
 17014       title AS t
 17015  WHERE ci.note IN ('(writer)',
 17016                    '(head writer)',
 17017                    '(written by)',
 17018                    '(story)',
 17019                    '(story editor)')
 17020    AND it1.info = 'genres'
 17021    AND it2.info = 'votes'
 17022    AND k.keyword IN ('murder',
 17023                      'blood',
 17024                      'gore',
 17025                      'death',
 17026                      'female-nudity')
 17027    AND mi.info = 'Horror'
 17028    AND n.gender = 'm'
 17029    AND t.id = mi.movie_id
 17030    AND t.id = mi_idx.movie_id
 17031    AND t.id = ci.movie_id
 17032    AND t.id = mk.movie_id
 17033    AND ci.movie_id = mi.movie_id
 17034    AND ci.movie_id = mi_idx.movie_id
 17035    AND ci.movie_id = mk.movie_id
 17036    AND mi.movie_id = mi_idx.movie_id
 17037    AND mi.movie_id = mk.movie_id
 17038    AND mi_idx.movie_id = mk.movie_id
 17039    AND n.id = ci.person_id
 17040    AND it1.id = mi.info_type_id
 17041    AND it2.id = mi_idx.info_type_id
 17042    AND k.id = mk.keyword_id;
 17043  
 17044  `,
 17045  		ExpectedPlan: "Project\n" +
 17046  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as male_writer, min(t.title):3!null as violent_movie_title]\n" +
 17047  			" └─ GroupBy\n" +
 17048  			"     ├─ select: MIN(mi.info:13!null), MIN(mi_idx.info:4!null), MIN(n.name:18!null), MIN(t.title:21!null)\n" +
 17049  			"     ├─ group: \n" +
 17050  			"     └─ HashJoin\n" +
 17051  			"         ├─ AND\n" +
 17052  			"         │   ├─ AND\n" +
 17053  			"         │   │   ├─ AND\n" +
 17054  			"         │   │   │   ├─ Eq\n" +
 17055  			"         │   │   │   │   ├─ t.id:20!null\n" +
 17056  			"         │   │   │   │   └─ mi.movie_id:11!null\n" +
 17057  			"         │   │   │   └─ Eq\n" +
 17058  			"         │   │   │       ├─ t.id:20!null\n" +
 17059  			"         │   │   │       └─ mi_idx.movie_id:2!null\n" +
 17060  			"         │   │   └─ Eq\n" +
 17061  			"         │   │       ├─ t.id:20!null\n" +
 17062  			"         │   │       └─ ci.movie_id:15!null\n" +
 17063  			"         │   └─ Eq\n" +
 17064  			"         │       ├─ t.id:20!null\n" +
 17065  			"         │       └─ mk.movie_id:9!null\n" +
 17066  			"         ├─ HashJoin\n" +
 17067  			"         │   ├─ Eq\n" +
 17068  			"         │   │   ├─ n.id:17!null\n" +
 17069  			"         │   │   └─ ci.person_id:14!null\n" +
 17070  			"         │   ├─ HashJoin\n" +
 17071  			"         │   │   ├─ Eq\n" +
 17072  			"         │   │   │   ├─ it2.id:0!null\n" +
 17073  			"         │   │   │   └─ mi_idx.info_type_id:3!null\n" +
 17074  			"         │   │   ├─ Filter\n" +
 17075  			"         │   │   │   ├─ Eq\n" +
 17076  			"         │   │   │   │   ├─ it2.info:1!null\n" +
 17077  			"         │   │   │   │   └─ votes (longtext)\n" +
 17078  			"         │   │   │   └─ TableAlias(it2)\n" +
 17079  			"         │   │   │       └─ ProcessTable\n" +
 17080  			"         │   │   │           └─ Table\n" +
 17081  			"         │   │   │               ├─ name: info_type\n" +
 17082  			"         │   │   │               └─ columns: [id info]\n" +
 17083  			"         │   │   └─ HashLookup\n" +
 17084  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
 17085  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:1!null)\n" +
 17086  			"         │   │       └─ HashJoin\n" +
 17087  			"         │   │           ├─ AND\n" +
 17088  			"         │   │           │   ├─ Eq\n" +
 17089  			"         │   │           │   │   ├─ mi.movie_id:11!null\n" +
 17090  			"         │   │           │   │   └─ mi_idx.movie_id:2!null\n" +
 17091  			"         │   │           │   └─ Eq\n" +
 17092  			"         │   │           │       ├─ mi_idx.movie_id:2!null\n" +
 17093  			"         │   │           │       └─ mk.movie_id:9!null\n" +
 17094  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17095  			"         │   │           │   └─ ProcessTable\n" +
 17096  			"         │   │           │       └─ Table\n" +
 17097  			"         │   │           │           ├─ name: movie_info_idx\n" +
 17098  			"         │   │           │           └─ columns: [movie_id info_type_id info]\n" +
 17099  			"         │   │           └─ HashLookup\n" +
 17100  			"         │   │               ├─ left-key: TUPLE(mi_idx.movie_id:2!null, mi_idx.movie_id:2!null)\n" +
 17101  			"         │   │               ├─ right-key: TUPLE(mi.movie_id:6!null, mk.movie_id:4!null)\n" +
 17102  			"         │   │               └─ HashJoin\n" +
 17103  			"         │   │                   ├─ Eq\n" +
 17104  			"         │   │                   │   ├─ k.id:5!null\n" +
 17105  			"         │   │                   │   └─ mk.keyword_id:10!null\n" +
 17106  			"         │   │                   ├─ Filter\n" +
 17107  			"         │   │                   │   ├─ HashIn\n" +
 17108  			"         │   │                   │   │   ├─ k.keyword:1!null\n" +
 17109  			"         │   │                   │   │   └─ TUPLE(murder (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext))\n" +
 17110  			"         │   │                   │   └─ TableAlias(k)\n" +
 17111  			"         │   │                   │       └─ ProcessTable\n" +
 17112  			"         │   │                   │           └─ Table\n" +
 17113  			"         │   │                   │               ├─ name: keyword\n" +
 17114  			"         │   │                   │               └─ columns: [id keyword]\n" +
 17115  			"         │   │                   └─ HashLookup\n" +
 17116  			"         │   │                       ├─ left-key: TUPLE(k.id:5!null)\n" +
 17117  			"         │   │                       ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
 17118  			"         │   │                       └─ HashJoin\n" +
 17119  			"         │   │                           ├─ Eq\n" +
 17120  			"         │   │                           │   ├─ it1.id:7!null\n" +
 17121  			"         │   │                           │   └─ mi.info_type_id:12!null\n" +
 17122  			"         │   │                           ├─ Filter\n" +
 17123  			"         │   │                           │   ├─ Eq\n" +
 17124  			"         │   │                           │   │   ├─ it1.info:1!null\n" +
 17125  			"         │   │                           │   │   └─ genres (longtext)\n" +
 17126  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17127  			"         │   │                           │       └─ Table\n" +
 17128  			"         │   │                           │           ├─ name: info_type\n" +
 17129  			"         │   │                           │           ├─ columns: [id info]\n" +
 17130  			"         │   │                           │           ├─ colSet: (8,9)\n" +
 17131  			"         │   │                           │           └─ tableId: 2\n" +
 17132  			"         │   │                           └─ HashLookup\n" +
 17133  			"         │   │                               ├─ left-key: TUPLE(it1.id:7!null)\n" +
 17134  			"         │   │                               ├─ right-key: TUPLE(mi.info_type_id:3!null)\n" +
 17135  			"         │   │                               └─ LookupJoin\n" +
 17136  			"         │   │                                   ├─ InnerJoin\n" +
 17137  			"         │   │                                   │   ├─ Eq\n" +
 17138  			"         │   │                                   │   │   ├─ mi.movie_id:11!null\n" +
 17139  			"         │   │                                   │   │   └─ mk.movie_id:9!null\n" +
 17140  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17141  			"         │   │                                   │   │   └─ ProcessTable\n" +
 17142  			"         │   │                                   │   │       └─ Table\n" +
 17143  			"         │   │                                   │   │           ├─ name: movie_keyword\n" +
 17144  			"         │   │                                   │   │           └─ columns: [movie_id keyword_id]\n" +
 17145  			"         │   │                                   │   └─ Filter\n" +
 17146  			"         │   │                                   │       ├─ Eq\n" +
 17147  			"         │   │                                   │       │   ├─ mi.info:2!null\n" +
 17148  			"         │   │                                   │       │   └─ Horror (longtext)\n" +
 17149  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 17150  			"         │   │                                   │           └─ ProcessTable\n" +
 17151  			"         │   │                                   │               └─ Table\n" +
 17152  			"         │   │                                   │                   ├─ name: movie_info\n" +
 17153  			"         │   │                                   │                   └─ columns: [movie_id info_type_id info]\n" +
 17154  			"         │   │                                   └─ Filter\n" +
 17155  			"         │   │                                       ├─ HashIn\n" +
 17156  			"         │   │                                       │   ├─ ci.note:2\n" +
 17157  			"         │   │                                       │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 17158  			"         │   │                                       └─ TableAlias(ci)\n" +
 17159  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 17160  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 17161  			"         │   │                                               ├─ keys: [mi.movie_id:11!null]\n" +
 17162  			"         │   │                                               ├─ colSet: (1-7)\n" +
 17163  			"         │   │                                               ├─ tableId: 1\n" +
 17164  			"         │   │                                               └─ Table\n" +
 17165  			"         │   │                                                   ├─ name: cast_info\n" +
 17166  			"         │   │                                                   └─ columns: [person_id movie_id note]\n" +
 17167  			"         │   └─ HashLookup\n" +
 17168  			"         │       ├─ left-key: TUPLE(ci.person_id:14!null)\n" +
 17169  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
 17170  			"         │       └─ Filter\n" +
 17171  			"         │           ├─ Eq\n" +
 17172  			"         │           │   ├─ n.gender:2\n" +
 17173  			"         │           │   └─ m (longtext)\n" +
 17174  			"         │           └─ TableAlias(n)\n" +
 17175  			"         │               └─ ProcessTable\n" +
 17176  			"         │                   └─ Table\n" +
 17177  			"         │                       ├─ name: name\n" +
 17178  			"         │                       └─ columns: [id name gender]\n" +
 17179  			"         └─ HashLookup\n" +
 17180  			"             ├─ left-key: TUPLE(mi.movie_id:11!null, mi_idx.movie_id:2!null, ci.movie_id:15!null, mk.movie_id:9!null)\n" +
 17181  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 17182  			"             └─ TableAlias(t)\n" +
 17183  			"                 └─ ProcessTable\n" +
 17184  			"                     └─ Table\n" +
 17185  			"                         ├─ name: title\n" +
 17186  			"                         └─ columns: [id title]\n" +
 17187  			"",
 17188  		ExpectedEstimates: "Project\n" +
 17189  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as male_writer, min(t.title) as violent_movie_title]\n" +
 17190  			" └─ GroupBy\n" +
 17191  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 17192  			"     ├─ Grouping()\n" +
 17193  			"     └─ HashJoin\n" +
 17194  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 17195  			"         ├─ HashJoin\n" +
 17196  			"         │   ├─ (n.id = ci.person_id)\n" +
 17197  			"         │   ├─ HashJoin\n" +
 17198  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 17199  			"         │   │   ├─ Filter\n" +
 17200  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 17201  			"         │   │   │   └─ TableAlias(it2)\n" +
 17202  			"         │   │   │       └─ Table\n" +
 17203  			"         │   │   │           ├─ name: info_type\n" +
 17204  			"         │   │   │           └─ columns: [id info]\n" +
 17205  			"         │   │   └─ HashLookup\n" +
 17206  			"         │   │       ├─ left-key: (it2.id)\n" +
 17207  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 17208  			"         │   │       └─ HashJoin\n" +
 17209  			"         │   │           ├─ ((mi.movie_id = mi_idx.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 17210  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17211  			"         │   │           │   └─ Table\n" +
 17212  			"         │   │           │       ├─ name: movie_info_idx\n" +
 17213  			"         │   │           │       └─ columns: [movie_id info_type_id info]\n" +
 17214  			"         │   │           └─ HashLookup\n" +
 17215  			"         │   │               ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 17216  			"         │   │               ├─ right-key: (mi.movie_id, mk.movie_id)\n" +
 17217  			"         │   │               └─ HashJoin\n" +
 17218  			"         │   │                   ├─ (k.id = mk.keyword_id)\n" +
 17219  			"         │   │                   ├─ Filter\n" +
 17220  			"         │   │                   │   ├─ (k.keyword HASH IN ('murder', 'blood', 'gore', 'death', 'female-nudity'))\n" +
 17221  			"         │   │                   │   └─ TableAlias(k)\n" +
 17222  			"         │   │                   │       └─ Table\n" +
 17223  			"         │   │                   │           ├─ name: keyword\n" +
 17224  			"         │   │                   │           └─ columns: [id keyword]\n" +
 17225  			"         │   │                   └─ HashLookup\n" +
 17226  			"         │   │                       ├─ left-key: (k.id)\n" +
 17227  			"         │   │                       ├─ right-key: (mk.keyword_id)\n" +
 17228  			"         │   │                       └─ HashJoin\n" +
 17229  			"         │   │                           ├─ (it1.id = mi.info_type_id)\n" +
 17230  			"         │   │                           ├─ Filter\n" +
 17231  			"         │   │                           │   ├─ (it1.info = 'genres')\n" +
 17232  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17233  			"         │   │                           │       └─ Table\n" +
 17234  			"         │   │                           │           ├─ name: info_type\n" +
 17235  			"         │   │                           │           └─ columns: [id info]\n" +
 17236  			"         │   │                           └─ HashLookup\n" +
 17237  			"         │   │                               ├─ left-key: (it1.id)\n" +
 17238  			"         │   │                               ├─ right-key: (mi.info_type_id)\n" +
 17239  			"         │   │                               └─ LookupJoin\n" +
 17240  			"         │   │                                   ├─ InnerJoin\n" +
 17241  			"         │   │                                   │   ├─ (mi.movie_id = mk.movie_id)\n" +
 17242  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17243  			"         │   │                                   │   │   └─ Table\n" +
 17244  			"         │   │                                   │   │       ├─ name: movie_keyword\n" +
 17245  			"         │   │                                   │   │       └─ columns: [movie_id keyword_id]\n" +
 17246  			"         │   │                                   │   └─ Filter\n" +
 17247  			"         │   │                                   │       ├─ (mi.info = 'Horror')\n" +
 17248  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 17249  			"         │   │                                   │           └─ Table\n" +
 17250  			"         │   │                                   │               ├─ name: movie_info\n" +
 17251  			"         │   │                                   │               └─ columns: [movie_id info_type_id info]\n" +
 17252  			"         │   │                                   └─ Filter\n" +
 17253  			"         │   │                                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 17254  			"         │   │                                       └─ TableAlias(ci)\n" +
 17255  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 17256  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 17257  			"         │   │                                               ├─ columns: [person_id movie_id note]\n" +
 17258  			"         │   │                                               └─ keys: mi.movie_id\n" +
 17259  			"         │   └─ HashLookup\n" +
 17260  			"         │       ├─ left-key: (ci.person_id)\n" +
 17261  			"         │       ├─ right-key: (n.id)\n" +
 17262  			"         │       └─ Filter\n" +
 17263  			"         │           ├─ (n.gender = 'm')\n" +
 17264  			"         │           └─ TableAlias(n)\n" +
 17265  			"         │               └─ Table\n" +
 17266  			"         │                   ├─ name: name\n" +
 17267  			"         │                   └─ columns: [id name gender]\n" +
 17268  			"         └─ HashLookup\n" +
 17269  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id)\n" +
 17270  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
 17271  			"             └─ TableAlias(t)\n" +
 17272  			"                 └─ Table\n" +
 17273  			"                     ├─ name: title\n" +
 17274  			"                     └─ columns: [id title]\n" +
 17275  			"",
 17276  		ExpectedAnalysis: "Project\n" +
 17277  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as male_writer, min(t.title) as violent_movie_title]\n" +
 17278  			" └─ GroupBy\n" +
 17279  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 17280  			"     ├─ Grouping()\n" +
 17281  			"     └─ HashJoin\n" +
 17282  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 17283  			"         ├─ HashJoin\n" +
 17284  			"         │   ├─ (n.id = ci.person_id)\n" +
 17285  			"         │   ├─ HashJoin\n" +
 17286  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 17287  			"         │   │   ├─ Filter\n" +
 17288  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 17289  			"         │   │   │   └─ TableAlias(it2)\n" +
 17290  			"         │   │   │       └─ Table\n" +
 17291  			"         │   │   │           ├─ name: info_type\n" +
 17292  			"         │   │   │           └─ columns: [id info]\n" +
 17293  			"         │   │   └─ HashLookup\n" +
 17294  			"         │   │       ├─ left-key: (it2.id)\n" +
 17295  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 17296  			"         │   │       └─ HashJoin\n" +
 17297  			"         │   │           ├─ ((mi.movie_id = mi_idx.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 17298  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17299  			"         │   │           │   └─ Table\n" +
 17300  			"         │   │           │       ├─ name: movie_info_idx\n" +
 17301  			"         │   │           │       └─ columns: [movie_id info_type_id info]\n" +
 17302  			"         │   │           └─ HashLookup\n" +
 17303  			"         │   │               ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 17304  			"         │   │               ├─ right-key: (mi.movie_id, mk.movie_id)\n" +
 17305  			"         │   │               └─ HashJoin\n" +
 17306  			"         │   │                   ├─ (k.id = mk.keyword_id)\n" +
 17307  			"         │   │                   ├─ Filter\n" +
 17308  			"         │   │                   │   ├─ (k.keyword HASH IN ('murder', 'blood', 'gore', 'death', 'female-nudity'))\n" +
 17309  			"         │   │                   │   └─ TableAlias(k)\n" +
 17310  			"         │   │                   │       └─ Table\n" +
 17311  			"         │   │                   │           ├─ name: keyword\n" +
 17312  			"         │   │                   │           └─ columns: [id keyword]\n" +
 17313  			"         │   │                   └─ HashLookup\n" +
 17314  			"         │   │                       ├─ left-key: (k.id)\n" +
 17315  			"         │   │                       ├─ right-key: (mk.keyword_id)\n" +
 17316  			"         │   │                       └─ HashJoin\n" +
 17317  			"         │   │                           ├─ (it1.id = mi.info_type_id)\n" +
 17318  			"         │   │                           ├─ Filter\n" +
 17319  			"         │   │                           │   ├─ (it1.info = 'genres')\n" +
 17320  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17321  			"         │   │                           │       └─ Table\n" +
 17322  			"         │   │                           │           ├─ name: info_type\n" +
 17323  			"         │   │                           │           └─ columns: [id info]\n" +
 17324  			"         │   │                           └─ HashLookup\n" +
 17325  			"         │   │                               ├─ left-key: (it1.id)\n" +
 17326  			"         │   │                               ├─ right-key: (mi.info_type_id)\n" +
 17327  			"         │   │                               └─ LookupJoin\n" +
 17328  			"         │   │                                   ├─ InnerJoin\n" +
 17329  			"         │   │                                   │   ├─ (mi.movie_id = mk.movie_id)\n" +
 17330  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17331  			"         │   │                                   │   │   └─ Table\n" +
 17332  			"         │   │                                   │   │       ├─ name: movie_keyword\n" +
 17333  			"         │   │                                   │   │       └─ columns: [movie_id keyword_id]\n" +
 17334  			"         │   │                                   │   └─ Filter\n" +
 17335  			"         │   │                                   │       ├─ (mi.info = 'Horror')\n" +
 17336  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 17337  			"         │   │                                   │           └─ Table\n" +
 17338  			"         │   │                                   │               ├─ name: movie_info\n" +
 17339  			"         │   │                                   │               └─ columns: [movie_id info_type_id info]\n" +
 17340  			"         │   │                                   └─ Filter\n" +
 17341  			"         │   │                                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 17342  			"         │   │                                       └─ TableAlias(ci)\n" +
 17343  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 17344  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 17345  			"         │   │                                               ├─ columns: [person_id movie_id note]\n" +
 17346  			"         │   │                                               └─ keys: mi.movie_id\n" +
 17347  			"         │   └─ HashLookup\n" +
 17348  			"         │       ├─ left-key: (ci.person_id)\n" +
 17349  			"         │       ├─ right-key: (n.id)\n" +
 17350  			"         │       └─ Filter\n" +
 17351  			"         │           ├─ (n.gender = 'm')\n" +
 17352  			"         │           └─ TableAlias(n)\n" +
 17353  			"         │               └─ Table\n" +
 17354  			"         │                   ├─ name: name\n" +
 17355  			"         │                   └─ columns: [id name gender]\n" +
 17356  			"         └─ HashLookup\n" +
 17357  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id)\n" +
 17358  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
 17359  			"             └─ TableAlias(t)\n" +
 17360  			"                 └─ Table\n" +
 17361  			"                     ├─ name: title\n" +
 17362  			"                     └─ columns: [id title]\n" +
 17363  			"",
 17364  	},
 17365  	{
 17366  		Query: `
 17367  SELECT MIN(mi.info) AS movie_budget,
 17368         MIN(mi_idx.info) AS movie_votes,
 17369         MIN(n.name) AS male_writer,
 17370         MIN(t.title) AS violent_movie_title
 17371  FROM cast_info AS ci,
 17372       info_type AS it1,
 17373       info_type AS it2,
 17374       keyword AS k,
 17375       movie_info AS mi,
 17376       movie_info_idx AS mi_idx,
 17377       movie_keyword AS mk,
 17378       name AS n,
 17379       title AS t
 17380  WHERE ci.note IN ('(writer)',
 17381                    '(head writer)',
 17382                    '(written by)',
 17383                    '(story)',
 17384                    '(story editor)')
 17385    AND it1.info = 'genres'
 17386    AND it2.info = 'votes'
 17387    AND k.keyword IN ('murder',
 17388                      'blood',
 17389                      'gore',
 17390                      'death',
 17391                      'female-nudity')
 17392    AND mi.info = 'Horror'
 17393    AND n.gender = 'm'
 17394    AND t.production_year > 2010
 17395    AND t.title LIKE 'Vampire%'
 17396    AND t.id = mi.movie_id
 17397    AND t.id = mi_idx.movie_id
 17398    AND t.id = ci.movie_id
 17399    AND t.id = mk.movie_id
 17400    AND ci.movie_id = mi.movie_id
 17401    AND ci.movie_id = mi_idx.movie_id
 17402    AND ci.movie_id = mk.movie_id
 17403    AND mi.movie_id = mi_idx.movie_id
 17404    AND mi.movie_id = mk.movie_id
 17405    AND mi_idx.movie_id = mk.movie_id
 17406    AND n.id = ci.person_id
 17407    AND it1.id = mi.info_type_id
 17408    AND it2.id = mi_idx.info_type_id
 17409    AND k.id = mk.keyword_id;
 17410  
 17411  `,
 17412  		ExpectedPlan: "Project\n" +
 17413  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as male_writer, min(t.title):3!null as violent_movie_title]\n" +
 17414  			" └─ GroupBy\n" +
 17415  			"     ├─ select: MIN(mi.info:13!null), MIN(mi_idx.info:4!null), MIN(n.name:18!null), MIN(t.title:21!null)\n" +
 17416  			"     ├─ group: \n" +
 17417  			"     └─ HashJoin\n" +
 17418  			"         ├─ AND\n" +
 17419  			"         │   ├─ AND\n" +
 17420  			"         │   │   ├─ AND\n" +
 17421  			"         │   │   │   ├─ Eq\n" +
 17422  			"         │   │   │   │   ├─ t.id:20!null\n" +
 17423  			"         │   │   │   │   └─ mi.movie_id:11!null\n" +
 17424  			"         │   │   │   └─ Eq\n" +
 17425  			"         │   │   │       ├─ t.id:20!null\n" +
 17426  			"         │   │   │       └─ mi_idx.movie_id:2!null\n" +
 17427  			"         │   │   └─ Eq\n" +
 17428  			"         │   │       ├─ t.id:20!null\n" +
 17429  			"         │   │       └─ ci.movie_id:15!null\n" +
 17430  			"         │   └─ Eq\n" +
 17431  			"         │       ├─ t.id:20!null\n" +
 17432  			"         │       └─ mk.movie_id:9!null\n" +
 17433  			"         ├─ HashJoin\n" +
 17434  			"         │   ├─ Eq\n" +
 17435  			"         │   │   ├─ n.id:17!null\n" +
 17436  			"         │   │   └─ ci.person_id:14!null\n" +
 17437  			"         │   ├─ HashJoin\n" +
 17438  			"         │   │   ├─ Eq\n" +
 17439  			"         │   │   │   ├─ it2.id:0!null\n" +
 17440  			"         │   │   │   └─ mi_idx.info_type_id:3!null\n" +
 17441  			"         │   │   ├─ Filter\n" +
 17442  			"         │   │   │   ├─ Eq\n" +
 17443  			"         │   │   │   │   ├─ it2.info:1!null\n" +
 17444  			"         │   │   │   │   └─ votes (longtext)\n" +
 17445  			"         │   │   │   └─ TableAlias(it2)\n" +
 17446  			"         │   │   │       └─ ProcessTable\n" +
 17447  			"         │   │   │           └─ Table\n" +
 17448  			"         │   │   │               ├─ name: info_type\n" +
 17449  			"         │   │   │               └─ columns: [id info]\n" +
 17450  			"         │   │   └─ HashLookup\n" +
 17451  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
 17452  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:1!null)\n" +
 17453  			"         │   │       └─ HashJoin\n" +
 17454  			"         │   │           ├─ AND\n" +
 17455  			"         │   │           │   ├─ Eq\n" +
 17456  			"         │   │           │   │   ├─ mi.movie_id:11!null\n" +
 17457  			"         │   │           │   │   └─ mi_idx.movie_id:2!null\n" +
 17458  			"         │   │           │   └─ Eq\n" +
 17459  			"         │   │           │       ├─ mi_idx.movie_id:2!null\n" +
 17460  			"         │   │           │       └─ mk.movie_id:9!null\n" +
 17461  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17462  			"         │   │           │   └─ ProcessTable\n" +
 17463  			"         │   │           │       └─ Table\n" +
 17464  			"         │   │           │           ├─ name: movie_info_idx\n" +
 17465  			"         │   │           │           └─ columns: [movie_id info_type_id info]\n" +
 17466  			"         │   │           └─ HashLookup\n" +
 17467  			"         │   │               ├─ left-key: TUPLE(mi_idx.movie_id:2!null, mi_idx.movie_id:2!null)\n" +
 17468  			"         │   │               ├─ right-key: TUPLE(mi.movie_id:6!null, mk.movie_id:4!null)\n" +
 17469  			"         │   │               └─ HashJoin\n" +
 17470  			"         │   │                   ├─ Eq\n" +
 17471  			"         │   │                   │   ├─ k.id:5!null\n" +
 17472  			"         │   │                   │   └─ mk.keyword_id:10!null\n" +
 17473  			"         │   │                   ├─ Filter\n" +
 17474  			"         │   │                   │   ├─ HashIn\n" +
 17475  			"         │   │                   │   │   ├─ k.keyword:1!null\n" +
 17476  			"         │   │                   │   │   └─ TUPLE(murder (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext))\n" +
 17477  			"         │   │                   │   └─ TableAlias(k)\n" +
 17478  			"         │   │                   │       └─ ProcessTable\n" +
 17479  			"         │   │                   │           └─ Table\n" +
 17480  			"         │   │                   │               ├─ name: keyword\n" +
 17481  			"         │   │                   │               └─ columns: [id keyword]\n" +
 17482  			"         │   │                   └─ HashLookup\n" +
 17483  			"         │   │                       ├─ left-key: TUPLE(k.id:5!null)\n" +
 17484  			"         │   │                       ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
 17485  			"         │   │                       └─ HashJoin\n" +
 17486  			"         │   │                           ├─ Eq\n" +
 17487  			"         │   │                           │   ├─ it1.id:7!null\n" +
 17488  			"         │   │                           │   └─ mi.info_type_id:12!null\n" +
 17489  			"         │   │                           ├─ Filter\n" +
 17490  			"         │   │                           │   ├─ Eq\n" +
 17491  			"         │   │                           │   │   ├─ it1.info:1!null\n" +
 17492  			"         │   │                           │   │   └─ genres (longtext)\n" +
 17493  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17494  			"         │   │                           │       └─ Table\n" +
 17495  			"         │   │                           │           ├─ name: info_type\n" +
 17496  			"         │   │                           │           ├─ columns: [id info]\n" +
 17497  			"         │   │                           │           ├─ colSet: (8,9)\n" +
 17498  			"         │   │                           │           └─ tableId: 2\n" +
 17499  			"         │   │                           └─ HashLookup\n" +
 17500  			"         │   │                               ├─ left-key: TUPLE(it1.id:7!null)\n" +
 17501  			"         │   │                               ├─ right-key: TUPLE(mi.info_type_id:3!null)\n" +
 17502  			"         │   │                               └─ LookupJoin\n" +
 17503  			"         │   │                                   ├─ InnerJoin\n" +
 17504  			"         │   │                                   │   ├─ Eq\n" +
 17505  			"         │   │                                   │   │   ├─ mi.movie_id:11!null\n" +
 17506  			"         │   │                                   │   │   └─ mk.movie_id:9!null\n" +
 17507  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17508  			"         │   │                                   │   │   └─ ProcessTable\n" +
 17509  			"         │   │                                   │   │       └─ Table\n" +
 17510  			"         │   │                                   │   │           ├─ name: movie_keyword\n" +
 17511  			"         │   │                                   │   │           └─ columns: [movie_id keyword_id]\n" +
 17512  			"         │   │                                   │   └─ Filter\n" +
 17513  			"         │   │                                   │       ├─ Eq\n" +
 17514  			"         │   │                                   │       │   ├─ mi.info:2!null\n" +
 17515  			"         │   │                                   │       │   └─ Horror (longtext)\n" +
 17516  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 17517  			"         │   │                                   │           └─ ProcessTable\n" +
 17518  			"         │   │                                   │               └─ Table\n" +
 17519  			"         │   │                                   │                   ├─ name: movie_info\n" +
 17520  			"         │   │                                   │                   └─ columns: [movie_id info_type_id info]\n" +
 17521  			"         │   │                                   └─ Filter\n" +
 17522  			"         │   │                                       ├─ HashIn\n" +
 17523  			"         │   │                                       │   ├─ ci.note:2\n" +
 17524  			"         │   │                                       │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 17525  			"         │   │                                       └─ TableAlias(ci)\n" +
 17526  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 17527  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 17528  			"         │   │                                               ├─ keys: [mi.movie_id:11!null]\n" +
 17529  			"         │   │                                               ├─ colSet: (1-7)\n" +
 17530  			"         │   │                                               ├─ tableId: 1\n" +
 17531  			"         │   │                                               └─ Table\n" +
 17532  			"         │   │                                                   ├─ name: cast_info\n" +
 17533  			"         │   │                                                   └─ columns: [person_id movie_id note]\n" +
 17534  			"         │   └─ HashLookup\n" +
 17535  			"         │       ├─ left-key: TUPLE(ci.person_id:14!null)\n" +
 17536  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
 17537  			"         │       └─ Filter\n" +
 17538  			"         │           ├─ Eq\n" +
 17539  			"         │           │   ├─ n.gender:2\n" +
 17540  			"         │           │   └─ m (longtext)\n" +
 17541  			"         │           └─ TableAlias(n)\n" +
 17542  			"         │               └─ ProcessTable\n" +
 17543  			"         │                   └─ Table\n" +
 17544  			"         │                       ├─ name: name\n" +
 17545  			"         │                       └─ columns: [id name gender]\n" +
 17546  			"         └─ HashLookup\n" +
 17547  			"             ├─ left-key: TUPLE(mi.movie_id:11!null, mi_idx.movie_id:2!null, ci.movie_id:15!null, mk.movie_id:9!null)\n" +
 17548  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 17549  			"             └─ Filter\n" +
 17550  			"                 ├─ AND\n" +
 17551  			"                 │   ├─ AND\n" +
 17552  			"                 │   │   ├─ GreaterThan\n" +
 17553  			"                 │   │   │   ├─ t.production_year:2\n" +
 17554  			"                 │   │   │   └─ 2010 (smallint)\n" +
 17555  			"                 │   │   └─ GreaterThanOrEqual\n" +
 17556  			"                 │   │       ├─ t.title:1!null\n" +
 17557  			"                 │   │       └─ Vampire (longtext)\n" +
 17558  			"                 │   └─ LessThanOrEqual\n" +
 17559  			"                 │       ├─ t.title:1!null\n" +
 17560  			"                 │       └─ Vampireÿ (longtext)\n" +
 17561  			"                 └─ TableAlias(t)\n" +
 17562  			"                     └─ ProcessTable\n" +
 17563  			"                         └─ Table\n" +
 17564  			"                             ├─ name: title\n" +
 17565  			"                             └─ columns: [id title production_year]\n" +
 17566  			"",
 17567  		ExpectedEstimates: "Project\n" +
 17568  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as male_writer, min(t.title) as violent_movie_title]\n" +
 17569  			" └─ GroupBy\n" +
 17570  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 17571  			"     ├─ Grouping()\n" +
 17572  			"     └─ HashJoin\n" +
 17573  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 17574  			"         ├─ HashJoin\n" +
 17575  			"         │   ├─ (n.id = ci.person_id)\n" +
 17576  			"         │   ├─ HashJoin\n" +
 17577  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 17578  			"         │   │   ├─ Filter\n" +
 17579  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 17580  			"         │   │   │   └─ TableAlias(it2)\n" +
 17581  			"         │   │   │       └─ Table\n" +
 17582  			"         │   │   │           ├─ name: info_type\n" +
 17583  			"         │   │   │           └─ columns: [id info]\n" +
 17584  			"         │   │   └─ HashLookup\n" +
 17585  			"         │   │       ├─ left-key: (it2.id)\n" +
 17586  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 17587  			"         │   │       └─ HashJoin\n" +
 17588  			"         │   │           ├─ ((mi.movie_id = mi_idx.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 17589  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17590  			"         │   │           │   └─ Table\n" +
 17591  			"         │   │           │       ├─ name: movie_info_idx\n" +
 17592  			"         │   │           │       └─ columns: [movie_id info_type_id info]\n" +
 17593  			"         │   │           └─ HashLookup\n" +
 17594  			"         │   │               ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 17595  			"         │   │               ├─ right-key: (mi.movie_id, mk.movie_id)\n" +
 17596  			"         │   │               └─ HashJoin\n" +
 17597  			"         │   │                   ├─ (k.id = mk.keyword_id)\n" +
 17598  			"         │   │                   ├─ Filter\n" +
 17599  			"         │   │                   │   ├─ (k.keyword HASH IN ('murder', 'blood', 'gore', 'death', 'female-nudity'))\n" +
 17600  			"         │   │                   │   └─ TableAlias(k)\n" +
 17601  			"         │   │                   │       └─ Table\n" +
 17602  			"         │   │                   │           ├─ name: keyword\n" +
 17603  			"         │   │                   │           └─ columns: [id keyword]\n" +
 17604  			"         │   │                   └─ HashLookup\n" +
 17605  			"         │   │                       ├─ left-key: (k.id)\n" +
 17606  			"         │   │                       ├─ right-key: (mk.keyword_id)\n" +
 17607  			"         │   │                       └─ HashJoin\n" +
 17608  			"         │   │                           ├─ (it1.id = mi.info_type_id)\n" +
 17609  			"         │   │                           ├─ Filter\n" +
 17610  			"         │   │                           │   ├─ (it1.info = 'genres')\n" +
 17611  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17612  			"         │   │                           │       └─ Table\n" +
 17613  			"         │   │                           │           ├─ name: info_type\n" +
 17614  			"         │   │                           │           └─ columns: [id info]\n" +
 17615  			"         │   │                           └─ HashLookup\n" +
 17616  			"         │   │                               ├─ left-key: (it1.id)\n" +
 17617  			"         │   │                               ├─ right-key: (mi.info_type_id)\n" +
 17618  			"         │   │                               └─ LookupJoin\n" +
 17619  			"         │   │                                   ├─ InnerJoin\n" +
 17620  			"         │   │                                   │   ├─ (mi.movie_id = mk.movie_id)\n" +
 17621  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17622  			"         │   │                                   │   │   └─ Table\n" +
 17623  			"         │   │                                   │   │       ├─ name: movie_keyword\n" +
 17624  			"         │   │                                   │   │       └─ columns: [movie_id keyword_id]\n" +
 17625  			"         │   │                                   │   └─ Filter\n" +
 17626  			"         │   │                                   │       ├─ (mi.info = 'Horror')\n" +
 17627  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 17628  			"         │   │                                   │           └─ Table\n" +
 17629  			"         │   │                                   │               ├─ name: movie_info\n" +
 17630  			"         │   │                                   │               └─ columns: [movie_id info_type_id info]\n" +
 17631  			"         │   │                                   └─ Filter\n" +
 17632  			"         │   │                                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 17633  			"         │   │                                       └─ TableAlias(ci)\n" +
 17634  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 17635  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 17636  			"         │   │                                               ├─ columns: [person_id movie_id note]\n" +
 17637  			"         │   │                                               └─ keys: mi.movie_id\n" +
 17638  			"         │   └─ HashLookup\n" +
 17639  			"         │       ├─ left-key: (ci.person_id)\n" +
 17640  			"         │       ├─ right-key: (n.id)\n" +
 17641  			"         │       └─ Filter\n" +
 17642  			"         │           ├─ (n.gender = 'm')\n" +
 17643  			"         │           └─ TableAlias(n)\n" +
 17644  			"         │               └─ Table\n" +
 17645  			"         │                   ├─ name: name\n" +
 17646  			"         │                   └─ columns: [id name gender]\n" +
 17647  			"         └─ HashLookup\n" +
 17648  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id)\n" +
 17649  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
 17650  			"             └─ Filter\n" +
 17651  			"                 ├─ (((t.production_year > 2010) AND (t.title >= 'Vampire')) AND (t.title <= 'Vampireÿ'))\n" +
 17652  			"                 └─ TableAlias(t)\n" +
 17653  			"                     └─ Table\n" +
 17654  			"                         ├─ name: title\n" +
 17655  			"                         └─ columns: [id title production_year]\n" +
 17656  			"",
 17657  		ExpectedAnalysis: "Project\n" +
 17658  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as male_writer, min(t.title) as violent_movie_title]\n" +
 17659  			" └─ GroupBy\n" +
 17660  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 17661  			"     ├─ Grouping()\n" +
 17662  			"     └─ HashJoin\n" +
 17663  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 17664  			"         ├─ HashJoin\n" +
 17665  			"         │   ├─ (n.id = ci.person_id)\n" +
 17666  			"         │   ├─ HashJoin\n" +
 17667  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 17668  			"         │   │   ├─ Filter\n" +
 17669  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 17670  			"         │   │   │   └─ TableAlias(it2)\n" +
 17671  			"         │   │   │       └─ Table\n" +
 17672  			"         │   │   │           ├─ name: info_type\n" +
 17673  			"         │   │   │           └─ columns: [id info]\n" +
 17674  			"         │   │   └─ HashLookup\n" +
 17675  			"         │   │       ├─ left-key: (it2.id)\n" +
 17676  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 17677  			"         │   │       └─ HashJoin\n" +
 17678  			"         │   │           ├─ ((mi.movie_id = mi_idx.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 17679  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17680  			"         │   │           │   └─ Table\n" +
 17681  			"         │   │           │       ├─ name: movie_info_idx\n" +
 17682  			"         │   │           │       └─ columns: [movie_id info_type_id info]\n" +
 17683  			"         │   │           └─ HashLookup\n" +
 17684  			"         │   │               ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 17685  			"         │   │               ├─ right-key: (mi.movie_id, mk.movie_id)\n" +
 17686  			"         │   │               └─ HashJoin\n" +
 17687  			"         │   │                   ├─ (k.id = mk.keyword_id)\n" +
 17688  			"         │   │                   ├─ Filter\n" +
 17689  			"         │   │                   │   ├─ (k.keyword HASH IN ('murder', 'blood', 'gore', 'death', 'female-nudity'))\n" +
 17690  			"         │   │                   │   └─ TableAlias(k)\n" +
 17691  			"         │   │                   │       └─ Table\n" +
 17692  			"         │   │                   │           ├─ name: keyword\n" +
 17693  			"         │   │                   │           └─ columns: [id keyword]\n" +
 17694  			"         │   │                   └─ HashLookup\n" +
 17695  			"         │   │                       ├─ left-key: (k.id)\n" +
 17696  			"         │   │                       ├─ right-key: (mk.keyword_id)\n" +
 17697  			"         │   │                       └─ HashJoin\n" +
 17698  			"         │   │                           ├─ (it1.id = mi.info_type_id)\n" +
 17699  			"         │   │                           ├─ Filter\n" +
 17700  			"         │   │                           │   ├─ (it1.info = 'genres')\n" +
 17701  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17702  			"         │   │                           │       └─ Table\n" +
 17703  			"         │   │                           │           ├─ name: info_type\n" +
 17704  			"         │   │                           │           └─ columns: [id info]\n" +
 17705  			"         │   │                           └─ HashLookup\n" +
 17706  			"         │   │                               ├─ left-key: (it1.id)\n" +
 17707  			"         │   │                               ├─ right-key: (mi.info_type_id)\n" +
 17708  			"         │   │                               └─ LookupJoin\n" +
 17709  			"         │   │                                   ├─ InnerJoin\n" +
 17710  			"         │   │                                   │   ├─ (mi.movie_id = mk.movie_id)\n" +
 17711  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17712  			"         │   │                                   │   │   └─ Table\n" +
 17713  			"         │   │                                   │   │       ├─ name: movie_keyword\n" +
 17714  			"         │   │                                   │   │       └─ columns: [movie_id keyword_id]\n" +
 17715  			"         │   │                                   │   └─ Filter\n" +
 17716  			"         │   │                                   │       ├─ (mi.info = 'Horror')\n" +
 17717  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 17718  			"         │   │                                   │           └─ Table\n" +
 17719  			"         │   │                                   │               ├─ name: movie_info\n" +
 17720  			"         │   │                                   │               └─ columns: [movie_id info_type_id info]\n" +
 17721  			"         │   │                                   └─ Filter\n" +
 17722  			"         │   │                                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 17723  			"         │   │                                       └─ TableAlias(ci)\n" +
 17724  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 17725  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 17726  			"         │   │                                               ├─ columns: [person_id movie_id note]\n" +
 17727  			"         │   │                                               └─ keys: mi.movie_id\n" +
 17728  			"         │   └─ HashLookup\n" +
 17729  			"         │       ├─ left-key: (ci.person_id)\n" +
 17730  			"         │       ├─ right-key: (n.id)\n" +
 17731  			"         │       └─ Filter\n" +
 17732  			"         │           ├─ (n.gender = 'm')\n" +
 17733  			"         │           └─ TableAlias(n)\n" +
 17734  			"         │               └─ Table\n" +
 17735  			"         │                   ├─ name: name\n" +
 17736  			"         │                   └─ columns: [id name gender]\n" +
 17737  			"         └─ HashLookup\n" +
 17738  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id)\n" +
 17739  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
 17740  			"             └─ Filter\n" +
 17741  			"                 ├─ (((t.production_year > 2010) AND (t.title >= 'Vampire')) AND (t.title <= 'Vampireÿ'))\n" +
 17742  			"                 └─ TableAlias(t)\n" +
 17743  			"                     └─ Table\n" +
 17744  			"                         ├─ name: title\n" +
 17745  			"                         └─ columns: [id title production_year]\n" +
 17746  			"",
 17747  	},
 17748  	{
 17749  		Query: `
 17750  SELECT MIN(mi.info) AS movie_budget,
 17751         MIN(mi_idx.info) AS movie_votes,
 17752         MIN(n.name) AS male_writer,
 17753         MIN(t.title) AS violent_movie_title
 17754  FROM cast_info AS ci,
 17755       info_type AS it1,
 17756       info_type AS it2,
 17757       keyword AS k,
 17758       movie_info AS mi,
 17759       movie_info_idx AS mi_idx,
 17760       movie_keyword AS mk,
 17761       name AS n,
 17762       title AS t
 17763  WHERE ci.note IN ('(writer)',
 17764                    '(head writer)',
 17765                    '(written by)',
 17766                    '(story)',
 17767                    '(story editor)')
 17768    AND it1.info = 'genres'
 17769    AND it2.info = 'votes'
 17770    AND k.keyword IN ('murder',
 17771                      'violence',
 17772                      'blood',
 17773                      'gore',
 17774                      'death',
 17775                      'female-nudity',
 17776                      'hospital')
 17777    AND mi.info IN ('Horror',
 17778                    'Action',
 17779                    'Sci-Fi',
 17780                    'Thriller',
 17781                    'Crime',
 17782                    'War')
 17783    AND n.gender = 'm'
 17784    AND t.id = mi.movie_id
 17785    AND t.id = mi_idx.movie_id
 17786    AND t.id = ci.movie_id
 17787    AND t.id = mk.movie_id
 17788    AND ci.movie_id = mi.movie_id
 17789    AND ci.movie_id = mi_idx.movie_id
 17790    AND ci.movie_id = mk.movie_id
 17791    AND mi.movie_id = mi_idx.movie_id
 17792    AND mi.movie_id = mk.movie_id
 17793    AND mi_idx.movie_id = mk.movie_id
 17794    AND n.id = ci.person_id
 17795    AND it1.id = mi.info_type_id
 17796    AND it2.id = mi_idx.info_type_id
 17797    AND k.id = mk.keyword_id;
 17798  
 17799  `,
 17800  		ExpectedPlan: "Project\n" +
 17801  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as male_writer, min(t.title):3!null as violent_movie_title]\n" +
 17802  			" └─ GroupBy\n" +
 17803  			"     ├─ select: MIN(mi.info:13!null), MIN(mi_idx.info:4!null), MIN(n.name:18!null), MIN(t.title:21!null)\n" +
 17804  			"     ├─ group: \n" +
 17805  			"     └─ HashJoin\n" +
 17806  			"         ├─ AND\n" +
 17807  			"         │   ├─ AND\n" +
 17808  			"         │   │   ├─ AND\n" +
 17809  			"         │   │   │   ├─ Eq\n" +
 17810  			"         │   │   │   │   ├─ t.id:20!null\n" +
 17811  			"         │   │   │   │   └─ mi.movie_id:11!null\n" +
 17812  			"         │   │   │   └─ Eq\n" +
 17813  			"         │   │   │       ├─ t.id:20!null\n" +
 17814  			"         │   │   │       └─ mi_idx.movie_id:2!null\n" +
 17815  			"         │   │   └─ Eq\n" +
 17816  			"         │   │       ├─ t.id:20!null\n" +
 17817  			"         │   │       └─ ci.movie_id:15!null\n" +
 17818  			"         │   └─ Eq\n" +
 17819  			"         │       ├─ t.id:20!null\n" +
 17820  			"         │       └─ mk.movie_id:9!null\n" +
 17821  			"         ├─ HashJoin\n" +
 17822  			"         │   ├─ Eq\n" +
 17823  			"         │   │   ├─ n.id:17!null\n" +
 17824  			"         │   │   └─ ci.person_id:14!null\n" +
 17825  			"         │   ├─ HashJoin\n" +
 17826  			"         │   │   ├─ Eq\n" +
 17827  			"         │   │   │   ├─ it2.id:0!null\n" +
 17828  			"         │   │   │   └─ mi_idx.info_type_id:3!null\n" +
 17829  			"         │   │   ├─ Filter\n" +
 17830  			"         │   │   │   ├─ Eq\n" +
 17831  			"         │   │   │   │   ├─ it2.info:1!null\n" +
 17832  			"         │   │   │   │   └─ votes (longtext)\n" +
 17833  			"         │   │   │   └─ TableAlias(it2)\n" +
 17834  			"         │   │   │       └─ ProcessTable\n" +
 17835  			"         │   │   │           └─ Table\n" +
 17836  			"         │   │   │               ├─ name: info_type\n" +
 17837  			"         │   │   │               └─ columns: [id info]\n" +
 17838  			"         │   │   └─ HashLookup\n" +
 17839  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
 17840  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:1!null)\n" +
 17841  			"         │   │       └─ HashJoin\n" +
 17842  			"         │   │           ├─ AND\n" +
 17843  			"         │   │           │   ├─ Eq\n" +
 17844  			"         │   │           │   │   ├─ mi.movie_id:11!null\n" +
 17845  			"         │   │           │   │   └─ mi_idx.movie_id:2!null\n" +
 17846  			"         │   │           │   └─ Eq\n" +
 17847  			"         │   │           │       ├─ mi_idx.movie_id:2!null\n" +
 17848  			"         │   │           │       └─ mk.movie_id:9!null\n" +
 17849  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17850  			"         │   │           │   └─ ProcessTable\n" +
 17851  			"         │   │           │       └─ Table\n" +
 17852  			"         │   │           │           ├─ name: movie_info_idx\n" +
 17853  			"         │   │           │           └─ columns: [movie_id info_type_id info]\n" +
 17854  			"         │   │           └─ HashLookup\n" +
 17855  			"         │   │               ├─ left-key: TUPLE(mi_idx.movie_id:2!null, mi_idx.movie_id:2!null)\n" +
 17856  			"         │   │               ├─ right-key: TUPLE(mi.movie_id:6!null, mk.movie_id:4!null)\n" +
 17857  			"         │   │               └─ HashJoin\n" +
 17858  			"         │   │                   ├─ Eq\n" +
 17859  			"         │   │                   │   ├─ k.id:5!null\n" +
 17860  			"         │   │                   │   └─ mk.keyword_id:10!null\n" +
 17861  			"         │   │                   ├─ Filter\n" +
 17862  			"         │   │                   │   ├─ HashIn\n" +
 17863  			"         │   │                   │   │   ├─ k.keyword:1!null\n" +
 17864  			"         │   │                   │   │   └─ TUPLE(murder (longtext), violence (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext), hospital (longtext))\n" +
 17865  			"         │   │                   │   └─ TableAlias(k)\n" +
 17866  			"         │   │                   │       └─ ProcessTable\n" +
 17867  			"         │   │                   │           └─ Table\n" +
 17868  			"         │   │                   │               ├─ name: keyword\n" +
 17869  			"         │   │                   │               └─ columns: [id keyword]\n" +
 17870  			"         │   │                   └─ HashLookup\n" +
 17871  			"         │   │                       ├─ left-key: TUPLE(k.id:5!null)\n" +
 17872  			"         │   │                       ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
 17873  			"         │   │                       └─ HashJoin\n" +
 17874  			"         │   │                           ├─ Eq\n" +
 17875  			"         │   │                           │   ├─ it1.id:7!null\n" +
 17876  			"         │   │                           │   └─ mi.info_type_id:12!null\n" +
 17877  			"         │   │                           ├─ Filter\n" +
 17878  			"         │   │                           │   ├─ Eq\n" +
 17879  			"         │   │                           │   │   ├─ it1.info:1!null\n" +
 17880  			"         │   │                           │   │   └─ genres (longtext)\n" +
 17881  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17882  			"         │   │                           │       └─ Table\n" +
 17883  			"         │   │                           │           ├─ name: info_type\n" +
 17884  			"         │   │                           │           ├─ columns: [id info]\n" +
 17885  			"         │   │                           │           ├─ colSet: (8,9)\n" +
 17886  			"         │   │                           │           └─ tableId: 2\n" +
 17887  			"         │   │                           └─ HashLookup\n" +
 17888  			"         │   │                               ├─ left-key: TUPLE(it1.id:7!null)\n" +
 17889  			"         │   │                               ├─ right-key: TUPLE(mi.info_type_id:3!null)\n" +
 17890  			"         │   │                               └─ LookupJoin\n" +
 17891  			"         │   │                                   ├─ InnerJoin\n" +
 17892  			"         │   │                                   │   ├─ Eq\n" +
 17893  			"         │   │                                   │   │   ├─ mi.movie_id:11!null\n" +
 17894  			"         │   │                                   │   │   └─ mk.movie_id:9!null\n" +
 17895  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17896  			"         │   │                                   │   │   └─ ProcessTable\n" +
 17897  			"         │   │                                   │   │       └─ Table\n" +
 17898  			"         │   │                                   │   │           ├─ name: movie_keyword\n" +
 17899  			"         │   │                                   │   │           └─ columns: [movie_id keyword_id]\n" +
 17900  			"         │   │                                   │   └─ Filter\n" +
 17901  			"         │   │                                   │       ├─ HashIn\n" +
 17902  			"         │   │                                   │       │   ├─ mi.info:2!null\n" +
 17903  			"         │   │                                   │       │   └─ TUPLE(Horror (longtext), Action (longtext), Sci-Fi (longtext), Thriller (longtext), Crime (longtext), War (longtext))\n" +
 17904  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 17905  			"         │   │                                   │           └─ ProcessTable\n" +
 17906  			"         │   │                                   │               └─ Table\n" +
 17907  			"         │   │                                   │                   ├─ name: movie_info\n" +
 17908  			"         │   │                                   │                   └─ columns: [movie_id info_type_id info]\n" +
 17909  			"         │   │                                   └─ Filter\n" +
 17910  			"         │   │                                       ├─ HashIn\n" +
 17911  			"         │   │                                       │   ├─ ci.note:2\n" +
 17912  			"         │   │                                       │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 17913  			"         │   │                                       └─ TableAlias(ci)\n" +
 17914  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 17915  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 17916  			"         │   │                                               ├─ keys: [mi.movie_id:11!null]\n" +
 17917  			"         │   │                                               ├─ colSet: (1-7)\n" +
 17918  			"         │   │                                               ├─ tableId: 1\n" +
 17919  			"         │   │                                               └─ Table\n" +
 17920  			"         │   │                                                   ├─ name: cast_info\n" +
 17921  			"         │   │                                                   └─ columns: [person_id movie_id note]\n" +
 17922  			"         │   └─ HashLookup\n" +
 17923  			"         │       ├─ left-key: TUPLE(ci.person_id:14!null)\n" +
 17924  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
 17925  			"         │       └─ Filter\n" +
 17926  			"         │           ├─ Eq\n" +
 17927  			"         │           │   ├─ n.gender:2\n" +
 17928  			"         │           │   └─ m (longtext)\n" +
 17929  			"         │           └─ TableAlias(n)\n" +
 17930  			"         │               └─ ProcessTable\n" +
 17931  			"         │                   └─ Table\n" +
 17932  			"         │                       ├─ name: name\n" +
 17933  			"         │                       └─ columns: [id name gender]\n" +
 17934  			"         └─ HashLookup\n" +
 17935  			"             ├─ left-key: TUPLE(mi.movie_id:11!null, mi_idx.movie_id:2!null, ci.movie_id:15!null, mk.movie_id:9!null)\n" +
 17936  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 17937  			"             └─ TableAlias(t)\n" +
 17938  			"                 └─ ProcessTable\n" +
 17939  			"                     └─ Table\n" +
 17940  			"                         ├─ name: title\n" +
 17941  			"                         └─ columns: [id title]\n" +
 17942  			"",
 17943  		ExpectedEstimates: "Project\n" +
 17944  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as male_writer, min(t.title) as violent_movie_title]\n" +
 17945  			" └─ GroupBy\n" +
 17946  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 17947  			"     ├─ Grouping()\n" +
 17948  			"     └─ HashJoin\n" +
 17949  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 17950  			"         ├─ HashJoin\n" +
 17951  			"         │   ├─ (n.id = ci.person_id)\n" +
 17952  			"         │   ├─ HashJoin\n" +
 17953  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 17954  			"         │   │   ├─ Filter\n" +
 17955  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 17956  			"         │   │   │   └─ TableAlias(it2)\n" +
 17957  			"         │   │   │       └─ Table\n" +
 17958  			"         │   │   │           ├─ name: info_type\n" +
 17959  			"         │   │   │           └─ columns: [id info]\n" +
 17960  			"         │   │   └─ HashLookup\n" +
 17961  			"         │   │       ├─ left-key: (it2.id)\n" +
 17962  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 17963  			"         │   │       └─ HashJoin\n" +
 17964  			"         │   │           ├─ ((mi.movie_id = mi_idx.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 17965  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 17966  			"         │   │           │   └─ Table\n" +
 17967  			"         │   │           │       ├─ name: movie_info_idx\n" +
 17968  			"         │   │           │       └─ columns: [movie_id info_type_id info]\n" +
 17969  			"         │   │           └─ HashLookup\n" +
 17970  			"         │   │               ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 17971  			"         │   │               ├─ right-key: (mi.movie_id, mk.movie_id)\n" +
 17972  			"         │   │               └─ HashJoin\n" +
 17973  			"         │   │                   ├─ (k.id = mk.keyword_id)\n" +
 17974  			"         │   │                   ├─ Filter\n" +
 17975  			"         │   │                   │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 17976  			"         │   │                   │   └─ TableAlias(k)\n" +
 17977  			"         │   │                   │       └─ Table\n" +
 17978  			"         │   │                   │           ├─ name: keyword\n" +
 17979  			"         │   │                   │           └─ columns: [id keyword]\n" +
 17980  			"         │   │                   └─ HashLookup\n" +
 17981  			"         │   │                       ├─ left-key: (k.id)\n" +
 17982  			"         │   │                       ├─ right-key: (mk.keyword_id)\n" +
 17983  			"         │   │                       └─ HashJoin\n" +
 17984  			"         │   │                           ├─ (it1.id = mi.info_type_id)\n" +
 17985  			"         │   │                           ├─ Filter\n" +
 17986  			"         │   │                           │   ├─ (it1.info = 'genres')\n" +
 17987  			"         │   │                           │   └─ TableAlias(it1)\n" +
 17988  			"         │   │                           │       └─ Table\n" +
 17989  			"         │   │                           │           ├─ name: info_type\n" +
 17990  			"         │   │                           │           └─ columns: [id info]\n" +
 17991  			"         │   │                           └─ HashLookup\n" +
 17992  			"         │   │                               ├─ left-key: (it1.id)\n" +
 17993  			"         │   │                               ├─ right-key: (mi.info_type_id)\n" +
 17994  			"         │   │                               └─ LookupJoin\n" +
 17995  			"         │   │                                   ├─ InnerJoin\n" +
 17996  			"         │   │                                   │   ├─ (mi.movie_id = mk.movie_id)\n" +
 17997  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 17998  			"         │   │                                   │   │   └─ Table\n" +
 17999  			"         │   │                                   │   │       ├─ name: movie_keyword\n" +
 18000  			"         │   │                                   │   │       └─ columns: [movie_id keyword_id]\n" +
 18001  			"         │   │                                   │   └─ Filter\n" +
 18002  			"         │   │                                   │       ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
 18003  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 18004  			"         │   │                                   │           └─ Table\n" +
 18005  			"         │   │                                   │               ├─ name: movie_info\n" +
 18006  			"         │   │                                   │               └─ columns: [movie_id info_type_id info]\n" +
 18007  			"         │   │                                   └─ Filter\n" +
 18008  			"         │   │                                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 18009  			"         │   │                                       └─ TableAlias(ci)\n" +
 18010  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 18011  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 18012  			"         │   │                                               ├─ columns: [person_id movie_id note]\n" +
 18013  			"         │   │                                               └─ keys: mi.movie_id\n" +
 18014  			"         │   └─ HashLookup\n" +
 18015  			"         │       ├─ left-key: (ci.person_id)\n" +
 18016  			"         │       ├─ right-key: (n.id)\n" +
 18017  			"         │       └─ Filter\n" +
 18018  			"         │           ├─ (n.gender = 'm')\n" +
 18019  			"         │           └─ TableAlias(n)\n" +
 18020  			"         │               └─ Table\n" +
 18021  			"         │                   ├─ name: name\n" +
 18022  			"         │                   └─ columns: [id name gender]\n" +
 18023  			"         └─ HashLookup\n" +
 18024  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id)\n" +
 18025  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
 18026  			"             └─ TableAlias(t)\n" +
 18027  			"                 └─ Table\n" +
 18028  			"                     ├─ name: title\n" +
 18029  			"                     └─ columns: [id title]\n" +
 18030  			"",
 18031  		ExpectedAnalysis: "Project\n" +
 18032  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as male_writer, min(t.title) as violent_movie_title]\n" +
 18033  			" └─ GroupBy\n" +
 18034  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 18035  			"     ├─ Grouping()\n" +
 18036  			"     └─ HashJoin\n" +
 18037  			"         ├─ ((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id))\n" +
 18038  			"         ├─ HashJoin\n" +
 18039  			"         │   ├─ (n.id = ci.person_id)\n" +
 18040  			"         │   ├─ HashJoin\n" +
 18041  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 18042  			"         │   │   ├─ Filter\n" +
 18043  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 18044  			"         │   │   │   └─ TableAlias(it2)\n" +
 18045  			"         │   │   │       └─ Table\n" +
 18046  			"         │   │   │           ├─ name: info_type\n" +
 18047  			"         │   │   │           └─ columns: [id info]\n" +
 18048  			"         │   │   └─ HashLookup\n" +
 18049  			"         │   │       ├─ left-key: (it2.id)\n" +
 18050  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 18051  			"         │   │       └─ HashJoin\n" +
 18052  			"         │   │           ├─ ((mi.movie_id = mi_idx.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 18053  			"         │   │           ├─ TableAlias(mi_idx)\n" +
 18054  			"         │   │           │   └─ Table\n" +
 18055  			"         │   │           │       ├─ name: movie_info_idx\n" +
 18056  			"         │   │           │       └─ columns: [movie_id info_type_id info]\n" +
 18057  			"         │   │           └─ HashLookup\n" +
 18058  			"         │   │               ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 18059  			"         │   │               ├─ right-key: (mi.movie_id, mk.movie_id)\n" +
 18060  			"         │   │               └─ HashJoin\n" +
 18061  			"         │   │                   ├─ (k.id = mk.keyword_id)\n" +
 18062  			"         │   │                   ├─ Filter\n" +
 18063  			"         │   │                   │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 18064  			"         │   │                   │   └─ TableAlias(k)\n" +
 18065  			"         │   │                   │       └─ Table\n" +
 18066  			"         │   │                   │           ├─ name: keyword\n" +
 18067  			"         │   │                   │           └─ columns: [id keyword]\n" +
 18068  			"         │   │                   └─ HashLookup\n" +
 18069  			"         │   │                       ├─ left-key: (k.id)\n" +
 18070  			"         │   │                       ├─ right-key: (mk.keyword_id)\n" +
 18071  			"         │   │                       └─ HashJoin\n" +
 18072  			"         │   │                           ├─ (it1.id = mi.info_type_id)\n" +
 18073  			"         │   │                           ├─ Filter\n" +
 18074  			"         │   │                           │   ├─ (it1.info = 'genres')\n" +
 18075  			"         │   │                           │   └─ TableAlias(it1)\n" +
 18076  			"         │   │                           │       └─ Table\n" +
 18077  			"         │   │                           │           ├─ name: info_type\n" +
 18078  			"         │   │                           │           └─ columns: [id info]\n" +
 18079  			"         │   │                           └─ HashLookup\n" +
 18080  			"         │   │                               ├─ left-key: (it1.id)\n" +
 18081  			"         │   │                               ├─ right-key: (mi.info_type_id)\n" +
 18082  			"         │   │                               └─ LookupJoin\n" +
 18083  			"         │   │                                   ├─ InnerJoin\n" +
 18084  			"         │   │                                   │   ├─ (mi.movie_id = mk.movie_id)\n" +
 18085  			"         │   │                                   │   ├─ TableAlias(mk)\n" +
 18086  			"         │   │                                   │   │   └─ Table\n" +
 18087  			"         │   │                                   │   │       ├─ name: movie_keyword\n" +
 18088  			"         │   │                                   │   │       └─ columns: [movie_id keyword_id]\n" +
 18089  			"         │   │                                   │   └─ Filter\n" +
 18090  			"         │   │                                   │       ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
 18091  			"         │   │                                   │       └─ TableAlias(mi)\n" +
 18092  			"         │   │                                   │           └─ Table\n" +
 18093  			"         │   │                                   │               ├─ name: movie_info\n" +
 18094  			"         │   │                                   │               └─ columns: [movie_id info_type_id info]\n" +
 18095  			"         │   │                                   └─ Filter\n" +
 18096  			"         │   │                                       ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 18097  			"         │   │                                       └─ TableAlias(ci)\n" +
 18098  			"         │   │                                           └─ IndexedTableAccess(cast_info)\n" +
 18099  			"         │   │                                               ├─ index: [cast_info.movie_id]\n" +
 18100  			"         │   │                                               ├─ columns: [person_id movie_id note]\n" +
 18101  			"         │   │                                               └─ keys: mi.movie_id\n" +
 18102  			"         │   └─ HashLookup\n" +
 18103  			"         │       ├─ left-key: (ci.person_id)\n" +
 18104  			"         │       ├─ right-key: (n.id)\n" +
 18105  			"         │       └─ Filter\n" +
 18106  			"         │           ├─ (n.gender = 'm')\n" +
 18107  			"         │           └─ TableAlias(n)\n" +
 18108  			"         │               └─ Table\n" +
 18109  			"         │                   ├─ name: name\n" +
 18110  			"         │                   └─ columns: [id name gender]\n" +
 18111  			"         └─ HashLookup\n" +
 18112  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id)\n" +
 18113  			"             ├─ right-key: (t.id, t.id, t.id, t.id)\n" +
 18114  			"             └─ TableAlias(t)\n" +
 18115  			"                 └─ Table\n" +
 18116  			"                     ├─ name: title\n" +
 18117  			"                     └─ columns: [id title]\n" +
 18118  			"",
 18119  	},
 18120  	{
 18121  		Query: `
 18122  SELECT MIN(chn.name) AS character_name,
 18123         MIN(mi_idx.info) AS rating,
 18124         MIN(n.name) AS playing_actor,
 18125         MIN(t.title) AS complete_hero_movie
 18126  FROM complete_cast AS cc,
 18127       comp_cast_type AS cct1,
 18128       comp_cast_type AS cct2,
 18129       char_name AS chn,
 18130       cast_info AS ci,
 18131       info_type AS it2,
 18132       keyword AS k,
 18133       kind_type AS kt,
 18134       movie_info_idx AS mi_idx,
 18135       movie_keyword AS mk,
 18136       name AS n,
 18137       title AS t
 18138  WHERE cct1.kind = 'cast'
 18139    AND cct2.kind LIKE '%complete%'
 18140    AND chn.name IS NOT NULL
 18141    AND (chn.name LIKE '%man%'
 18142         OR chn.name LIKE '%Man%')
 18143    AND it2.info = 'rating'
 18144    AND k.keyword IN ('superhero',
 18145                      'marvel-comics',
 18146                      'based-on-comic',
 18147                      'tv-special',
 18148                      'fight',
 18149                      'violence',
 18150                      'magnet',
 18151                      'web',
 18152                      'claw',
 18153                      'laser')
 18154    AND kt.kind = 'movie'
 18155    AND mi_idx.info > '7.0'
 18156    AND t.production_year > 2000
 18157    AND kt.id = t.kind_id
 18158    AND t.id = mk.movie_id
 18159    AND t.id = ci.movie_id
 18160    AND t.id = cc.movie_id
 18161    AND t.id = mi_idx.movie_id
 18162    AND mk.movie_id = ci.movie_id
 18163    AND mk.movie_id = cc.movie_id
 18164    AND mk.movie_id = mi_idx.movie_id
 18165    AND ci.movie_id = cc.movie_id
 18166    AND ci.movie_id = mi_idx.movie_id
 18167    AND cc.movie_id = mi_idx.movie_id
 18168    AND chn.id = ci.person_role_id
 18169    AND n.id = ci.person_id
 18170    AND k.id = mk.keyword_id
 18171    AND cct1.id = cc.subject_id
 18172    AND cct2.id = cc.status_id
 18173    AND it2.id = mi_idx.info_type_id;
 18174  
 18175  `,
 18176  		ExpectedPlan: "Project\n" +
 18177  			" ├─ columns: [min(chn.name):0!null as character_name, min(mi_idx.info):1!null as rating, min(n.name):2!null as playing_actor, min(t.title):3!null as complete_hero_movie]\n" +
 18178  			" └─ GroupBy\n" +
 18179  			"     ├─ select: MIN(chn.name:22!null), MIN(mi_idx.info:15!null), MIN(n.name:28!null), MIN(t.title:1!null)\n" +
 18180  			"     ├─ group: \n" +
 18181  			"     └─ InnerJoin\n" +
 18182  			"         ├─ Eq\n" +
 18183  			"         │   ├─ n.id:27!null\n" +
 18184  			"         │   └─ ci.person_id:18!null\n" +
 18185  			"         ├─ InnerJoin\n" +
 18186  			"         │   ├─ AND\n" +
 18187  			"         │   │   ├─ AND\n" +
 18188  			"         │   │   │   ├─ AND\n" +
 18189  			"         │   │   │   │   ├─ Eq\n" +
 18190  			"         │   │   │   │   │   ├─ mk.movie_id:23!null\n" +
 18191  			"         │   │   │   │   │   └─ ci.movie_id:19!null\n" +
 18192  			"         │   │   │   │   └─ Eq\n" +
 18193  			"         │   │   │   │       ├─ mk.movie_id:23!null\n" +
 18194  			"         │   │   │   │       └─ cc.movie_id:8\n" +
 18195  			"         │   │   │   └─ Eq\n" +
 18196  			"         │   │   │       ├─ mk.movie_id:23!null\n" +
 18197  			"         │   │   │       └─ mi_idx.movie_id:13!null\n" +
 18198  			"         │   │   └─ Eq\n" +
 18199  			"         │   │       ├─ t.id:0!null\n" +
 18200  			"         │   │       └─ mk.movie_id:23!null\n" +
 18201  			"         │   ├─ InnerJoin\n" +
 18202  			"         │   │   ├─ Eq\n" +
 18203  			"         │   │   │   ├─ ci.movie_id:19!null\n" +
 18204  			"         │   │   │   └─ cc.movie_id:8\n" +
 18205  			"         │   │   ├─ InnerJoin\n" +
 18206  			"         │   │   │   ├─ Eq\n" +
 18207  			"         │   │   │   │   ├─ t.id:0!null\n" +
 18208  			"         │   │   │   │   └─ mi_idx.movie_id:13!null\n" +
 18209  			"         │   │   │   ├─ InnerJoin\n" +
 18210  			"         │   │   │   │   ├─ Eq\n" +
 18211  			"         │   │   │   │   │   ├─ kt.id:11!null\n" +
 18212  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 18213  			"         │   │   │   │   ├─ InnerJoin\n" +
 18214  			"         │   │   │   │   │   ├─ Eq\n" +
 18215  			"         │   │   │   │   │   │   ├─ t.id:0!null\n" +
 18216  			"         │   │   │   │   │   │   └─ cc.movie_id:8\n" +
 18217  			"         │   │   │   │   │   ├─ Filter\n" +
 18218  			"         │   │   │   │   │   │   ├─ GreaterThan\n" +
 18219  			"         │   │   │   │   │   │   │   ├─ t.production_year:3\n" +
 18220  			"         │   │   │   │   │   │   │   └─ 2000 (smallint)\n" +
 18221  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 18222  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 18223  			"         │   │   │   │   │   │           └─ Table\n" +
 18224  			"         │   │   │   │   │   │               ├─ name: title\n" +
 18225  			"         │   │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 18226  			"         │   │   │   │   │   └─ InnerJoin\n" +
 18227  			"         │   │   │   │   │       ├─ Eq\n" +
 18228  			"         │   │   │   │   │       │   ├─ cct2.id:4!null\n" +
 18229  			"         │   │   │   │   │       │   └─ cc.status_id:10!null\n" +
 18230  			"         │   │   │   │   │       ├─ Filter\n" +
 18231  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 18232  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 18233  			"         │   │   │   │   │       │       └─ ProcessTable\n" +
 18234  			"         │   │   │   │   │       │           └─ Table\n" +
 18235  			"         │   │   │   │   │       │               ├─ name: comp_cast_type\n" +
 18236  			"         │   │   │   │   │       │               └─ columns: [id kind]\n" +
 18237  			"         │   │   │   │   │       └─ InnerJoin\n" +
 18238  			"         │   │   │   │   │           ├─ Eq\n" +
 18239  			"         │   │   │   │   │           │   ├─ cct1.id:6!null\n" +
 18240  			"         │   │   │   │   │           │   └─ cc.subject_id:9!null\n" +
 18241  			"         │   │   │   │   │           ├─ Filter\n" +
 18242  			"         │   │   │   │   │           │   ├─ Eq\n" +
 18243  			"         │   │   │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 18244  			"         │   │   │   │   │           │   │   └─ cast (longtext)\n" +
 18245  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 18246  			"         │   │   │   │   │           │       └─ Table\n" +
 18247  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 18248  			"         │   │   │   │   │           │           ├─ columns: [id kind]\n" +
 18249  			"         │   │   │   │   │           │           ├─ colSet: (5,6)\n" +
 18250  			"         │   │   │   │   │           │           └─ tableId: 2\n" +
 18251  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 18252  			"         │   │   │   │   │               └─ ProcessTable\n" +
 18253  			"         │   │   │   │   │                   └─ Table\n" +
 18254  			"         │   │   │   │   │                       ├─ name: complete_cast\n" +
 18255  			"         │   │   │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 18256  			"         │   │   │   │   └─ Filter\n" +
 18257  			"         │   │   │   │       ├─ Eq\n" +
 18258  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 18259  			"         │   │   │   │       │   └─ movie (longtext)\n" +
 18260  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 18261  			"         │   │   │   │           └─ ProcessTable\n" +
 18262  			"         │   │   │   │               └─ Table\n" +
 18263  			"         │   │   │   │                   ├─ name: kind_type\n" +
 18264  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 18265  			"         │   │   │   └─ InnerJoin\n" +
 18266  			"         │   │   │       ├─ Eq\n" +
 18267  			"         │   │   │       │   ├─ it2.id:16!null\n" +
 18268  			"         │   │   │       │   └─ mi_idx.info_type_id:14!null\n" +
 18269  			"         │   │   │       ├─ Filter\n" +
 18270  			"         │   │   │       │   ├─ GreaterThan\n" +
 18271  			"         │   │   │       │   │   ├─ mi_idx.info:2!null\n" +
 18272  			"         │   │   │       │   │   └─ 7.0 (longtext)\n" +
 18273  			"         │   │   │       │   └─ TableAlias(mi_idx)\n" +
 18274  			"         │   │   │       │       └─ ProcessTable\n" +
 18275  			"         │   │   │       │           └─ Table\n" +
 18276  			"         │   │   │       │               ├─ name: movie_info_idx\n" +
 18277  			"         │   │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 18278  			"         │   │   │       └─ Filter\n" +
 18279  			"         │   │   │           ├─ Eq\n" +
 18280  			"         │   │   │           │   ├─ it2.info:1!null\n" +
 18281  			"         │   │   │           │   └─ rating (longtext)\n" +
 18282  			"         │   │   │           └─ TableAlias(it2)\n" +
 18283  			"         │   │   │               └─ ProcessTable\n" +
 18284  			"         │   │   │                   └─ Table\n" +
 18285  			"         │   │   │                       ├─ name: info_type\n" +
 18286  			"         │   │   │                       └─ columns: [id info]\n" +
 18287  			"         │   │   └─ InnerJoin\n" +
 18288  			"         │   │       ├─ Eq\n" +
 18289  			"         │   │       │   ├─ chn.id:21!null\n" +
 18290  			"         │   │       │   └─ ci.person_role_id:20\n" +
 18291  			"         │   │       ├─ TableAlias(ci)\n" +
 18292  			"         │   │       │   └─ ProcessTable\n" +
 18293  			"         │   │       │       └─ Table\n" +
 18294  			"         │   │       │           ├─ name: cast_info\n" +
 18295  			"         │   │       │           └─ columns: [person_id movie_id person_role_id]\n" +
 18296  			"         │   │       └─ Filter\n" +
 18297  			"         │   │           ├─ AND\n" +
 18298  			"         │   │           │   ├─ NOT\n" +
 18299  			"         │   │           │   │   └─ chn.name:1!null IS NULL\n" +
 18300  			"         │   │           │   └─ Or\n" +
 18301  			"         │   │           │       ├─ chn.name LIKE '%man%'\n" +
 18302  			"         │   │           │       └─ chn.name LIKE '%Man%'\n" +
 18303  			"         │   │           └─ TableAlias(chn)\n" +
 18304  			"         │   │               └─ ProcessTable\n" +
 18305  			"         │   │                   └─ Table\n" +
 18306  			"         │   │                       ├─ name: char_name\n" +
 18307  			"         │   │                       └─ columns: [id name]\n" +
 18308  			"         │   └─ InnerJoin\n" +
 18309  			"         │       ├─ Eq\n" +
 18310  			"         │       │   ├─ k.id:25!null\n" +
 18311  			"         │       │   └─ mk.keyword_id:24!null\n" +
 18312  			"         │       ├─ TableAlias(mk)\n" +
 18313  			"         │       │   └─ ProcessTable\n" +
 18314  			"         │       │       └─ Table\n" +
 18315  			"         │       │           ├─ name: movie_keyword\n" +
 18316  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 18317  			"         │       └─ Filter\n" +
 18318  			"         │           ├─ HashIn\n" +
 18319  			"         │           │   ├─ k.keyword:1!null\n" +
 18320  			"         │           │   └─ TUPLE(superhero (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext), magnet (longtext), web (longtext), claw (longtext), laser (longtext))\n" +
 18321  			"         │           └─ TableAlias(k)\n" +
 18322  			"         │               └─ ProcessTable\n" +
 18323  			"         │                   └─ Table\n" +
 18324  			"         │                       ├─ name: keyword\n" +
 18325  			"         │                       └─ columns: [id keyword]\n" +
 18326  			"         └─ TableAlias(n)\n" +
 18327  			"             └─ ProcessTable\n" +
 18328  			"                 └─ Table\n" +
 18329  			"                     ├─ name: name\n" +
 18330  			"                     └─ columns: [id name]\n" +
 18331  			"",
 18332  		ExpectedEstimates: "Project\n" +
 18333  			" ├─ columns: [min(chn.name) as character_name, min(mi_idx.info) as rating, min(n.name) as playing_actor, min(t.title) as complete_hero_movie]\n" +
 18334  			" └─ GroupBy\n" +
 18335  			"     ├─ SelectedExprs(MIN(chn.name), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 18336  			"     ├─ Grouping()\n" +
 18337  			"     └─ InnerJoin\n" +
 18338  			"         ├─ (n.id = ci.person_id)\n" +
 18339  			"         ├─ InnerJoin\n" +
 18340  			"         │   ├─ ((((mk.movie_id = ci.movie_id) AND (mk.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 18341  			"         │   ├─ InnerJoin\n" +
 18342  			"         │   │   ├─ (ci.movie_id = cc.movie_id)\n" +
 18343  			"         │   │   ├─ InnerJoin\n" +
 18344  			"         │   │   │   ├─ (t.id = mi_idx.movie_id)\n" +
 18345  			"         │   │   │   ├─ InnerJoin\n" +
 18346  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 18347  			"         │   │   │   │   ├─ InnerJoin\n" +
 18348  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 18349  			"         │   │   │   │   │   ├─ Filter\n" +
 18350  			"         │   │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 18351  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 18352  			"         │   │   │   │   │   │       └─ Table\n" +
 18353  			"         │   │   │   │   │   │           ├─ name: title\n" +
 18354  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 18355  			"         │   │   │   │   │   └─ InnerJoin\n" +
 18356  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 18357  			"         │   │   │   │   │       ├─ Filter\n" +
 18358  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 18359  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 18360  			"         │   │   │   │   │       │       └─ Table\n" +
 18361  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 18362  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 18363  			"         │   │   │   │   │       └─ InnerJoin\n" +
 18364  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 18365  			"         │   │   │   │   │           ├─ Filter\n" +
 18366  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 18367  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 18368  			"         │   │   │   │   │           │       └─ Table\n" +
 18369  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 18370  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 18371  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 18372  			"         │   │   │   │   │               └─ Table\n" +
 18373  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 18374  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 18375  			"         │   │   │   │   └─ Filter\n" +
 18376  			"         │   │   │   │       ├─ (kt.kind = 'movie')\n" +
 18377  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 18378  			"         │   │   │   │           └─ Table\n" +
 18379  			"         │   │   │   │               ├─ name: kind_type\n" +
 18380  			"         │   │   │   │               └─ columns: [id kind]\n" +
 18381  			"         │   │   │   └─ InnerJoin\n" +
 18382  			"         │   │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 18383  			"         │   │   │       ├─ Filter\n" +
 18384  			"         │   │   │       │   ├─ (mi_idx.info > '7.0')\n" +
 18385  			"         │   │   │       │   └─ TableAlias(mi_idx)\n" +
 18386  			"         │   │   │       │       └─ Table\n" +
 18387  			"         │   │   │       │           ├─ name: movie_info_idx\n" +
 18388  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 18389  			"         │   │   │       └─ Filter\n" +
 18390  			"         │   │   │           ├─ (it2.info = 'rating')\n" +
 18391  			"         │   │   │           └─ TableAlias(it2)\n" +
 18392  			"         │   │   │               └─ Table\n" +
 18393  			"         │   │   │                   ├─ name: info_type\n" +
 18394  			"         │   │   │                   └─ columns: [id info]\n" +
 18395  			"         │   │   └─ InnerJoin\n" +
 18396  			"         │   │       ├─ (chn.id = ci.person_role_id)\n" +
 18397  			"         │   │       ├─ TableAlias(ci)\n" +
 18398  			"         │   │       │   └─ Table\n" +
 18399  			"         │   │       │       ├─ name: cast_info\n" +
 18400  			"         │   │       │       └─ columns: [person_id movie_id person_role_id]\n" +
 18401  			"         │   │       └─ Filter\n" +
 18402  			"         │   │           ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 18403  			"         │   │           └─ TableAlias(chn)\n" +
 18404  			"         │   │               └─ Table\n" +
 18405  			"         │   │                   ├─ name: char_name\n" +
 18406  			"         │   │                   └─ columns: [id name]\n" +
 18407  			"         │   └─ InnerJoin\n" +
 18408  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 18409  			"         │       ├─ TableAlias(mk)\n" +
 18410  			"         │       │   └─ Table\n" +
 18411  			"         │       │       ├─ name: movie_keyword\n" +
 18412  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 18413  			"         │       └─ Filter\n" +
 18414  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence', 'magnet', 'web', 'claw', 'laser'))\n" +
 18415  			"         │           └─ TableAlias(k)\n" +
 18416  			"         │               └─ Table\n" +
 18417  			"         │                   ├─ name: keyword\n" +
 18418  			"         │                   └─ columns: [id keyword]\n" +
 18419  			"         └─ TableAlias(n)\n" +
 18420  			"             └─ Table\n" +
 18421  			"                 ├─ name: name\n" +
 18422  			"                 └─ columns: [id name]\n" +
 18423  			"",
 18424  		ExpectedAnalysis: "Project\n" +
 18425  			" ├─ columns: [min(chn.name) as character_name, min(mi_idx.info) as rating, min(n.name) as playing_actor, min(t.title) as complete_hero_movie]\n" +
 18426  			" └─ GroupBy\n" +
 18427  			"     ├─ SelectedExprs(MIN(chn.name), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 18428  			"     ├─ Grouping()\n" +
 18429  			"     └─ InnerJoin\n" +
 18430  			"         ├─ (n.id = ci.person_id)\n" +
 18431  			"         ├─ InnerJoin\n" +
 18432  			"         │   ├─ ((((mk.movie_id = ci.movie_id) AND (mk.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 18433  			"         │   ├─ InnerJoin\n" +
 18434  			"         │   │   ├─ (ci.movie_id = cc.movie_id)\n" +
 18435  			"         │   │   ├─ InnerJoin\n" +
 18436  			"         │   │   │   ├─ (t.id = mi_idx.movie_id)\n" +
 18437  			"         │   │   │   ├─ InnerJoin\n" +
 18438  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 18439  			"         │   │   │   │   ├─ InnerJoin\n" +
 18440  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 18441  			"         │   │   │   │   │   ├─ Filter\n" +
 18442  			"         │   │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 18443  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 18444  			"         │   │   │   │   │   │       └─ Table\n" +
 18445  			"         │   │   │   │   │   │           ├─ name: title\n" +
 18446  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 18447  			"         │   │   │   │   │   └─ InnerJoin\n" +
 18448  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 18449  			"         │   │   │   │   │       ├─ Filter\n" +
 18450  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 18451  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 18452  			"         │   │   │   │   │       │       └─ Table\n" +
 18453  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 18454  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 18455  			"         │   │   │   │   │       └─ InnerJoin\n" +
 18456  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 18457  			"         │   │   │   │   │           ├─ Filter\n" +
 18458  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 18459  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 18460  			"         │   │   │   │   │           │       └─ Table\n" +
 18461  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 18462  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 18463  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 18464  			"         │   │   │   │   │               └─ Table\n" +
 18465  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 18466  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 18467  			"         │   │   │   │   └─ Filter\n" +
 18468  			"         │   │   │   │       ├─ (kt.kind = 'movie')\n" +
 18469  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 18470  			"         │   │   │   │           └─ Table\n" +
 18471  			"         │   │   │   │               ├─ name: kind_type\n" +
 18472  			"         │   │   │   │               └─ columns: [id kind]\n" +
 18473  			"         │   │   │   └─ InnerJoin\n" +
 18474  			"         │   │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 18475  			"         │   │   │       ├─ Filter\n" +
 18476  			"         │   │   │       │   ├─ (mi_idx.info > '7.0')\n" +
 18477  			"         │   │   │       │   └─ TableAlias(mi_idx)\n" +
 18478  			"         │   │   │       │       └─ Table\n" +
 18479  			"         │   │   │       │           ├─ name: movie_info_idx\n" +
 18480  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 18481  			"         │   │   │       └─ Filter\n" +
 18482  			"         │   │   │           ├─ (it2.info = 'rating')\n" +
 18483  			"         │   │   │           └─ TableAlias(it2)\n" +
 18484  			"         │   │   │               └─ Table\n" +
 18485  			"         │   │   │                   ├─ name: info_type\n" +
 18486  			"         │   │   │                   └─ columns: [id info]\n" +
 18487  			"         │   │   └─ InnerJoin\n" +
 18488  			"         │   │       ├─ (chn.id = ci.person_role_id)\n" +
 18489  			"         │   │       ├─ TableAlias(ci)\n" +
 18490  			"         │   │       │   └─ Table\n" +
 18491  			"         │   │       │       ├─ name: cast_info\n" +
 18492  			"         │   │       │       └─ columns: [person_id movie_id person_role_id]\n" +
 18493  			"         │   │       └─ Filter\n" +
 18494  			"         │   │           ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 18495  			"         │   │           └─ TableAlias(chn)\n" +
 18496  			"         │   │               └─ Table\n" +
 18497  			"         │   │                   ├─ name: char_name\n" +
 18498  			"         │   │                   └─ columns: [id name]\n" +
 18499  			"         │   └─ InnerJoin\n" +
 18500  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 18501  			"         │       ├─ TableAlias(mk)\n" +
 18502  			"         │       │   └─ Table\n" +
 18503  			"         │       │       ├─ name: movie_keyword\n" +
 18504  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 18505  			"         │       └─ Filter\n" +
 18506  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence', 'magnet', 'web', 'claw', 'laser'))\n" +
 18507  			"         │           └─ TableAlias(k)\n" +
 18508  			"         │               └─ Table\n" +
 18509  			"         │                   ├─ name: keyword\n" +
 18510  			"         │                   └─ columns: [id keyword]\n" +
 18511  			"         └─ TableAlias(n)\n" +
 18512  			"             └─ Table\n" +
 18513  			"                 ├─ name: name\n" +
 18514  			"                 └─ columns: [id name]\n" +
 18515  			"",
 18516  	},
 18517  	{
 18518  		Query: `
 18519  SELECT MIN(chn.name) AS character_name,
 18520         MIN(mi_idx.info) AS rating,
 18521         MIN(t.title) AS complete_hero_movie
 18522  FROM complete_cast AS cc,
 18523       comp_cast_type AS cct1,
 18524       comp_cast_type AS cct2,
 18525       char_name AS chn,
 18526       cast_info AS ci,
 18527       info_type AS it2,
 18528       keyword AS k,
 18529       kind_type AS kt,
 18530       movie_info_idx AS mi_idx,
 18531       movie_keyword AS mk,
 18532       name AS n,
 18533       title AS t
 18534  WHERE cct1.kind = 'cast'
 18535    AND cct2.kind LIKE '%complete%'
 18536    AND chn.name IS NOT NULL
 18537    AND (chn.name LIKE '%man%'
 18538         OR chn.name LIKE '%Man%')
 18539    AND it2.info = 'rating'
 18540    AND k.keyword IN ('superhero',
 18541                      'marvel-comics',
 18542                      'based-on-comic',
 18543                      'fight')
 18544    AND kt.kind = 'movie'
 18545    AND mi_idx.info > '8.0'
 18546    AND t.production_year > 2005
 18547    AND kt.id = t.kind_id
 18548    AND t.id = mk.movie_id
 18549    AND t.id = ci.movie_id
 18550    AND t.id = cc.movie_id
 18551    AND t.id = mi_idx.movie_id
 18552    AND mk.movie_id = ci.movie_id
 18553    AND mk.movie_id = cc.movie_id
 18554    AND mk.movie_id = mi_idx.movie_id
 18555    AND ci.movie_id = cc.movie_id
 18556    AND ci.movie_id = mi_idx.movie_id
 18557    AND cc.movie_id = mi_idx.movie_id
 18558    AND chn.id = ci.person_role_id
 18559    AND n.id = ci.person_id
 18560    AND k.id = mk.keyword_id
 18561    AND cct1.id = cc.subject_id
 18562    AND cct2.id = cc.status_id
 18563    AND it2.id = mi_idx.info_type_id;
 18564  
 18565  `,
 18566  		ExpectedPlan: "Project\n" +
 18567  			" ├─ columns: [min(chn.name):0!null as character_name, min(mi_idx.info):1!null as rating, min(t.title):2!null as complete_hero_movie]\n" +
 18568  			" └─ GroupBy\n" +
 18569  			"     ├─ select: MIN(chn.name:22!null), MIN(mi_idx.info:15!null), MIN(t.title:1!null)\n" +
 18570  			"     ├─ group: \n" +
 18571  			"     └─ InnerJoin\n" +
 18572  			"         ├─ Eq\n" +
 18573  			"         │   ├─ n.id:27!null\n" +
 18574  			"         │   └─ ci.person_id:18!null\n" +
 18575  			"         ├─ InnerJoin\n" +
 18576  			"         │   ├─ AND\n" +
 18577  			"         │   │   ├─ AND\n" +
 18578  			"         │   │   │   ├─ AND\n" +
 18579  			"         │   │   │   │   ├─ Eq\n" +
 18580  			"         │   │   │   │   │   ├─ mk.movie_id:23!null\n" +
 18581  			"         │   │   │   │   │   └─ ci.movie_id:19!null\n" +
 18582  			"         │   │   │   │   └─ Eq\n" +
 18583  			"         │   │   │   │       ├─ mk.movie_id:23!null\n" +
 18584  			"         │   │   │   │       └─ cc.movie_id:8\n" +
 18585  			"         │   │   │   └─ Eq\n" +
 18586  			"         │   │   │       ├─ mk.movie_id:23!null\n" +
 18587  			"         │   │   │       └─ mi_idx.movie_id:13!null\n" +
 18588  			"         │   │   └─ Eq\n" +
 18589  			"         │   │       ├─ t.id:0!null\n" +
 18590  			"         │   │       └─ mk.movie_id:23!null\n" +
 18591  			"         │   ├─ InnerJoin\n" +
 18592  			"         │   │   ├─ Eq\n" +
 18593  			"         │   │   │   ├─ ci.movie_id:19!null\n" +
 18594  			"         │   │   │   └─ cc.movie_id:8\n" +
 18595  			"         │   │   ├─ InnerJoin\n" +
 18596  			"         │   │   │   ├─ Eq\n" +
 18597  			"         │   │   │   │   ├─ t.id:0!null\n" +
 18598  			"         │   │   │   │   └─ mi_idx.movie_id:13!null\n" +
 18599  			"         │   │   │   ├─ InnerJoin\n" +
 18600  			"         │   │   │   │   ├─ Eq\n" +
 18601  			"         │   │   │   │   │   ├─ kt.id:11!null\n" +
 18602  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 18603  			"         │   │   │   │   ├─ InnerJoin\n" +
 18604  			"         │   │   │   │   │   ├─ Eq\n" +
 18605  			"         │   │   │   │   │   │   ├─ t.id:0!null\n" +
 18606  			"         │   │   │   │   │   │   └─ cc.movie_id:8\n" +
 18607  			"         │   │   │   │   │   ├─ Filter\n" +
 18608  			"         │   │   │   │   │   │   ├─ GreaterThan\n" +
 18609  			"         │   │   │   │   │   │   │   ├─ t.production_year:3\n" +
 18610  			"         │   │   │   │   │   │   │   └─ 2005 (smallint)\n" +
 18611  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 18612  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 18613  			"         │   │   │   │   │   │           └─ Table\n" +
 18614  			"         │   │   │   │   │   │               ├─ name: title\n" +
 18615  			"         │   │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 18616  			"         │   │   │   │   │   └─ InnerJoin\n" +
 18617  			"         │   │   │   │   │       ├─ Eq\n" +
 18618  			"         │   │   │   │   │       │   ├─ cct2.id:4!null\n" +
 18619  			"         │   │   │   │   │       │   └─ cc.status_id:10!null\n" +
 18620  			"         │   │   │   │   │       ├─ Filter\n" +
 18621  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 18622  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 18623  			"         │   │   │   │   │       │       └─ ProcessTable\n" +
 18624  			"         │   │   │   │   │       │           └─ Table\n" +
 18625  			"         │   │   │   │   │       │               ├─ name: comp_cast_type\n" +
 18626  			"         │   │   │   │   │       │               └─ columns: [id kind]\n" +
 18627  			"         │   │   │   │   │       └─ InnerJoin\n" +
 18628  			"         │   │   │   │   │           ├─ Eq\n" +
 18629  			"         │   │   │   │   │           │   ├─ cct1.id:6!null\n" +
 18630  			"         │   │   │   │   │           │   └─ cc.subject_id:9!null\n" +
 18631  			"         │   │   │   │   │           ├─ Filter\n" +
 18632  			"         │   │   │   │   │           │   ├─ Eq\n" +
 18633  			"         │   │   │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 18634  			"         │   │   │   │   │           │   │   └─ cast (longtext)\n" +
 18635  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 18636  			"         │   │   │   │   │           │       └─ Table\n" +
 18637  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 18638  			"         │   │   │   │   │           │           ├─ columns: [id kind]\n" +
 18639  			"         │   │   │   │   │           │           ├─ colSet: (5,6)\n" +
 18640  			"         │   │   │   │   │           │           └─ tableId: 2\n" +
 18641  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 18642  			"         │   │   │   │   │               └─ ProcessTable\n" +
 18643  			"         │   │   │   │   │                   └─ Table\n" +
 18644  			"         │   │   │   │   │                       ├─ name: complete_cast\n" +
 18645  			"         │   │   │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 18646  			"         │   │   │   │   └─ Filter\n" +
 18647  			"         │   │   │   │       ├─ Eq\n" +
 18648  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 18649  			"         │   │   │   │       │   └─ movie (longtext)\n" +
 18650  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 18651  			"         │   │   │   │           └─ ProcessTable\n" +
 18652  			"         │   │   │   │               └─ Table\n" +
 18653  			"         │   │   │   │                   ├─ name: kind_type\n" +
 18654  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 18655  			"         │   │   │   └─ InnerJoin\n" +
 18656  			"         │   │   │       ├─ Eq\n" +
 18657  			"         │   │   │       │   ├─ it2.id:16!null\n" +
 18658  			"         │   │   │       │   └─ mi_idx.info_type_id:14!null\n" +
 18659  			"         │   │   │       ├─ Filter\n" +
 18660  			"         │   │   │       │   ├─ GreaterThan\n" +
 18661  			"         │   │   │       │   │   ├─ mi_idx.info:2!null\n" +
 18662  			"         │   │   │       │   │   └─ 8.0 (longtext)\n" +
 18663  			"         │   │   │       │   └─ TableAlias(mi_idx)\n" +
 18664  			"         │   │   │       │       └─ ProcessTable\n" +
 18665  			"         │   │   │       │           └─ Table\n" +
 18666  			"         │   │   │       │               ├─ name: movie_info_idx\n" +
 18667  			"         │   │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 18668  			"         │   │   │       └─ Filter\n" +
 18669  			"         │   │   │           ├─ Eq\n" +
 18670  			"         │   │   │           │   ├─ it2.info:1!null\n" +
 18671  			"         │   │   │           │   └─ rating (longtext)\n" +
 18672  			"         │   │   │           └─ TableAlias(it2)\n" +
 18673  			"         │   │   │               └─ ProcessTable\n" +
 18674  			"         │   │   │                   └─ Table\n" +
 18675  			"         │   │   │                       ├─ name: info_type\n" +
 18676  			"         │   │   │                       └─ columns: [id info]\n" +
 18677  			"         │   │   └─ InnerJoin\n" +
 18678  			"         │   │       ├─ Eq\n" +
 18679  			"         │   │       │   ├─ chn.id:21!null\n" +
 18680  			"         │   │       │   └─ ci.person_role_id:20\n" +
 18681  			"         │   │       ├─ TableAlias(ci)\n" +
 18682  			"         │   │       │   └─ ProcessTable\n" +
 18683  			"         │   │       │       └─ Table\n" +
 18684  			"         │   │       │           ├─ name: cast_info\n" +
 18685  			"         │   │       │           └─ columns: [person_id movie_id person_role_id]\n" +
 18686  			"         │   │       └─ Filter\n" +
 18687  			"         │   │           ├─ AND\n" +
 18688  			"         │   │           │   ├─ NOT\n" +
 18689  			"         │   │           │   │   └─ chn.name:1!null IS NULL\n" +
 18690  			"         │   │           │   └─ Or\n" +
 18691  			"         │   │           │       ├─ chn.name LIKE '%man%'\n" +
 18692  			"         │   │           │       └─ chn.name LIKE '%Man%'\n" +
 18693  			"         │   │           └─ TableAlias(chn)\n" +
 18694  			"         │   │               └─ ProcessTable\n" +
 18695  			"         │   │                   └─ Table\n" +
 18696  			"         │   │                       ├─ name: char_name\n" +
 18697  			"         │   │                       └─ columns: [id name]\n" +
 18698  			"         │   └─ InnerJoin\n" +
 18699  			"         │       ├─ Eq\n" +
 18700  			"         │       │   ├─ k.id:25!null\n" +
 18701  			"         │       │   └─ mk.keyword_id:24!null\n" +
 18702  			"         │       ├─ TableAlias(mk)\n" +
 18703  			"         │       │   └─ ProcessTable\n" +
 18704  			"         │       │       └─ Table\n" +
 18705  			"         │       │           ├─ name: movie_keyword\n" +
 18706  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 18707  			"         │       └─ Filter\n" +
 18708  			"         │           ├─ HashIn\n" +
 18709  			"         │           │   ├─ k.keyword:1!null\n" +
 18710  			"         │           │   └─ TUPLE(superhero (longtext), marvel-comics (longtext), based-on-comic (longtext), fight (longtext))\n" +
 18711  			"         │           └─ TableAlias(k)\n" +
 18712  			"         │               └─ ProcessTable\n" +
 18713  			"         │                   └─ Table\n" +
 18714  			"         │                       ├─ name: keyword\n" +
 18715  			"         │                       └─ columns: [id keyword]\n" +
 18716  			"         └─ TableAlias(n)\n" +
 18717  			"             └─ ProcessTable\n" +
 18718  			"                 └─ Table\n" +
 18719  			"                     ├─ name: name\n" +
 18720  			"                     └─ columns: [id]\n" +
 18721  			"",
 18722  		ExpectedEstimates: "Project\n" +
 18723  			" ├─ columns: [min(chn.name) as character_name, min(mi_idx.info) as rating, min(t.title) as complete_hero_movie]\n" +
 18724  			" └─ GroupBy\n" +
 18725  			"     ├─ SelectedExprs(MIN(chn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 18726  			"     ├─ Grouping()\n" +
 18727  			"     └─ InnerJoin\n" +
 18728  			"         ├─ (n.id = ci.person_id)\n" +
 18729  			"         ├─ InnerJoin\n" +
 18730  			"         │   ├─ ((((mk.movie_id = ci.movie_id) AND (mk.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 18731  			"         │   ├─ InnerJoin\n" +
 18732  			"         │   │   ├─ (ci.movie_id = cc.movie_id)\n" +
 18733  			"         │   │   ├─ InnerJoin\n" +
 18734  			"         │   │   │   ├─ (t.id = mi_idx.movie_id)\n" +
 18735  			"         │   │   │   ├─ InnerJoin\n" +
 18736  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 18737  			"         │   │   │   │   ├─ InnerJoin\n" +
 18738  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 18739  			"         │   │   │   │   │   ├─ Filter\n" +
 18740  			"         │   │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 18741  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 18742  			"         │   │   │   │   │   │       └─ Table\n" +
 18743  			"         │   │   │   │   │   │           ├─ name: title\n" +
 18744  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 18745  			"         │   │   │   │   │   └─ InnerJoin\n" +
 18746  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 18747  			"         │   │   │   │   │       ├─ Filter\n" +
 18748  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 18749  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 18750  			"         │   │   │   │   │       │       └─ Table\n" +
 18751  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 18752  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 18753  			"         │   │   │   │   │       └─ InnerJoin\n" +
 18754  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 18755  			"         │   │   │   │   │           ├─ Filter\n" +
 18756  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 18757  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 18758  			"         │   │   │   │   │           │       └─ Table\n" +
 18759  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 18760  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 18761  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 18762  			"         │   │   │   │   │               └─ Table\n" +
 18763  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 18764  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 18765  			"         │   │   │   │   └─ Filter\n" +
 18766  			"         │   │   │   │       ├─ (kt.kind = 'movie')\n" +
 18767  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 18768  			"         │   │   │   │           └─ Table\n" +
 18769  			"         │   │   │   │               ├─ name: kind_type\n" +
 18770  			"         │   │   │   │               └─ columns: [id kind]\n" +
 18771  			"         │   │   │   └─ InnerJoin\n" +
 18772  			"         │   │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 18773  			"         │   │   │       ├─ Filter\n" +
 18774  			"         │   │   │       │   ├─ (mi_idx.info > '8.0')\n" +
 18775  			"         │   │   │       │   └─ TableAlias(mi_idx)\n" +
 18776  			"         │   │   │       │       └─ Table\n" +
 18777  			"         │   │   │       │           ├─ name: movie_info_idx\n" +
 18778  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 18779  			"         │   │   │       └─ Filter\n" +
 18780  			"         │   │   │           ├─ (it2.info = 'rating')\n" +
 18781  			"         │   │   │           └─ TableAlias(it2)\n" +
 18782  			"         │   │   │               └─ Table\n" +
 18783  			"         │   │   │                   ├─ name: info_type\n" +
 18784  			"         │   │   │                   └─ columns: [id info]\n" +
 18785  			"         │   │   └─ InnerJoin\n" +
 18786  			"         │   │       ├─ (chn.id = ci.person_role_id)\n" +
 18787  			"         │   │       ├─ TableAlias(ci)\n" +
 18788  			"         │   │       │   └─ Table\n" +
 18789  			"         │   │       │       ├─ name: cast_info\n" +
 18790  			"         │   │       │       └─ columns: [person_id movie_id person_role_id]\n" +
 18791  			"         │   │       └─ Filter\n" +
 18792  			"         │   │           ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 18793  			"         │   │           └─ TableAlias(chn)\n" +
 18794  			"         │   │               └─ Table\n" +
 18795  			"         │   │                   ├─ name: char_name\n" +
 18796  			"         │   │                   └─ columns: [id name]\n" +
 18797  			"         │   └─ InnerJoin\n" +
 18798  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 18799  			"         │       ├─ TableAlias(mk)\n" +
 18800  			"         │       │   └─ Table\n" +
 18801  			"         │       │       ├─ name: movie_keyword\n" +
 18802  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 18803  			"         │       └─ Filter\n" +
 18804  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'fight'))\n" +
 18805  			"         │           └─ TableAlias(k)\n" +
 18806  			"         │               └─ Table\n" +
 18807  			"         │                   ├─ name: keyword\n" +
 18808  			"         │                   └─ columns: [id keyword]\n" +
 18809  			"         └─ TableAlias(n)\n" +
 18810  			"             └─ Table\n" +
 18811  			"                 ├─ name: name\n" +
 18812  			"                 └─ columns: [id]\n" +
 18813  			"",
 18814  		ExpectedAnalysis: "Project\n" +
 18815  			" ├─ columns: [min(chn.name) as character_name, min(mi_idx.info) as rating, min(t.title) as complete_hero_movie]\n" +
 18816  			" └─ GroupBy\n" +
 18817  			"     ├─ SelectedExprs(MIN(chn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 18818  			"     ├─ Grouping()\n" +
 18819  			"     └─ InnerJoin\n" +
 18820  			"         ├─ (n.id = ci.person_id)\n" +
 18821  			"         ├─ InnerJoin\n" +
 18822  			"         │   ├─ ((((mk.movie_id = ci.movie_id) AND (mk.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 18823  			"         │   ├─ InnerJoin\n" +
 18824  			"         │   │   ├─ (ci.movie_id = cc.movie_id)\n" +
 18825  			"         │   │   ├─ InnerJoin\n" +
 18826  			"         │   │   │   ├─ (t.id = mi_idx.movie_id)\n" +
 18827  			"         │   │   │   ├─ InnerJoin\n" +
 18828  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 18829  			"         │   │   │   │   ├─ InnerJoin\n" +
 18830  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 18831  			"         │   │   │   │   │   ├─ Filter\n" +
 18832  			"         │   │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 18833  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 18834  			"         │   │   │   │   │   │       └─ Table\n" +
 18835  			"         │   │   │   │   │   │           ├─ name: title\n" +
 18836  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 18837  			"         │   │   │   │   │   └─ InnerJoin\n" +
 18838  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 18839  			"         │   │   │   │   │       ├─ Filter\n" +
 18840  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 18841  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 18842  			"         │   │   │   │   │       │       └─ Table\n" +
 18843  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 18844  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 18845  			"         │   │   │   │   │       └─ InnerJoin\n" +
 18846  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 18847  			"         │   │   │   │   │           ├─ Filter\n" +
 18848  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 18849  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 18850  			"         │   │   │   │   │           │       └─ Table\n" +
 18851  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 18852  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 18853  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 18854  			"         │   │   │   │   │               └─ Table\n" +
 18855  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 18856  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 18857  			"         │   │   │   │   └─ Filter\n" +
 18858  			"         │   │   │   │       ├─ (kt.kind = 'movie')\n" +
 18859  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 18860  			"         │   │   │   │           └─ Table\n" +
 18861  			"         │   │   │   │               ├─ name: kind_type\n" +
 18862  			"         │   │   │   │               └─ columns: [id kind]\n" +
 18863  			"         │   │   │   └─ InnerJoin\n" +
 18864  			"         │   │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 18865  			"         │   │   │       ├─ Filter\n" +
 18866  			"         │   │   │       │   ├─ (mi_idx.info > '8.0')\n" +
 18867  			"         │   │   │       │   └─ TableAlias(mi_idx)\n" +
 18868  			"         │   │   │       │       └─ Table\n" +
 18869  			"         │   │   │       │           ├─ name: movie_info_idx\n" +
 18870  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 18871  			"         │   │   │       └─ Filter\n" +
 18872  			"         │   │   │           ├─ (it2.info = 'rating')\n" +
 18873  			"         │   │   │           └─ TableAlias(it2)\n" +
 18874  			"         │   │   │               └─ Table\n" +
 18875  			"         │   │   │                   ├─ name: info_type\n" +
 18876  			"         │   │   │                   └─ columns: [id info]\n" +
 18877  			"         │   │   └─ InnerJoin\n" +
 18878  			"         │   │       ├─ (chn.id = ci.person_role_id)\n" +
 18879  			"         │   │       ├─ TableAlias(ci)\n" +
 18880  			"         │   │       │   └─ Table\n" +
 18881  			"         │   │       │       ├─ name: cast_info\n" +
 18882  			"         │   │       │       └─ columns: [person_id movie_id person_role_id]\n" +
 18883  			"         │   │       └─ Filter\n" +
 18884  			"         │   │           ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 18885  			"         │   │           └─ TableAlias(chn)\n" +
 18886  			"         │   │               └─ Table\n" +
 18887  			"         │   │                   ├─ name: char_name\n" +
 18888  			"         │   │                   └─ columns: [id name]\n" +
 18889  			"         │   └─ InnerJoin\n" +
 18890  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 18891  			"         │       ├─ TableAlias(mk)\n" +
 18892  			"         │       │   └─ Table\n" +
 18893  			"         │       │       ├─ name: movie_keyword\n" +
 18894  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 18895  			"         │       └─ Filter\n" +
 18896  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'fight'))\n" +
 18897  			"         │           └─ TableAlias(k)\n" +
 18898  			"         │               └─ Table\n" +
 18899  			"         │                   ├─ name: keyword\n" +
 18900  			"         │                   └─ columns: [id keyword]\n" +
 18901  			"         └─ TableAlias(n)\n" +
 18902  			"             └─ Table\n" +
 18903  			"                 ├─ name: name\n" +
 18904  			"                 └─ columns: [id]\n" +
 18905  			"",
 18906  	},
 18907  	{
 18908  		Query: `
 18909  SELECT MIN(chn.name) AS character_name,
 18910         MIN(mi_idx.info) AS rating,
 18911         MIN(t.title) AS complete_hero_movie
 18912  FROM complete_cast AS cc,
 18913       comp_cast_type AS cct1,
 18914       comp_cast_type AS cct2,
 18915       char_name AS chn,
 18916       cast_info AS ci,
 18917       info_type AS it2,
 18918       keyword AS k,
 18919       kind_type AS kt,
 18920       movie_info_idx AS mi_idx,
 18921       movie_keyword AS mk,
 18922       name AS n,
 18923       title AS t
 18924  WHERE cct1.kind = 'cast'
 18925    AND cct2.kind LIKE '%complete%'
 18926    AND chn.name IS NOT NULL
 18927    AND (chn.name LIKE '%man%'
 18928         OR chn.name LIKE '%Man%')
 18929    AND it2.info = 'rating'
 18930    AND k.keyword IN ('superhero',
 18931                      'marvel-comics',
 18932                      'based-on-comic',
 18933                      'tv-special',
 18934                      'fight',
 18935                      'violence',
 18936                      'magnet',
 18937                      'web',
 18938                      'claw',
 18939                      'laser')
 18940    AND kt.kind = 'movie'
 18941    AND t.production_year > 2000
 18942    AND kt.id = t.kind_id
 18943    AND t.id = mk.movie_id
 18944    AND t.id = ci.movie_id
 18945    AND t.id = cc.movie_id
 18946    AND t.id = mi_idx.movie_id
 18947    AND mk.movie_id = ci.movie_id
 18948    AND mk.movie_id = cc.movie_id
 18949    AND mk.movie_id = mi_idx.movie_id
 18950    AND ci.movie_id = cc.movie_id
 18951    AND ci.movie_id = mi_idx.movie_id
 18952    AND cc.movie_id = mi_idx.movie_id
 18953    AND chn.id = ci.person_role_id
 18954    AND n.id = ci.person_id
 18955    AND k.id = mk.keyword_id
 18956    AND cct1.id = cc.subject_id
 18957    AND cct2.id = cc.status_id
 18958    AND it2.id = mi_idx.info_type_id;
 18959  
 18960  `,
 18961  		ExpectedPlan: "Project\n" +
 18962  			" ├─ columns: [min(chn.name):0!null as character_name, min(mi_idx.info):1!null as rating, min(t.title):2!null as complete_hero_movie]\n" +
 18963  			" └─ GroupBy\n" +
 18964  			"     ├─ select: MIN(chn.name:22!null), MIN(mi_idx.info:15!null), MIN(t.title:1!null)\n" +
 18965  			"     ├─ group: \n" +
 18966  			"     └─ InnerJoin\n" +
 18967  			"         ├─ Eq\n" +
 18968  			"         │   ├─ n.id:27!null\n" +
 18969  			"         │   └─ ci.person_id:18!null\n" +
 18970  			"         ├─ InnerJoin\n" +
 18971  			"         │   ├─ AND\n" +
 18972  			"         │   │   ├─ AND\n" +
 18973  			"         │   │   │   ├─ AND\n" +
 18974  			"         │   │   │   │   ├─ Eq\n" +
 18975  			"         │   │   │   │   │   ├─ mk.movie_id:23!null\n" +
 18976  			"         │   │   │   │   │   └─ ci.movie_id:19!null\n" +
 18977  			"         │   │   │   │   └─ Eq\n" +
 18978  			"         │   │   │   │       ├─ mk.movie_id:23!null\n" +
 18979  			"         │   │   │   │       └─ cc.movie_id:8\n" +
 18980  			"         │   │   │   └─ Eq\n" +
 18981  			"         │   │   │       ├─ mk.movie_id:23!null\n" +
 18982  			"         │   │   │       └─ mi_idx.movie_id:13!null\n" +
 18983  			"         │   │   └─ Eq\n" +
 18984  			"         │   │       ├─ t.id:0!null\n" +
 18985  			"         │   │       └─ mk.movie_id:23!null\n" +
 18986  			"         │   ├─ InnerJoin\n" +
 18987  			"         │   │   ├─ Eq\n" +
 18988  			"         │   │   │   ├─ ci.movie_id:19!null\n" +
 18989  			"         │   │   │   └─ cc.movie_id:8\n" +
 18990  			"         │   │   ├─ InnerJoin\n" +
 18991  			"         │   │   │   ├─ Eq\n" +
 18992  			"         │   │   │   │   ├─ t.id:0!null\n" +
 18993  			"         │   │   │   │   └─ mi_idx.movie_id:13!null\n" +
 18994  			"         │   │   │   ├─ InnerJoin\n" +
 18995  			"         │   │   │   │   ├─ Eq\n" +
 18996  			"         │   │   │   │   │   ├─ kt.id:11!null\n" +
 18997  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 18998  			"         │   │   │   │   ├─ InnerJoin\n" +
 18999  			"         │   │   │   │   │   ├─ Eq\n" +
 19000  			"         │   │   │   │   │   │   ├─ t.id:0!null\n" +
 19001  			"         │   │   │   │   │   │   └─ cc.movie_id:8\n" +
 19002  			"         │   │   │   │   │   ├─ Filter\n" +
 19003  			"         │   │   │   │   │   │   ├─ GreaterThan\n" +
 19004  			"         │   │   │   │   │   │   │   ├─ t.production_year:3\n" +
 19005  			"         │   │   │   │   │   │   │   └─ 2000 (smallint)\n" +
 19006  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 19007  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 19008  			"         │   │   │   │   │   │           └─ Table\n" +
 19009  			"         │   │   │   │   │   │               ├─ name: title\n" +
 19010  			"         │   │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 19011  			"         │   │   │   │   │   └─ InnerJoin\n" +
 19012  			"         │   │   │   │   │       ├─ Eq\n" +
 19013  			"         │   │   │   │   │       │   ├─ cct2.id:4!null\n" +
 19014  			"         │   │   │   │   │       │   └─ cc.status_id:10!null\n" +
 19015  			"         │   │   │   │   │       ├─ Filter\n" +
 19016  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 19017  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 19018  			"         │   │   │   │   │       │       └─ ProcessTable\n" +
 19019  			"         │   │   │   │   │       │           └─ Table\n" +
 19020  			"         │   │   │   │   │       │               ├─ name: comp_cast_type\n" +
 19021  			"         │   │   │   │   │       │               └─ columns: [id kind]\n" +
 19022  			"         │   │   │   │   │       └─ InnerJoin\n" +
 19023  			"         │   │   │   │   │           ├─ Eq\n" +
 19024  			"         │   │   │   │   │           │   ├─ cct1.id:6!null\n" +
 19025  			"         │   │   │   │   │           │   └─ cc.subject_id:9!null\n" +
 19026  			"         │   │   │   │   │           ├─ Filter\n" +
 19027  			"         │   │   │   │   │           │   ├─ Eq\n" +
 19028  			"         │   │   │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 19029  			"         │   │   │   │   │           │   │   └─ cast (longtext)\n" +
 19030  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 19031  			"         │   │   │   │   │           │       └─ Table\n" +
 19032  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 19033  			"         │   │   │   │   │           │           ├─ columns: [id kind]\n" +
 19034  			"         │   │   │   │   │           │           ├─ colSet: (5,6)\n" +
 19035  			"         │   │   │   │   │           │           └─ tableId: 2\n" +
 19036  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 19037  			"         │   │   │   │   │               └─ ProcessTable\n" +
 19038  			"         │   │   │   │   │                   └─ Table\n" +
 19039  			"         │   │   │   │   │                       ├─ name: complete_cast\n" +
 19040  			"         │   │   │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 19041  			"         │   │   │   │   └─ Filter\n" +
 19042  			"         │   │   │   │       ├─ Eq\n" +
 19043  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 19044  			"         │   │   │   │       │   └─ movie (longtext)\n" +
 19045  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 19046  			"         │   │   │   │           └─ ProcessTable\n" +
 19047  			"         │   │   │   │               └─ Table\n" +
 19048  			"         │   │   │   │                   ├─ name: kind_type\n" +
 19049  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 19050  			"         │   │   │   └─ InnerJoin\n" +
 19051  			"         │   │   │       ├─ Eq\n" +
 19052  			"         │   │   │       │   ├─ it2.id:16!null\n" +
 19053  			"         │   │   │       │   └─ mi_idx.info_type_id:14!null\n" +
 19054  			"         │   │   │       ├─ TableAlias(mi_idx)\n" +
 19055  			"         │   │   │       │   └─ ProcessTable\n" +
 19056  			"         │   │   │       │       └─ Table\n" +
 19057  			"         │   │   │       │           ├─ name: movie_info_idx\n" +
 19058  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 19059  			"         │   │   │       └─ Filter\n" +
 19060  			"         │   │   │           ├─ Eq\n" +
 19061  			"         │   │   │           │   ├─ it2.info:1!null\n" +
 19062  			"         │   │   │           │   └─ rating (longtext)\n" +
 19063  			"         │   │   │           └─ TableAlias(it2)\n" +
 19064  			"         │   │   │               └─ ProcessTable\n" +
 19065  			"         │   │   │                   └─ Table\n" +
 19066  			"         │   │   │                       ├─ name: info_type\n" +
 19067  			"         │   │   │                       └─ columns: [id info]\n" +
 19068  			"         │   │   └─ InnerJoin\n" +
 19069  			"         │   │       ├─ Eq\n" +
 19070  			"         │   │       │   ├─ chn.id:21!null\n" +
 19071  			"         │   │       │   └─ ci.person_role_id:20\n" +
 19072  			"         │   │       ├─ TableAlias(ci)\n" +
 19073  			"         │   │       │   └─ ProcessTable\n" +
 19074  			"         │   │       │       └─ Table\n" +
 19075  			"         │   │       │           ├─ name: cast_info\n" +
 19076  			"         │   │       │           └─ columns: [person_id movie_id person_role_id]\n" +
 19077  			"         │   │       └─ Filter\n" +
 19078  			"         │   │           ├─ AND\n" +
 19079  			"         │   │           │   ├─ NOT\n" +
 19080  			"         │   │           │   │   └─ chn.name:1!null IS NULL\n" +
 19081  			"         │   │           │   └─ Or\n" +
 19082  			"         │   │           │       ├─ chn.name LIKE '%man%'\n" +
 19083  			"         │   │           │       └─ chn.name LIKE '%Man%'\n" +
 19084  			"         │   │           └─ TableAlias(chn)\n" +
 19085  			"         │   │               └─ ProcessTable\n" +
 19086  			"         │   │                   └─ Table\n" +
 19087  			"         │   │                       ├─ name: char_name\n" +
 19088  			"         │   │                       └─ columns: [id name]\n" +
 19089  			"         │   └─ InnerJoin\n" +
 19090  			"         │       ├─ Eq\n" +
 19091  			"         │       │   ├─ k.id:25!null\n" +
 19092  			"         │       │   └─ mk.keyword_id:24!null\n" +
 19093  			"         │       ├─ TableAlias(mk)\n" +
 19094  			"         │       │   └─ ProcessTable\n" +
 19095  			"         │       │       └─ Table\n" +
 19096  			"         │       │           ├─ name: movie_keyword\n" +
 19097  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 19098  			"         │       └─ Filter\n" +
 19099  			"         │           ├─ HashIn\n" +
 19100  			"         │           │   ├─ k.keyword:1!null\n" +
 19101  			"         │           │   └─ TUPLE(superhero (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext), magnet (longtext), web (longtext), claw (longtext), laser (longtext))\n" +
 19102  			"         │           └─ TableAlias(k)\n" +
 19103  			"         │               └─ ProcessTable\n" +
 19104  			"         │                   └─ Table\n" +
 19105  			"         │                       ├─ name: keyword\n" +
 19106  			"         │                       └─ columns: [id keyword]\n" +
 19107  			"         └─ TableAlias(n)\n" +
 19108  			"             └─ ProcessTable\n" +
 19109  			"                 └─ Table\n" +
 19110  			"                     ├─ name: name\n" +
 19111  			"                     └─ columns: [id]\n" +
 19112  			"",
 19113  		ExpectedEstimates: "Project\n" +
 19114  			" ├─ columns: [min(chn.name) as character_name, min(mi_idx.info) as rating, min(t.title) as complete_hero_movie]\n" +
 19115  			" └─ GroupBy\n" +
 19116  			"     ├─ SelectedExprs(MIN(chn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 19117  			"     ├─ Grouping()\n" +
 19118  			"     └─ InnerJoin\n" +
 19119  			"         ├─ (n.id = ci.person_id)\n" +
 19120  			"         ├─ InnerJoin\n" +
 19121  			"         │   ├─ ((((mk.movie_id = ci.movie_id) AND (mk.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 19122  			"         │   ├─ InnerJoin\n" +
 19123  			"         │   │   ├─ (ci.movie_id = cc.movie_id)\n" +
 19124  			"         │   │   ├─ InnerJoin\n" +
 19125  			"         │   │   │   ├─ (t.id = mi_idx.movie_id)\n" +
 19126  			"         │   │   │   ├─ InnerJoin\n" +
 19127  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 19128  			"         │   │   │   │   ├─ InnerJoin\n" +
 19129  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 19130  			"         │   │   │   │   │   ├─ Filter\n" +
 19131  			"         │   │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 19132  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 19133  			"         │   │   │   │   │   │       └─ Table\n" +
 19134  			"         │   │   │   │   │   │           ├─ name: title\n" +
 19135  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 19136  			"         │   │   │   │   │   └─ InnerJoin\n" +
 19137  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 19138  			"         │   │   │   │   │       ├─ Filter\n" +
 19139  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 19140  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 19141  			"         │   │   │   │   │       │       └─ Table\n" +
 19142  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 19143  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 19144  			"         │   │   │   │   │       └─ InnerJoin\n" +
 19145  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 19146  			"         │   │   │   │   │           ├─ Filter\n" +
 19147  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 19148  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 19149  			"         │   │   │   │   │           │       └─ Table\n" +
 19150  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 19151  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 19152  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 19153  			"         │   │   │   │   │               └─ Table\n" +
 19154  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 19155  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 19156  			"         │   │   │   │   └─ Filter\n" +
 19157  			"         │   │   │   │       ├─ (kt.kind = 'movie')\n" +
 19158  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 19159  			"         │   │   │   │           └─ Table\n" +
 19160  			"         │   │   │   │               ├─ name: kind_type\n" +
 19161  			"         │   │   │   │               └─ columns: [id kind]\n" +
 19162  			"         │   │   │   └─ InnerJoin\n" +
 19163  			"         │   │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 19164  			"         │   │   │       ├─ TableAlias(mi_idx)\n" +
 19165  			"         │   │   │       │   └─ Table\n" +
 19166  			"         │   │   │       │       ├─ name: movie_info_idx\n" +
 19167  			"         │   │   │       │       └─ columns: [movie_id info_type_id info]\n" +
 19168  			"         │   │   │       └─ Filter\n" +
 19169  			"         │   │   │           ├─ (it2.info = 'rating')\n" +
 19170  			"         │   │   │           └─ TableAlias(it2)\n" +
 19171  			"         │   │   │               └─ Table\n" +
 19172  			"         │   │   │                   ├─ name: info_type\n" +
 19173  			"         │   │   │                   └─ columns: [id info]\n" +
 19174  			"         │   │   └─ InnerJoin\n" +
 19175  			"         │   │       ├─ (chn.id = ci.person_role_id)\n" +
 19176  			"         │   │       ├─ TableAlias(ci)\n" +
 19177  			"         │   │       │   └─ Table\n" +
 19178  			"         │   │       │       ├─ name: cast_info\n" +
 19179  			"         │   │       │       └─ columns: [person_id movie_id person_role_id]\n" +
 19180  			"         │   │       └─ Filter\n" +
 19181  			"         │   │           ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 19182  			"         │   │           └─ TableAlias(chn)\n" +
 19183  			"         │   │               └─ Table\n" +
 19184  			"         │   │                   ├─ name: char_name\n" +
 19185  			"         │   │                   └─ columns: [id name]\n" +
 19186  			"         │   └─ InnerJoin\n" +
 19187  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 19188  			"         │       ├─ TableAlias(mk)\n" +
 19189  			"         │       │   └─ Table\n" +
 19190  			"         │       │       ├─ name: movie_keyword\n" +
 19191  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 19192  			"         │       └─ Filter\n" +
 19193  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence', 'magnet', 'web', 'claw', 'laser'))\n" +
 19194  			"         │           └─ TableAlias(k)\n" +
 19195  			"         │               └─ Table\n" +
 19196  			"         │                   ├─ name: keyword\n" +
 19197  			"         │                   └─ columns: [id keyword]\n" +
 19198  			"         └─ TableAlias(n)\n" +
 19199  			"             └─ Table\n" +
 19200  			"                 ├─ name: name\n" +
 19201  			"                 └─ columns: [id]\n" +
 19202  			"",
 19203  		ExpectedAnalysis: "Project\n" +
 19204  			" ├─ columns: [min(chn.name) as character_name, min(mi_idx.info) as rating, min(t.title) as complete_hero_movie]\n" +
 19205  			" └─ GroupBy\n" +
 19206  			"     ├─ SelectedExprs(MIN(chn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 19207  			"     ├─ Grouping()\n" +
 19208  			"     └─ InnerJoin\n" +
 19209  			"         ├─ (n.id = ci.person_id)\n" +
 19210  			"         ├─ InnerJoin\n" +
 19211  			"         │   ├─ ((((mk.movie_id = ci.movie_id) AND (mk.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 19212  			"         │   ├─ InnerJoin\n" +
 19213  			"         │   │   ├─ (ci.movie_id = cc.movie_id)\n" +
 19214  			"         │   │   ├─ InnerJoin\n" +
 19215  			"         │   │   │   ├─ (t.id = mi_idx.movie_id)\n" +
 19216  			"         │   │   │   ├─ InnerJoin\n" +
 19217  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 19218  			"         │   │   │   │   ├─ InnerJoin\n" +
 19219  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 19220  			"         │   │   │   │   │   ├─ Filter\n" +
 19221  			"         │   │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 19222  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 19223  			"         │   │   │   │   │   │       └─ Table\n" +
 19224  			"         │   │   │   │   │   │           ├─ name: title\n" +
 19225  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 19226  			"         │   │   │   │   │   └─ InnerJoin\n" +
 19227  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 19228  			"         │   │   │   │   │       ├─ Filter\n" +
 19229  			"         │   │   │   │   │       │   ├─ cct2.kind LIKE '%complete%'\n" +
 19230  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 19231  			"         │   │   │   │   │       │       └─ Table\n" +
 19232  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 19233  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 19234  			"         │   │   │   │   │       └─ InnerJoin\n" +
 19235  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 19236  			"         │   │   │   │   │           ├─ Filter\n" +
 19237  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 19238  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 19239  			"         │   │   │   │   │           │       └─ Table\n" +
 19240  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 19241  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 19242  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 19243  			"         │   │   │   │   │               └─ Table\n" +
 19244  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 19245  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 19246  			"         │   │   │   │   └─ Filter\n" +
 19247  			"         │   │   │   │       ├─ (kt.kind = 'movie')\n" +
 19248  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 19249  			"         │   │   │   │           └─ Table\n" +
 19250  			"         │   │   │   │               ├─ name: kind_type\n" +
 19251  			"         │   │   │   │               └─ columns: [id kind]\n" +
 19252  			"         │   │   │   └─ InnerJoin\n" +
 19253  			"         │   │   │       ├─ (it2.id = mi_idx.info_type_id)\n" +
 19254  			"         │   │   │       ├─ TableAlias(mi_idx)\n" +
 19255  			"         │   │   │       │   └─ Table\n" +
 19256  			"         │   │   │       │       ├─ name: movie_info_idx\n" +
 19257  			"         │   │   │       │       └─ columns: [movie_id info_type_id info]\n" +
 19258  			"         │   │   │       └─ Filter\n" +
 19259  			"         │   │   │           ├─ (it2.info = 'rating')\n" +
 19260  			"         │   │   │           └─ TableAlias(it2)\n" +
 19261  			"         │   │   │               └─ Table\n" +
 19262  			"         │   │   │                   ├─ name: info_type\n" +
 19263  			"         │   │   │                   └─ columns: [id info]\n" +
 19264  			"         │   │   └─ InnerJoin\n" +
 19265  			"         │   │       ├─ (chn.id = ci.person_role_id)\n" +
 19266  			"         │   │       ├─ TableAlias(ci)\n" +
 19267  			"         │   │       │   └─ Table\n" +
 19268  			"         │   │       │       ├─ name: cast_info\n" +
 19269  			"         │   │       │       └─ columns: [person_id movie_id person_role_id]\n" +
 19270  			"         │   │       └─ Filter\n" +
 19271  			"         │   │           ├─ ((NOT(chn.name IS NULL)) AND (chn.name LIKE '%man%' OR chn.name LIKE '%Man%'))\n" +
 19272  			"         │   │           └─ TableAlias(chn)\n" +
 19273  			"         │   │               └─ Table\n" +
 19274  			"         │   │                   ├─ name: char_name\n" +
 19275  			"         │   │                   └─ columns: [id name]\n" +
 19276  			"         │   └─ InnerJoin\n" +
 19277  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 19278  			"         │       ├─ TableAlias(mk)\n" +
 19279  			"         │       │   └─ Table\n" +
 19280  			"         │       │       ├─ name: movie_keyword\n" +
 19281  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 19282  			"         │       └─ Filter\n" +
 19283  			"         │           ├─ (k.keyword HASH IN ('superhero', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence', 'magnet', 'web', 'claw', 'laser'))\n" +
 19284  			"         │           └─ TableAlias(k)\n" +
 19285  			"         │               └─ Table\n" +
 19286  			"         │                   ├─ name: keyword\n" +
 19287  			"         │                   └─ columns: [id keyword]\n" +
 19288  			"         └─ TableAlias(n)\n" +
 19289  			"             └─ Table\n" +
 19290  			"                 ├─ name: name\n" +
 19291  			"                 └─ columns: [id]\n" +
 19292  			"",
 19293  	},
 19294  	{
 19295  		Query: `
 19296  SELECT MIN(cn.name) AS producing_company,
 19297         MIN(lt.link) AS link_type,
 19298         MIN(t.title) AS complete_western_sequel
 19299  FROM complete_cast AS cc,
 19300       comp_cast_type AS cct1,
 19301       comp_cast_type AS cct2,
 19302       company_name AS cn,
 19303       company_type AS ct,
 19304       keyword AS k,
 19305       link_type AS lt,
 19306       movie_companies AS mc,
 19307       movie_info AS mi,
 19308       movie_keyword AS mk,
 19309       movie_link AS ml,
 19310       title AS t
 19311  WHERE cct1.kind IN ('cast',
 19312                      'crew')
 19313    AND cct2.kind = 'complete'
 19314    AND cn.country_code !='[pl]'
 19315    AND (cn.name LIKE '%Film%'
 19316         OR cn.name LIKE '%Warner%')
 19317    AND ct.kind ='production companies'
 19318    AND k.keyword ='sequel'
 19319    AND lt.link LIKE '%follow%'
 19320    AND mc.note IS NULL
 19321    AND mi.info IN ('Sweden',
 19322                    'Germany',
 19323                    'Swedish',
 19324                    'German')
 19325    AND t.production_year BETWEEN 1950 AND 2000
 19326    AND lt.id = ml.link_type_id
 19327    AND ml.movie_id = t.id
 19328    AND t.id = mk.movie_id
 19329    AND mk.keyword_id = k.id
 19330    AND t.id = mc.movie_id
 19331    AND mc.company_type_id = ct.id
 19332    AND mc.company_id = cn.id
 19333    AND mi.movie_id = t.id
 19334    AND t.id = cc.movie_id
 19335    AND cct1.id = cc.subject_id
 19336    AND cct2.id = cc.status_id
 19337    AND ml.movie_id = mk.movie_id
 19338    AND ml.movie_id = mc.movie_id
 19339    AND mk.movie_id = mc.movie_id
 19340    AND ml.movie_id = mi.movie_id
 19341    AND mk.movie_id = mi.movie_id
 19342    AND mc.movie_id = mi.movie_id
 19343    AND ml.movie_id = cc.movie_id
 19344    AND mk.movie_id = cc.movie_id
 19345    AND mc.movie_id = cc.movie_id
 19346    AND mi.movie_id = cc.movie_id;
 19347  
 19348  `,
 19349  		ExpectedPlan: "Project\n" +
 19350  			" ├─ columns: [min(cn.name):0!null as producing_company, min(lt.link):1!null as link_type, min(t.title):2!null as complete_western_sequel]\n" +
 19351  			" └─ GroupBy\n" +
 19352  			"     ├─ select: MIN(cn.name:11!null), MIN(lt.link:5!null), MIN(t.title:27!null)\n" +
 19353  			"     ├─ group: \n" +
 19354  			"     └─ HashJoin\n" +
 19355  			"         ├─ AND\n" +
 19356  			"         │   ├─ AND\n" +
 19357  			"         │   │   ├─ AND\n" +
 19358  			"         │   │   │   ├─ AND\n" +
 19359  			"         │   │   │   │   ├─ Eq\n" +
 19360  			"         │   │   │   │   │   ├─ ml.movie_id:13!null\n" +
 19361  			"         │   │   │   │   │   └─ t.id:26!null\n" +
 19362  			"         │   │   │   │   └─ Eq\n" +
 19363  			"         │   │   │   │       ├─ t.id:26!null\n" +
 19364  			"         │   │   │   │       └─ mk.movie_id:15!null\n" +
 19365  			"         │   │   │   └─ Eq\n" +
 19366  			"         │   │   │       ├─ t.id:26!null\n" +
 19367  			"         │   │   │       └─ mc.movie_id:19!null\n" +
 19368  			"         │   │   └─ Eq\n" +
 19369  			"         │   │       ├─ mi.movie_id:17!null\n" +
 19370  			"         │   │       └─ t.id:26!null\n" +
 19371  			"         │   └─ Eq\n" +
 19372  			"         │       ├─ t.id:26!null\n" +
 19373  			"         │       └─ cc.movie_id:23\n" +
 19374  			"         ├─ HashJoin\n" +
 19375  			"         │   ├─ Eq\n" +
 19376  			"         │   │   ├─ cct1.id:0!null\n" +
 19377  			"         │   │   └─ cc.subject_id:24!null\n" +
 19378  			"         │   ├─ Filter\n" +
 19379  			"         │   │   ├─ HashIn\n" +
 19380  			"         │   │   │   ├─ cct1.kind:1!null\n" +
 19381  			"         │   │   │   └─ TUPLE(cast (longtext), crew (longtext))\n" +
 19382  			"         │   │   └─ TableAlias(cct1)\n" +
 19383  			"         │   │       └─ ProcessTable\n" +
 19384  			"         │   │           └─ Table\n" +
 19385  			"         │   │               ├─ name: comp_cast_type\n" +
 19386  			"         │   │               └─ columns: [id kind]\n" +
 19387  			"         │   └─ HashLookup\n" +
 19388  			"         │       ├─ left-key: TUPLE(cct1.id:0!null)\n" +
 19389  			"         │       ├─ right-key: TUPLE(cc.subject_id:22!null)\n" +
 19390  			"         │       └─ HashJoin\n" +
 19391  			"         │           ├─ Eq\n" +
 19392  			"         │           │   ├─ cct2.id:2!null\n" +
 19393  			"         │           │   └─ cc.status_id:25!null\n" +
 19394  			"         │           ├─ Filter\n" +
 19395  			"         │           │   ├─ Eq\n" +
 19396  			"         │           │   │   ├─ cct2.kind:1!null\n" +
 19397  			"         │           │   │   └─ complete (longtext)\n" +
 19398  			"         │           │   └─ TableAlias(cct2)\n" +
 19399  			"         │           │       └─ Table\n" +
 19400  			"         │           │           ├─ name: comp_cast_type\n" +
 19401  			"         │           │           ├─ columns: [id kind]\n" +
 19402  			"         │           │           ├─ colSet: (7,8)\n" +
 19403  			"         │           │           └─ tableId: 3\n" +
 19404  			"         │           └─ HashLookup\n" +
 19405  			"         │               ├─ left-key: TUPLE(cct2.id:2!null)\n" +
 19406  			"         │               ├─ right-key: TUPLE(cc.status_id:21!null)\n" +
 19407  			"         │               └─ HashJoin\n" +
 19408  			"         │                   ├─ Eq\n" +
 19409  			"         │                   │   ├─ lt.id:4!null\n" +
 19410  			"         │                   │   └─ ml.link_type_id:14!null\n" +
 19411  			"         │                   ├─ Filter\n" +
 19412  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 19413  			"         │                   │   └─ TableAlias(lt)\n" +
 19414  			"         │                   │       └─ ProcessTable\n" +
 19415  			"         │                   │           └─ Table\n" +
 19416  			"         │                   │               ├─ name: link_type\n" +
 19417  			"         │                   │               └─ columns: [id link]\n" +
 19418  			"         │                   └─ HashLookup\n" +
 19419  			"         │                       ├─ left-key: TUPLE(lt.id:4!null)\n" +
 19420  			"         │                       ├─ right-key: TUPLE(ml.link_type_id:8!null)\n" +
 19421  			"         │                       └─ HashJoin\n" +
 19422  			"         │                           ├─ Eq\n" +
 19423  			"         │                           │   ├─ mk.keyword_id:16!null\n" +
 19424  			"         │                           │   └─ k.id:6!null\n" +
 19425  			"         │                           ├─ Filter\n" +
 19426  			"         │                           │   ├─ Eq\n" +
 19427  			"         │                           │   │   ├─ k.keyword:1!null\n" +
 19428  			"         │                           │   │   └─ sequel (longtext)\n" +
 19429  			"         │                           │   └─ TableAlias(k)\n" +
 19430  			"         │                           │       └─ ProcessTable\n" +
 19431  			"         │                           │           └─ Table\n" +
 19432  			"         │                           │               ├─ name: keyword\n" +
 19433  			"         │                           │               └─ columns: [id keyword]\n" +
 19434  			"         │                           └─ HashLookup\n" +
 19435  			"         │                               ├─ left-key: TUPLE(k.id:6!null)\n" +
 19436  			"         │                               ├─ right-key: TUPLE(mk.keyword_id:8!null)\n" +
 19437  			"         │                               └─ HashJoin\n" +
 19438  			"         │                                   ├─ Eq\n" +
 19439  			"         │                                   │   ├─ mc.company_type_id:21!null\n" +
 19440  			"         │                                   │   └─ ct.id:8!null\n" +
 19441  			"         │                                   ├─ Filter\n" +
 19442  			"         │                                   │   ├─ Eq\n" +
 19443  			"         │                                   │   │   ├─ ct.kind:1!null\n" +
 19444  			"         │                                   │   │   └─ production companies (longtext)\n" +
 19445  			"         │                                   │   └─ TableAlias(ct)\n" +
 19446  			"         │                                   │       └─ ProcessTable\n" +
 19447  			"         │                                   │           └─ Table\n" +
 19448  			"         │                                   │               ├─ name: company_type\n" +
 19449  			"         │                                   │               └─ columns: [id kind]\n" +
 19450  			"         │                                   └─ HashLookup\n" +
 19451  			"         │                                       ├─ left-key: TUPLE(ct.id:8!null)\n" +
 19452  			"         │                                       ├─ right-key: TUPLE(mc.company_type_id:11!null)\n" +
 19453  			"         │                                       └─ HashJoin\n" +
 19454  			"         │                                           ├─ Eq\n" +
 19455  			"         │                                           │   ├─ mc.company_id:20!null\n" +
 19456  			"         │                                           │   └─ cn.id:10!null\n" +
 19457  			"         │                                           ├─ Filter\n" +
 19458  			"         │                                           │   ├─ AND\n" +
 19459  			"         │                                           │   │   ├─ NOT\n" +
 19460  			"         │                                           │   │   │   └─ Eq\n" +
 19461  			"         │                                           │   │   │       ├─ cn.country_code:2\n" +
 19462  			"         │                                           │   │   │       └─ [pl] (longtext)\n" +
 19463  			"         │                                           │   │   └─ Or\n" +
 19464  			"         │                                           │   │       ├─ cn.name LIKE '%Film%'\n" +
 19465  			"         │                                           │   │       └─ cn.name LIKE '%Warner%'\n" +
 19466  			"         │                                           │   └─ TableAlias(cn)\n" +
 19467  			"         │                                           │       └─ ProcessTable\n" +
 19468  			"         │                                           │           └─ Table\n" +
 19469  			"         │                                           │               ├─ name: company_name\n" +
 19470  			"         │                                           │               └─ columns: [id name country_code]\n" +
 19471  			"         │                                           └─ HashLookup\n" +
 19472  			"         │                                               ├─ left-key: TUPLE(cn.id:10!null)\n" +
 19473  			"         │                                               ├─ right-key: TUPLE(mc.company_id:7!null)\n" +
 19474  			"         │                                               └─ LookupJoin\n" +
 19475  			"         │                                                   ├─ InnerJoin\n" +
 19476  			"         │                                                   │   ├─ Eq\n" +
 19477  			"         │                                                   │   │   ├─ ml.movie_id:13!null\n" +
 19478  			"         │                                                   │   │   └─ mk.movie_id:15!null\n" +
 19479  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 19480  			"         │                                                   │   │   └─ ProcessTable\n" +
 19481  			"         │                                                   │   │       └─ Table\n" +
 19482  			"         │                                                   │   │           ├─ name: movie_link\n" +
 19483  			"         │                                                   │   │           └─ columns: [movie_id link_type_id]\n" +
 19484  			"         │                                                   │   └─ LookupJoin\n" +
 19485  			"         │                                                   │       ├─ InnerJoin\n" +
 19486  			"         │                                                   │       │   ├─ Eq\n" +
 19487  			"         │                                                   │       │   │   ├─ mk.movie_id:15!null\n" +
 19488  			"         │                                                   │       │   │   └─ mi.movie_id:17!null\n" +
 19489  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 19490  			"         │                                                   │       │   │   └─ ProcessTable\n" +
 19491  			"         │                                                   │       │   │       └─ Table\n" +
 19492  			"         │                                                   │       │   │           ├─ name: movie_keyword\n" +
 19493  			"         │                                                   │       │   │           └─ columns: [movie_id keyword_id]\n" +
 19494  			"         │                                                   │       │   └─ Filter\n" +
 19495  			"         │                                                   │       │       ├─ HashIn\n" +
 19496  			"         │                                                   │       │       │   ├─ mi.info:1!null\n" +
 19497  			"         │                                                   │       │       │   └─ TUPLE(Sweden (longtext), Germany (longtext), Swedish (longtext), German (longtext))\n" +
 19498  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 19499  			"         │                                                   │       │           └─ ProcessTable\n" +
 19500  			"         │                                                   │       │               └─ Table\n" +
 19501  			"         │                                                   │       │                   ├─ name: movie_info\n" +
 19502  			"         │                                                   │       │                   └─ columns: [movie_id info]\n" +
 19503  			"         │                                                   │       └─ Filter\n" +
 19504  			"         │                                                   │           ├─ mc.note:3 IS NULL\n" +
 19505  			"         │                                                   │           └─ TableAlias(mc)\n" +
 19506  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 19507  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 19508  			"         │                                                   │                   ├─ keys: [mi.movie_id:17!null]\n" +
 19509  			"         │                                                   │                   ├─ colSet: (23-27)\n" +
 19510  			"         │                                                   │                   ├─ tableId: 8\n" +
 19511  			"         │                                                   │                   └─ Table\n" +
 19512  			"         │                                                   │                       ├─ name: movie_companies\n" +
 19513  			"         │                                                   │                       └─ columns: [movie_id company_id company_type_id note]\n" +
 19514  			"         │                                                   └─ TableAlias(cc)\n" +
 19515  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 19516  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 19517  			"         │                                                           ├─ keys: [mc.movie_id:19!null]\n" +
 19518  			"         │                                                           ├─ colSet: (1-4)\n" +
 19519  			"         │                                                           ├─ tableId: 1\n" +
 19520  			"         │                                                           └─ Table\n" +
 19521  			"         │                                                               ├─ name: complete_cast\n" +
 19522  			"         │                                                               └─ columns: [movie_id subject_id status_id]\n" +
 19523  			"         └─ HashLookup\n" +
 19524  			"             ├─ left-key: TUPLE(ml.movie_id:13!null, mk.movie_id:15!null, mc.movie_id:19!null, mi.movie_id:17!null, cc.movie_id:23)\n" +
 19525  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 19526  			"             └─ Filter\n" +
 19527  			"                 ├─ AND\n" +
 19528  			"                 │   ├─ GreaterThanOrEqual\n" +
 19529  			"                 │   │   ├─ t.production_year:2\n" +
 19530  			"                 │   │   └─ 1950 (smallint)\n" +
 19531  			"                 │   └─ LessThanOrEqual\n" +
 19532  			"                 │       ├─ t.production_year:2\n" +
 19533  			"                 │       └─ 2000 (smallint)\n" +
 19534  			"                 └─ TableAlias(t)\n" +
 19535  			"                     └─ ProcessTable\n" +
 19536  			"                         └─ Table\n" +
 19537  			"                             ├─ name: title\n" +
 19538  			"                             └─ columns: [id title production_year]\n" +
 19539  			"",
 19540  		ExpectedEstimates: "Project\n" +
 19541  			" ├─ columns: [min(cn.name) as producing_company, min(lt.link) as link_type, min(t.title) as complete_western_sequel]\n" +
 19542  			" └─ GroupBy\n" +
 19543  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 19544  			"     ├─ Grouping()\n" +
 19545  			"     └─ HashJoin\n" +
 19546  			"         ├─ (((((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id)) AND (mi.movie_id = t.id)) AND (t.id = cc.movie_id))\n" +
 19547  			"         ├─ HashJoin\n" +
 19548  			"         │   ├─ (cct1.id = cc.subject_id)\n" +
 19549  			"         │   ├─ Filter\n" +
 19550  			"         │   │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 19551  			"         │   │   └─ TableAlias(cct1)\n" +
 19552  			"         │   │       └─ Table\n" +
 19553  			"         │   │           ├─ name: comp_cast_type\n" +
 19554  			"         │   │           └─ columns: [id kind]\n" +
 19555  			"         │   └─ HashLookup\n" +
 19556  			"         │       ├─ left-key: (cct1.id)\n" +
 19557  			"         │       ├─ right-key: (cc.subject_id)\n" +
 19558  			"         │       └─ HashJoin\n" +
 19559  			"         │           ├─ (cct2.id = cc.status_id)\n" +
 19560  			"         │           ├─ Filter\n" +
 19561  			"         │           │   ├─ (cct2.kind = 'complete')\n" +
 19562  			"         │           │   └─ TableAlias(cct2)\n" +
 19563  			"         │           │       └─ Table\n" +
 19564  			"         │           │           ├─ name: comp_cast_type\n" +
 19565  			"         │           │           └─ columns: [id kind]\n" +
 19566  			"         │           └─ HashLookup\n" +
 19567  			"         │               ├─ left-key: (cct2.id)\n" +
 19568  			"         │               ├─ right-key: (cc.status_id)\n" +
 19569  			"         │               └─ HashJoin\n" +
 19570  			"         │                   ├─ (lt.id = ml.link_type_id)\n" +
 19571  			"         │                   ├─ Filter\n" +
 19572  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 19573  			"         │                   │   └─ TableAlias(lt)\n" +
 19574  			"         │                   │       └─ Table\n" +
 19575  			"         │                   │           ├─ name: link_type\n" +
 19576  			"         │                   │           └─ columns: [id link]\n" +
 19577  			"         │                   └─ HashLookup\n" +
 19578  			"         │                       ├─ left-key: (lt.id)\n" +
 19579  			"         │                       ├─ right-key: (ml.link_type_id)\n" +
 19580  			"         │                       └─ HashJoin\n" +
 19581  			"         │                           ├─ (mk.keyword_id = k.id)\n" +
 19582  			"         │                           ├─ Filter\n" +
 19583  			"         │                           │   ├─ (k.keyword = 'sequel')\n" +
 19584  			"         │                           │   └─ TableAlias(k)\n" +
 19585  			"         │                           │       └─ Table\n" +
 19586  			"         │                           │           ├─ name: keyword\n" +
 19587  			"         │                           │           └─ columns: [id keyword]\n" +
 19588  			"         │                           └─ HashLookup\n" +
 19589  			"         │                               ├─ left-key: (k.id)\n" +
 19590  			"         │                               ├─ right-key: (mk.keyword_id)\n" +
 19591  			"         │                               └─ HashJoin\n" +
 19592  			"         │                                   ├─ (mc.company_type_id = ct.id)\n" +
 19593  			"         │                                   ├─ Filter\n" +
 19594  			"         │                                   │   ├─ (ct.kind = 'production companies')\n" +
 19595  			"         │                                   │   └─ TableAlias(ct)\n" +
 19596  			"         │                                   │       └─ Table\n" +
 19597  			"         │                                   │           ├─ name: company_type\n" +
 19598  			"         │                                   │           └─ columns: [id kind]\n" +
 19599  			"         │                                   └─ HashLookup\n" +
 19600  			"         │                                       ├─ left-key: (ct.id)\n" +
 19601  			"         │                                       ├─ right-key: (mc.company_type_id)\n" +
 19602  			"         │                                       └─ HashJoin\n" +
 19603  			"         │                                           ├─ (mc.company_id = cn.id)\n" +
 19604  			"         │                                           ├─ Filter\n" +
 19605  			"         │                                           │   ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 19606  			"         │                                           │   └─ TableAlias(cn)\n" +
 19607  			"         │                                           │       └─ Table\n" +
 19608  			"         │                                           │           ├─ name: company_name\n" +
 19609  			"         │                                           │           └─ columns: [id name country_code]\n" +
 19610  			"         │                                           └─ HashLookup\n" +
 19611  			"         │                                               ├─ left-key: (cn.id)\n" +
 19612  			"         │                                               ├─ right-key: (mc.company_id)\n" +
 19613  			"         │                                               └─ LookupJoin\n" +
 19614  			"         │                                                   ├─ InnerJoin\n" +
 19615  			"         │                                                   │   ├─ (ml.movie_id = mk.movie_id)\n" +
 19616  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 19617  			"         │                                                   │   │   └─ Table\n" +
 19618  			"         │                                                   │   │       ├─ name: movie_link\n" +
 19619  			"         │                                                   │   │       └─ columns: [movie_id link_type_id]\n" +
 19620  			"         │                                                   │   └─ LookupJoin\n" +
 19621  			"         │                                                   │       ├─ InnerJoin\n" +
 19622  			"         │                                                   │       │   ├─ (mk.movie_id = mi.movie_id)\n" +
 19623  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 19624  			"         │                                                   │       │   │   └─ Table\n" +
 19625  			"         │                                                   │       │   │       ├─ name: movie_keyword\n" +
 19626  			"         │                                                   │       │   │       └─ columns: [movie_id keyword_id]\n" +
 19627  			"         │                                                   │       │   └─ Filter\n" +
 19628  			"         │                                                   │       │       ├─ (mi.info HASH IN ('Sweden', 'Germany', 'Swedish', 'German'))\n" +
 19629  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 19630  			"         │                                                   │       │           └─ Table\n" +
 19631  			"         │                                                   │       │               ├─ name: movie_info\n" +
 19632  			"         │                                                   │       │               └─ columns: [movie_id info]\n" +
 19633  			"         │                                                   │       └─ Filter\n" +
 19634  			"         │                                                   │           ├─ mc.note IS NULL\n" +
 19635  			"         │                                                   │           └─ TableAlias(mc)\n" +
 19636  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 19637  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 19638  			"         │                                                   │                   ├─ columns: [movie_id company_id company_type_id note]\n" +
 19639  			"         │                                                   │                   └─ keys: mi.movie_id\n" +
 19640  			"         │                                                   └─ TableAlias(cc)\n" +
 19641  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 19642  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 19643  			"         │                                                           ├─ columns: [movie_id subject_id status_id]\n" +
 19644  			"         │                                                           └─ keys: mc.movie_id\n" +
 19645  			"         └─ HashLookup\n" +
 19646  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id, mi.movie_id, cc.movie_id)\n" +
 19647  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 19648  			"             └─ Filter\n" +
 19649  			"                 ├─ ((t.production_year >= 1950) AND (t.production_year <= 2000))\n" +
 19650  			"                 └─ TableAlias(t)\n" +
 19651  			"                     └─ Table\n" +
 19652  			"                         ├─ name: title\n" +
 19653  			"                         └─ columns: [id title production_year]\n" +
 19654  			"",
 19655  		ExpectedAnalysis: "Project\n" +
 19656  			" ├─ columns: [min(cn.name) as producing_company, min(lt.link) as link_type, min(t.title) as complete_western_sequel]\n" +
 19657  			" └─ GroupBy\n" +
 19658  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 19659  			"     ├─ Grouping()\n" +
 19660  			"     └─ HashJoin\n" +
 19661  			"         ├─ (((((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id)) AND (mi.movie_id = t.id)) AND (t.id = cc.movie_id))\n" +
 19662  			"         ├─ HashJoin\n" +
 19663  			"         │   ├─ (cct1.id = cc.subject_id)\n" +
 19664  			"         │   ├─ Filter\n" +
 19665  			"         │   │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 19666  			"         │   │   └─ TableAlias(cct1)\n" +
 19667  			"         │   │       └─ Table\n" +
 19668  			"         │   │           ├─ name: comp_cast_type\n" +
 19669  			"         │   │           └─ columns: [id kind]\n" +
 19670  			"         │   └─ HashLookup\n" +
 19671  			"         │       ├─ left-key: (cct1.id)\n" +
 19672  			"         │       ├─ right-key: (cc.subject_id)\n" +
 19673  			"         │       └─ HashJoin\n" +
 19674  			"         │           ├─ (cct2.id = cc.status_id)\n" +
 19675  			"         │           ├─ Filter\n" +
 19676  			"         │           │   ├─ (cct2.kind = 'complete')\n" +
 19677  			"         │           │   └─ TableAlias(cct2)\n" +
 19678  			"         │           │       └─ Table\n" +
 19679  			"         │           │           ├─ name: comp_cast_type\n" +
 19680  			"         │           │           └─ columns: [id kind]\n" +
 19681  			"         │           └─ HashLookup\n" +
 19682  			"         │               ├─ left-key: (cct2.id)\n" +
 19683  			"         │               ├─ right-key: (cc.status_id)\n" +
 19684  			"         │               └─ HashJoin\n" +
 19685  			"         │                   ├─ (lt.id = ml.link_type_id)\n" +
 19686  			"         │                   ├─ Filter\n" +
 19687  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 19688  			"         │                   │   └─ TableAlias(lt)\n" +
 19689  			"         │                   │       └─ Table\n" +
 19690  			"         │                   │           ├─ name: link_type\n" +
 19691  			"         │                   │           └─ columns: [id link]\n" +
 19692  			"         │                   └─ HashLookup\n" +
 19693  			"         │                       ├─ left-key: (lt.id)\n" +
 19694  			"         │                       ├─ right-key: (ml.link_type_id)\n" +
 19695  			"         │                       └─ HashJoin\n" +
 19696  			"         │                           ├─ (mk.keyword_id = k.id)\n" +
 19697  			"         │                           ├─ Filter\n" +
 19698  			"         │                           │   ├─ (k.keyword = 'sequel')\n" +
 19699  			"         │                           │   └─ TableAlias(k)\n" +
 19700  			"         │                           │       └─ Table\n" +
 19701  			"         │                           │           ├─ name: keyword\n" +
 19702  			"         │                           │           └─ columns: [id keyword]\n" +
 19703  			"         │                           └─ HashLookup\n" +
 19704  			"         │                               ├─ left-key: (k.id)\n" +
 19705  			"         │                               ├─ right-key: (mk.keyword_id)\n" +
 19706  			"         │                               └─ HashJoin\n" +
 19707  			"         │                                   ├─ (mc.company_type_id = ct.id)\n" +
 19708  			"         │                                   ├─ Filter\n" +
 19709  			"         │                                   │   ├─ (ct.kind = 'production companies')\n" +
 19710  			"         │                                   │   └─ TableAlias(ct)\n" +
 19711  			"         │                                   │       └─ Table\n" +
 19712  			"         │                                   │           ├─ name: company_type\n" +
 19713  			"         │                                   │           └─ columns: [id kind]\n" +
 19714  			"         │                                   └─ HashLookup\n" +
 19715  			"         │                                       ├─ left-key: (ct.id)\n" +
 19716  			"         │                                       ├─ right-key: (mc.company_type_id)\n" +
 19717  			"         │                                       └─ HashJoin\n" +
 19718  			"         │                                           ├─ (mc.company_id = cn.id)\n" +
 19719  			"         │                                           ├─ Filter\n" +
 19720  			"         │                                           │   ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 19721  			"         │                                           │   └─ TableAlias(cn)\n" +
 19722  			"         │                                           │       └─ Table\n" +
 19723  			"         │                                           │           ├─ name: company_name\n" +
 19724  			"         │                                           │           └─ columns: [id name country_code]\n" +
 19725  			"         │                                           └─ HashLookup\n" +
 19726  			"         │                                               ├─ left-key: (cn.id)\n" +
 19727  			"         │                                               ├─ right-key: (mc.company_id)\n" +
 19728  			"         │                                               └─ LookupJoin\n" +
 19729  			"         │                                                   ├─ InnerJoin\n" +
 19730  			"         │                                                   │   ├─ (ml.movie_id = mk.movie_id)\n" +
 19731  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 19732  			"         │                                                   │   │   └─ Table\n" +
 19733  			"         │                                                   │   │       ├─ name: movie_link\n" +
 19734  			"         │                                                   │   │       └─ columns: [movie_id link_type_id]\n" +
 19735  			"         │                                                   │   └─ LookupJoin\n" +
 19736  			"         │                                                   │       ├─ InnerJoin\n" +
 19737  			"         │                                                   │       │   ├─ (mk.movie_id = mi.movie_id)\n" +
 19738  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 19739  			"         │                                                   │       │   │   └─ Table\n" +
 19740  			"         │                                                   │       │   │       ├─ name: movie_keyword\n" +
 19741  			"         │                                                   │       │   │       └─ columns: [movie_id keyword_id]\n" +
 19742  			"         │                                                   │       │   └─ Filter\n" +
 19743  			"         │                                                   │       │       ├─ (mi.info HASH IN ('Sweden', 'Germany', 'Swedish', 'German'))\n" +
 19744  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 19745  			"         │                                                   │       │           └─ Table\n" +
 19746  			"         │                                                   │       │               ├─ name: movie_info\n" +
 19747  			"         │                                                   │       │               └─ columns: [movie_id info]\n" +
 19748  			"         │                                                   │       └─ Filter\n" +
 19749  			"         │                                                   │           ├─ mc.note IS NULL\n" +
 19750  			"         │                                                   │           └─ TableAlias(mc)\n" +
 19751  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 19752  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 19753  			"         │                                                   │                   ├─ columns: [movie_id company_id company_type_id note]\n" +
 19754  			"         │                                                   │                   └─ keys: mi.movie_id\n" +
 19755  			"         │                                                   └─ TableAlias(cc)\n" +
 19756  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 19757  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 19758  			"         │                                                           ├─ columns: [movie_id subject_id status_id]\n" +
 19759  			"         │                                                           └─ keys: mc.movie_id\n" +
 19760  			"         └─ HashLookup\n" +
 19761  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id, mi.movie_id, cc.movie_id)\n" +
 19762  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 19763  			"             └─ Filter\n" +
 19764  			"                 ├─ ((t.production_year >= 1950) AND (t.production_year <= 2000))\n" +
 19765  			"                 └─ TableAlias(t)\n" +
 19766  			"                     └─ Table\n" +
 19767  			"                         ├─ name: title\n" +
 19768  			"                         └─ columns: [id title production_year]\n" +
 19769  			"",
 19770  	},
 19771  	{
 19772  		Query: `
 19773  SELECT MIN(cn.name) AS producing_company,
 19774         MIN(lt.link) AS link_type,
 19775         MIN(t.title) AS complete_western_sequel
 19776  FROM complete_cast AS cc,
 19777       comp_cast_type AS cct1,
 19778       comp_cast_type AS cct2,
 19779       company_name AS cn,
 19780       company_type AS ct,
 19781       keyword AS k,
 19782       link_type AS lt,
 19783       movie_companies AS mc,
 19784       movie_info AS mi,
 19785       movie_keyword AS mk,
 19786       movie_link AS ml,
 19787       title AS t
 19788  WHERE cct1.kind IN ('cast',
 19789                      'crew')
 19790    AND cct2.kind = 'complete'
 19791    AND cn.country_code !='[pl]'
 19792    AND (cn.name LIKE '%Film%'
 19793         OR cn.name LIKE '%Warner%')
 19794    AND ct.kind ='production companies'
 19795    AND k.keyword ='sequel'
 19796    AND lt.link LIKE '%follow%'
 19797    AND mc.note IS NULL
 19798    AND mi.info IN ('Sweden',
 19799                    'Germany',
 19800                    'Swedish',
 19801                    'German')
 19802    AND t.production_year = 1998
 19803    AND lt.id = ml.link_type_id
 19804    AND ml.movie_id = t.id
 19805    AND t.id = mk.movie_id
 19806    AND mk.keyword_id = k.id
 19807    AND t.id = mc.movie_id
 19808    AND mc.company_type_id = ct.id
 19809    AND mc.company_id = cn.id
 19810    AND mi.movie_id = t.id
 19811    AND t.id = cc.movie_id
 19812    AND cct1.id = cc.subject_id
 19813    AND cct2.id = cc.status_id
 19814    AND ml.movie_id = mk.movie_id
 19815    AND ml.movie_id = mc.movie_id
 19816    AND mk.movie_id = mc.movie_id
 19817    AND ml.movie_id = mi.movie_id
 19818    AND mk.movie_id = mi.movie_id
 19819    AND mc.movie_id = mi.movie_id
 19820    AND ml.movie_id = cc.movie_id
 19821    AND mk.movie_id = cc.movie_id
 19822    AND mc.movie_id = cc.movie_id
 19823    AND mi.movie_id = cc.movie_id;
 19824  
 19825  `,
 19826  		ExpectedPlan: "Project\n" +
 19827  			" ├─ columns: [min(cn.name):0!null as producing_company, min(lt.link):1!null as link_type, min(t.title):2!null as complete_western_sequel]\n" +
 19828  			" └─ GroupBy\n" +
 19829  			"     ├─ select: MIN(cn.name:11!null), MIN(lt.link:5!null), MIN(t.title:27!null)\n" +
 19830  			"     ├─ group: \n" +
 19831  			"     └─ HashJoin\n" +
 19832  			"         ├─ AND\n" +
 19833  			"         │   ├─ AND\n" +
 19834  			"         │   │   ├─ AND\n" +
 19835  			"         │   │   │   ├─ AND\n" +
 19836  			"         │   │   │   │   ├─ Eq\n" +
 19837  			"         │   │   │   │   │   ├─ ml.movie_id:13!null\n" +
 19838  			"         │   │   │   │   │   └─ t.id:26!null\n" +
 19839  			"         │   │   │   │   └─ Eq\n" +
 19840  			"         │   │   │   │       ├─ t.id:26!null\n" +
 19841  			"         │   │   │   │       └─ mk.movie_id:15!null\n" +
 19842  			"         │   │   │   └─ Eq\n" +
 19843  			"         │   │   │       ├─ t.id:26!null\n" +
 19844  			"         │   │   │       └─ mc.movie_id:19!null\n" +
 19845  			"         │   │   └─ Eq\n" +
 19846  			"         │   │       ├─ mi.movie_id:17!null\n" +
 19847  			"         │   │       └─ t.id:26!null\n" +
 19848  			"         │   └─ Eq\n" +
 19849  			"         │       ├─ t.id:26!null\n" +
 19850  			"         │       └─ cc.movie_id:23\n" +
 19851  			"         ├─ HashJoin\n" +
 19852  			"         │   ├─ Eq\n" +
 19853  			"         │   │   ├─ cct1.id:0!null\n" +
 19854  			"         │   │   └─ cc.subject_id:24!null\n" +
 19855  			"         │   ├─ Filter\n" +
 19856  			"         │   │   ├─ HashIn\n" +
 19857  			"         │   │   │   ├─ cct1.kind:1!null\n" +
 19858  			"         │   │   │   └─ TUPLE(cast (longtext), crew (longtext))\n" +
 19859  			"         │   │   └─ TableAlias(cct1)\n" +
 19860  			"         │   │       └─ ProcessTable\n" +
 19861  			"         │   │           └─ Table\n" +
 19862  			"         │   │               ├─ name: comp_cast_type\n" +
 19863  			"         │   │               └─ columns: [id kind]\n" +
 19864  			"         │   └─ HashLookup\n" +
 19865  			"         │       ├─ left-key: TUPLE(cct1.id:0!null)\n" +
 19866  			"         │       ├─ right-key: TUPLE(cc.subject_id:22!null)\n" +
 19867  			"         │       └─ HashJoin\n" +
 19868  			"         │           ├─ Eq\n" +
 19869  			"         │           │   ├─ cct2.id:2!null\n" +
 19870  			"         │           │   └─ cc.status_id:25!null\n" +
 19871  			"         │           ├─ Filter\n" +
 19872  			"         │           │   ├─ Eq\n" +
 19873  			"         │           │   │   ├─ cct2.kind:1!null\n" +
 19874  			"         │           │   │   └─ complete (longtext)\n" +
 19875  			"         │           │   └─ TableAlias(cct2)\n" +
 19876  			"         │           │       └─ Table\n" +
 19877  			"         │           │           ├─ name: comp_cast_type\n" +
 19878  			"         │           │           ├─ columns: [id kind]\n" +
 19879  			"         │           │           ├─ colSet: (7,8)\n" +
 19880  			"         │           │           └─ tableId: 3\n" +
 19881  			"         │           └─ HashLookup\n" +
 19882  			"         │               ├─ left-key: TUPLE(cct2.id:2!null)\n" +
 19883  			"         │               ├─ right-key: TUPLE(cc.status_id:21!null)\n" +
 19884  			"         │               └─ HashJoin\n" +
 19885  			"         │                   ├─ Eq\n" +
 19886  			"         │                   │   ├─ lt.id:4!null\n" +
 19887  			"         │                   │   └─ ml.link_type_id:14!null\n" +
 19888  			"         │                   ├─ Filter\n" +
 19889  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 19890  			"         │                   │   └─ TableAlias(lt)\n" +
 19891  			"         │                   │       └─ ProcessTable\n" +
 19892  			"         │                   │           └─ Table\n" +
 19893  			"         │                   │               ├─ name: link_type\n" +
 19894  			"         │                   │               └─ columns: [id link]\n" +
 19895  			"         │                   └─ HashLookup\n" +
 19896  			"         │                       ├─ left-key: TUPLE(lt.id:4!null)\n" +
 19897  			"         │                       ├─ right-key: TUPLE(ml.link_type_id:8!null)\n" +
 19898  			"         │                       └─ HashJoin\n" +
 19899  			"         │                           ├─ Eq\n" +
 19900  			"         │                           │   ├─ mk.keyword_id:16!null\n" +
 19901  			"         │                           │   └─ k.id:6!null\n" +
 19902  			"         │                           ├─ Filter\n" +
 19903  			"         │                           │   ├─ Eq\n" +
 19904  			"         │                           │   │   ├─ k.keyword:1!null\n" +
 19905  			"         │                           │   │   └─ sequel (longtext)\n" +
 19906  			"         │                           │   └─ TableAlias(k)\n" +
 19907  			"         │                           │       └─ ProcessTable\n" +
 19908  			"         │                           │           └─ Table\n" +
 19909  			"         │                           │               ├─ name: keyword\n" +
 19910  			"         │                           │               └─ columns: [id keyword]\n" +
 19911  			"         │                           └─ HashLookup\n" +
 19912  			"         │                               ├─ left-key: TUPLE(k.id:6!null)\n" +
 19913  			"         │                               ├─ right-key: TUPLE(mk.keyword_id:8!null)\n" +
 19914  			"         │                               └─ HashJoin\n" +
 19915  			"         │                                   ├─ Eq\n" +
 19916  			"         │                                   │   ├─ mc.company_type_id:21!null\n" +
 19917  			"         │                                   │   └─ ct.id:8!null\n" +
 19918  			"         │                                   ├─ Filter\n" +
 19919  			"         │                                   │   ├─ Eq\n" +
 19920  			"         │                                   │   │   ├─ ct.kind:1!null\n" +
 19921  			"         │                                   │   │   └─ production companies (longtext)\n" +
 19922  			"         │                                   │   └─ TableAlias(ct)\n" +
 19923  			"         │                                   │       └─ ProcessTable\n" +
 19924  			"         │                                   │           └─ Table\n" +
 19925  			"         │                                   │               ├─ name: company_type\n" +
 19926  			"         │                                   │               └─ columns: [id kind]\n" +
 19927  			"         │                                   └─ HashLookup\n" +
 19928  			"         │                                       ├─ left-key: TUPLE(ct.id:8!null)\n" +
 19929  			"         │                                       ├─ right-key: TUPLE(mc.company_type_id:11!null)\n" +
 19930  			"         │                                       └─ HashJoin\n" +
 19931  			"         │                                           ├─ Eq\n" +
 19932  			"         │                                           │   ├─ mc.company_id:20!null\n" +
 19933  			"         │                                           │   └─ cn.id:10!null\n" +
 19934  			"         │                                           ├─ Filter\n" +
 19935  			"         │                                           │   ├─ AND\n" +
 19936  			"         │                                           │   │   ├─ NOT\n" +
 19937  			"         │                                           │   │   │   └─ Eq\n" +
 19938  			"         │                                           │   │   │       ├─ cn.country_code:2\n" +
 19939  			"         │                                           │   │   │       └─ [pl] (longtext)\n" +
 19940  			"         │                                           │   │   └─ Or\n" +
 19941  			"         │                                           │   │       ├─ cn.name LIKE '%Film%'\n" +
 19942  			"         │                                           │   │       └─ cn.name LIKE '%Warner%'\n" +
 19943  			"         │                                           │   └─ TableAlias(cn)\n" +
 19944  			"         │                                           │       └─ ProcessTable\n" +
 19945  			"         │                                           │           └─ Table\n" +
 19946  			"         │                                           │               ├─ name: company_name\n" +
 19947  			"         │                                           │               └─ columns: [id name country_code]\n" +
 19948  			"         │                                           └─ HashLookup\n" +
 19949  			"         │                                               ├─ left-key: TUPLE(cn.id:10!null)\n" +
 19950  			"         │                                               ├─ right-key: TUPLE(mc.company_id:7!null)\n" +
 19951  			"         │                                               └─ LookupJoin\n" +
 19952  			"         │                                                   ├─ InnerJoin\n" +
 19953  			"         │                                                   │   ├─ Eq\n" +
 19954  			"         │                                                   │   │   ├─ ml.movie_id:13!null\n" +
 19955  			"         │                                                   │   │   └─ mk.movie_id:15!null\n" +
 19956  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 19957  			"         │                                                   │   │   └─ ProcessTable\n" +
 19958  			"         │                                                   │   │       └─ Table\n" +
 19959  			"         │                                                   │   │           ├─ name: movie_link\n" +
 19960  			"         │                                                   │   │           └─ columns: [movie_id link_type_id]\n" +
 19961  			"         │                                                   │   └─ LookupJoin\n" +
 19962  			"         │                                                   │       ├─ InnerJoin\n" +
 19963  			"         │                                                   │       │   ├─ Eq\n" +
 19964  			"         │                                                   │       │   │   ├─ mk.movie_id:15!null\n" +
 19965  			"         │                                                   │       │   │   └─ mi.movie_id:17!null\n" +
 19966  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 19967  			"         │                                                   │       │   │   └─ ProcessTable\n" +
 19968  			"         │                                                   │       │   │       └─ Table\n" +
 19969  			"         │                                                   │       │   │           ├─ name: movie_keyword\n" +
 19970  			"         │                                                   │       │   │           └─ columns: [movie_id keyword_id]\n" +
 19971  			"         │                                                   │       │   └─ Filter\n" +
 19972  			"         │                                                   │       │       ├─ HashIn\n" +
 19973  			"         │                                                   │       │       │   ├─ mi.info:1!null\n" +
 19974  			"         │                                                   │       │       │   └─ TUPLE(Sweden (longtext), Germany (longtext), Swedish (longtext), German (longtext))\n" +
 19975  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 19976  			"         │                                                   │       │           └─ ProcessTable\n" +
 19977  			"         │                                                   │       │               └─ Table\n" +
 19978  			"         │                                                   │       │                   ├─ name: movie_info\n" +
 19979  			"         │                                                   │       │                   └─ columns: [movie_id info]\n" +
 19980  			"         │                                                   │       └─ Filter\n" +
 19981  			"         │                                                   │           ├─ mc.note:3 IS NULL\n" +
 19982  			"         │                                                   │           └─ TableAlias(mc)\n" +
 19983  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 19984  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 19985  			"         │                                                   │                   ├─ keys: [mi.movie_id:17!null]\n" +
 19986  			"         │                                                   │                   ├─ colSet: (23-27)\n" +
 19987  			"         │                                                   │                   ├─ tableId: 8\n" +
 19988  			"         │                                                   │                   └─ Table\n" +
 19989  			"         │                                                   │                       ├─ name: movie_companies\n" +
 19990  			"         │                                                   │                       └─ columns: [movie_id company_id company_type_id note]\n" +
 19991  			"         │                                                   └─ TableAlias(cc)\n" +
 19992  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 19993  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 19994  			"         │                                                           ├─ keys: [mc.movie_id:19!null]\n" +
 19995  			"         │                                                           ├─ colSet: (1-4)\n" +
 19996  			"         │                                                           ├─ tableId: 1\n" +
 19997  			"         │                                                           └─ Table\n" +
 19998  			"         │                                                               ├─ name: complete_cast\n" +
 19999  			"         │                                                               └─ columns: [movie_id subject_id status_id]\n" +
 20000  			"         └─ HashLookup\n" +
 20001  			"             ├─ left-key: TUPLE(ml.movie_id:13!null, mk.movie_id:15!null, mc.movie_id:19!null, mi.movie_id:17!null, cc.movie_id:23)\n" +
 20002  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 20003  			"             └─ Filter\n" +
 20004  			"                 ├─ Eq\n" +
 20005  			"                 │   ├─ t.production_year:2\n" +
 20006  			"                 │   └─ 1998 (smallint)\n" +
 20007  			"                 └─ TableAlias(t)\n" +
 20008  			"                     └─ ProcessTable\n" +
 20009  			"                         └─ Table\n" +
 20010  			"                             ├─ name: title\n" +
 20011  			"                             └─ columns: [id title production_year]\n" +
 20012  			"",
 20013  		ExpectedEstimates: "Project\n" +
 20014  			" ├─ columns: [min(cn.name) as producing_company, min(lt.link) as link_type, min(t.title) as complete_western_sequel]\n" +
 20015  			" └─ GroupBy\n" +
 20016  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 20017  			"     ├─ Grouping()\n" +
 20018  			"     └─ HashJoin\n" +
 20019  			"         ├─ (((((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id)) AND (mi.movie_id = t.id)) AND (t.id = cc.movie_id))\n" +
 20020  			"         ├─ HashJoin\n" +
 20021  			"         │   ├─ (cct1.id = cc.subject_id)\n" +
 20022  			"         │   ├─ Filter\n" +
 20023  			"         │   │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 20024  			"         │   │   └─ TableAlias(cct1)\n" +
 20025  			"         │   │       └─ Table\n" +
 20026  			"         │   │           ├─ name: comp_cast_type\n" +
 20027  			"         │   │           └─ columns: [id kind]\n" +
 20028  			"         │   └─ HashLookup\n" +
 20029  			"         │       ├─ left-key: (cct1.id)\n" +
 20030  			"         │       ├─ right-key: (cc.subject_id)\n" +
 20031  			"         │       └─ HashJoin\n" +
 20032  			"         │           ├─ (cct2.id = cc.status_id)\n" +
 20033  			"         │           ├─ Filter\n" +
 20034  			"         │           │   ├─ (cct2.kind = 'complete')\n" +
 20035  			"         │           │   └─ TableAlias(cct2)\n" +
 20036  			"         │           │       └─ Table\n" +
 20037  			"         │           │           ├─ name: comp_cast_type\n" +
 20038  			"         │           │           └─ columns: [id kind]\n" +
 20039  			"         │           └─ HashLookup\n" +
 20040  			"         │               ├─ left-key: (cct2.id)\n" +
 20041  			"         │               ├─ right-key: (cc.status_id)\n" +
 20042  			"         │               └─ HashJoin\n" +
 20043  			"         │                   ├─ (lt.id = ml.link_type_id)\n" +
 20044  			"         │                   ├─ Filter\n" +
 20045  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 20046  			"         │                   │   └─ TableAlias(lt)\n" +
 20047  			"         │                   │       └─ Table\n" +
 20048  			"         │                   │           ├─ name: link_type\n" +
 20049  			"         │                   │           └─ columns: [id link]\n" +
 20050  			"         │                   └─ HashLookup\n" +
 20051  			"         │                       ├─ left-key: (lt.id)\n" +
 20052  			"         │                       ├─ right-key: (ml.link_type_id)\n" +
 20053  			"         │                       └─ HashJoin\n" +
 20054  			"         │                           ├─ (mk.keyword_id = k.id)\n" +
 20055  			"         │                           ├─ Filter\n" +
 20056  			"         │                           │   ├─ (k.keyword = 'sequel')\n" +
 20057  			"         │                           │   └─ TableAlias(k)\n" +
 20058  			"         │                           │       └─ Table\n" +
 20059  			"         │                           │           ├─ name: keyword\n" +
 20060  			"         │                           │           └─ columns: [id keyword]\n" +
 20061  			"         │                           └─ HashLookup\n" +
 20062  			"         │                               ├─ left-key: (k.id)\n" +
 20063  			"         │                               ├─ right-key: (mk.keyword_id)\n" +
 20064  			"         │                               └─ HashJoin\n" +
 20065  			"         │                                   ├─ (mc.company_type_id = ct.id)\n" +
 20066  			"         │                                   ├─ Filter\n" +
 20067  			"         │                                   │   ├─ (ct.kind = 'production companies')\n" +
 20068  			"         │                                   │   └─ TableAlias(ct)\n" +
 20069  			"         │                                   │       └─ Table\n" +
 20070  			"         │                                   │           ├─ name: company_type\n" +
 20071  			"         │                                   │           └─ columns: [id kind]\n" +
 20072  			"         │                                   └─ HashLookup\n" +
 20073  			"         │                                       ├─ left-key: (ct.id)\n" +
 20074  			"         │                                       ├─ right-key: (mc.company_type_id)\n" +
 20075  			"         │                                       └─ HashJoin\n" +
 20076  			"         │                                           ├─ (mc.company_id = cn.id)\n" +
 20077  			"         │                                           ├─ Filter\n" +
 20078  			"         │                                           │   ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 20079  			"         │                                           │   └─ TableAlias(cn)\n" +
 20080  			"         │                                           │       └─ Table\n" +
 20081  			"         │                                           │           ├─ name: company_name\n" +
 20082  			"         │                                           │           └─ columns: [id name country_code]\n" +
 20083  			"         │                                           └─ HashLookup\n" +
 20084  			"         │                                               ├─ left-key: (cn.id)\n" +
 20085  			"         │                                               ├─ right-key: (mc.company_id)\n" +
 20086  			"         │                                               └─ LookupJoin\n" +
 20087  			"         │                                                   ├─ InnerJoin\n" +
 20088  			"         │                                                   │   ├─ (ml.movie_id = mk.movie_id)\n" +
 20089  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 20090  			"         │                                                   │   │   └─ Table\n" +
 20091  			"         │                                                   │   │       ├─ name: movie_link\n" +
 20092  			"         │                                                   │   │       └─ columns: [movie_id link_type_id]\n" +
 20093  			"         │                                                   │   └─ LookupJoin\n" +
 20094  			"         │                                                   │       ├─ InnerJoin\n" +
 20095  			"         │                                                   │       │   ├─ (mk.movie_id = mi.movie_id)\n" +
 20096  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 20097  			"         │                                                   │       │   │   └─ Table\n" +
 20098  			"         │                                                   │       │   │       ├─ name: movie_keyword\n" +
 20099  			"         │                                                   │       │   │       └─ columns: [movie_id keyword_id]\n" +
 20100  			"         │                                                   │       │   └─ Filter\n" +
 20101  			"         │                                                   │       │       ├─ (mi.info HASH IN ('Sweden', 'Germany', 'Swedish', 'German'))\n" +
 20102  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 20103  			"         │                                                   │       │           └─ Table\n" +
 20104  			"         │                                                   │       │               ├─ name: movie_info\n" +
 20105  			"         │                                                   │       │               └─ columns: [movie_id info]\n" +
 20106  			"         │                                                   │       └─ Filter\n" +
 20107  			"         │                                                   │           ├─ mc.note IS NULL\n" +
 20108  			"         │                                                   │           └─ TableAlias(mc)\n" +
 20109  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 20110  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 20111  			"         │                                                   │                   ├─ columns: [movie_id company_id company_type_id note]\n" +
 20112  			"         │                                                   │                   └─ keys: mi.movie_id\n" +
 20113  			"         │                                                   └─ TableAlias(cc)\n" +
 20114  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 20115  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 20116  			"         │                                                           ├─ columns: [movie_id subject_id status_id]\n" +
 20117  			"         │                                                           └─ keys: mc.movie_id\n" +
 20118  			"         └─ HashLookup\n" +
 20119  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id, mi.movie_id, cc.movie_id)\n" +
 20120  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 20121  			"             └─ Filter\n" +
 20122  			"                 ├─ (t.production_year = 1998)\n" +
 20123  			"                 └─ TableAlias(t)\n" +
 20124  			"                     └─ Table\n" +
 20125  			"                         ├─ name: title\n" +
 20126  			"                         └─ columns: [id title production_year]\n" +
 20127  			"",
 20128  		ExpectedAnalysis: "Project\n" +
 20129  			" ├─ columns: [min(cn.name) as producing_company, min(lt.link) as link_type, min(t.title) as complete_western_sequel]\n" +
 20130  			" └─ GroupBy\n" +
 20131  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 20132  			"     ├─ Grouping()\n" +
 20133  			"     └─ HashJoin\n" +
 20134  			"         ├─ (((((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id)) AND (mi.movie_id = t.id)) AND (t.id = cc.movie_id))\n" +
 20135  			"         ├─ HashJoin\n" +
 20136  			"         │   ├─ (cct1.id = cc.subject_id)\n" +
 20137  			"         │   ├─ Filter\n" +
 20138  			"         │   │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 20139  			"         │   │   └─ TableAlias(cct1)\n" +
 20140  			"         │   │       └─ Table\n" +
 20141  			"         │   │           ├─ name: comp_cast_type\n" +
 20142  			"         │   │           └─ columns: [id kind]\n" +
 20143  			"         │   └─ HashLookup\n" +
 20144  			"         │       ├─ left-key: (cct1.id)\n" +
 20145  			"         │       ├─ right-key: (cc.subject_id)\n" +
 20146  			"         │       └─ HashJoin\n" +
 20147  			"         │           ├─ (cct2.id = cc.status_id)\n" +
 20148  			"         │           ├─ Filter\n" +
 20149  			"         │           │   ├─ (cct2.kind = 'complete')\n" +
 20150  			"         │           │   └─ TableAlias(cct2)\n" +
 20151  			"         │           │       └─ Table\n" +
 20152  			"         │           │           ├─ name: comp_cast_type\n" +
 20153  			"         │           │           └─ columns: [id kind]\n" +
 20154  			"         │           └─ HashLookup\n" +
 20155  			"         │               ├─ left-key: (cct2.id)\n" +
 20156  			"         │               ├─ right-key: (cc.status_id)\n" +
 20157  			"         │               └─ HashJoin\n" +
 20158  			"         │                   ├─ (lt.id = ml.link_type_id)\n" +
 20159  			"         │                   ├─ Filter\n" +
 20160  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 20161  			"         │                   │   └─ TableAlias(lt)\n" +
 20162  			"         │                   │       └─ Table\n" +
 20163  			"         │                   │           ├─ name: link_type\n" +
 20164  			"         │                   │           └─ columns: [id link]\n" +
 20165  			"         │                   └─ HashLookup\n" +
 20166  			"         │                       ├─ left-key: (lt.id)\n" +
 20167  			"         │                       ├─ right-key: (ml.link_type_id)\n" +
 20168  			"         │                       └─ HashJoin\n" +
 20169  			"         │                           ├─ (mk.keyword_id = k.id)\n" +
 20170  			"         │                           ├─ Filter\n" +
 20171  			"         │                           │   ├─ (k.keyword = 'sequel')\n" +
 20172  			"         │                           │   └─ TableAlias(k)\n" +
 20173  			"         │                           │       └─ Table\n" +
 20174  			"         │                           │           ├─ name: keyword\n" +
 20175  			"         │                           │           └─ columns: [id keyword]\n" +
 20176  			"         │                           └─ HashLookup\n" +
 20177  			"         │                               ├─ left-key: (k.id)\n" +
 20178  			"         │                               ├─ right-key: (mk.keyword_id)\n" +
 20179  			"         │                               └─ HashJoin\n" +
 20180  			"         │                                   ├─ (mc.company_type_id = ct.id)\n" +
 20181  			"         │                                   ├─ Filter\n" +
 20182  			"         │                                   │   ├─ (ct.kind = 'production companies')\n" +
 20183  			"         │                                   │   └─ TableAlias(ct)\n" +
 20184  			"         │                                   │       └─ Table\n" +
 20185  			"         │                                   │           ├─ name: company_type\n" +
 20186  			"         │                                   │           └─ columns: [id kind]\n" +
 20187  			"         │                                   └─ HashLookup\n" +
 20188  			"         │                                       ├─ left-key: (ct.id)\n" +
 20189  			"         │                                       ├─ right-key: (mc.company_type_id)\n" +
 20190  			"         │                                       └─ HashJoin\n" +
 20191  			"         │                                           ├─ (mc.company_id = cn.id)\n" +
 20192  			"         │                                           ├─ Filter\n" +
 20193  			"         │                                           │   ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 20194  			"         │                                           │   └─ TableAlias(cn)\n" +
 20195  			"         │                                           │       └─ Table\n" +
 20196  			"         │                                           │           ├─ name: company_name\n" +
 20197  			"         │                                           │           └─ columns: [id name country_code]\n" +
 20198  			"         │                                           └─ HashLookup\n" +
 20199  			"         │                                               ├─ left-key: (cn.id)\n" +
 20200  			"         │                                               ├─ right-key: (mc.company_id)\n" +
 20201  			"         │                                               └─ LookupJoin\n" +
 20202  			"         │                                                   ├─ InnerJoin\n" +
 20203  			"         │                                                   │   ├─ (ml.movie_id = mk.movie_id)\n" +
 20204  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 20205  			"         │                                                   │   │   └─ Table\n" +
 20206  			"         │                                                   │   │       ├─ name: movie_link\n" +
 20207  			"         │                                                   │   │       └─ columns: [movie_id link_type_id]\n" +
 20208  			"         │                                                   │   └─ LookupJoin\n" +
 20209  			"         │                                                   │       ├─ InnerJoin\n" +
 20210  			"         │                                                   │       │   ├─ (mk.movie_id = mi.movie_id)\n" +
 20211  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 20212  			"         │                                                   │       │   │   └─ Table\n" +
 20213  			"         │                                                   │       │   │       ├─ name: movie_keyword\n" +
 20214  			"         │                                                   │       │   │       └─ columns: [movie_id keyword_id]\n" +
 20215  			"         │                                                   │       │   └─ Filter\n" +
 20216  			"         │                                                   │       │       ├─ (mi.info HASH IN ('Sweden', 'Germany', 'Swedish', 'German'))\n" +
 20217  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 20218  			"         │                                                   │       │           └─ Table\n" +
 20219  			"         │                                                   │       │               ├─ name: movie_info\n" +
 20220  			"         │                                                   │       │               └─ columns: [movie_id info]\n" +
 20221  			"         │                                                   │       └─ Filter\n" +
 20222  			"         │                                                   │           ├─ mc.note IS NULL\n" +
 20223  			"         │                                                   │           └─ TableAlias(mc)\n" +
 20224  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 20225  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 20226  			"         │                                                   │                   ├─ columns: [movie_id company_id company_type_id note]\n" +
 20227  			"         │                                                   │                   └─ keys: mi.movie_id\n" +
 20228  			"         │                                                   └─ TableAlias(cc)\n" +
 20229  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 20230  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 20231  			"         │                                                           ├─ columns: [movie_id subject_id status_id]\n" +
 20232  			"         │                                                           └─ keys: mc.movie_id\n" +
 20233  			"         └─ HashLookup\n" +
 20234  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id, mi.movie_id, cc.movie_id)\n" +
 20235  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 20236  			"             └─ Filter\n" +
 20237  			"                 ├─ (t.production_year = 1998)\n" +
 20238  			"                 └─ TableAlias(t)\n" +
 20239  			"                     └─ Table\n" +
 20240  			"                         ├─ name: title\n" +
 20241  			"                         └─ columns: [id title production_year]\n" +
 20242  			"",
 20243  	},
 20244  	{
 20245  		Query: `
 20246  SELECT MIN(cn.name) AS producing_company,
 20247         MIN(lt.link) AS link_type,
 20248         MIN(t.title) AS complete_western_sequel
 20249  FROM complete_cast AS cc,
 20250       comp_cast_type AS cct1,
 20251       comp_cast_type AS cct2,
 20252       company_name AS cn,
 20253       company_type AS ct,
 20254       keyword AS k,
 20255       link_type AS lt,
 20256       movie_companies AS mc,
 20257       movie_info AS mi,
 20258       movie_keyword AS mk,
 20259       movie_link AS ml,
 20260       title AS t
 20261  WHERE cct1.kind = 'cast'
 20262    AND cct2.kind LIKE 'complete%'
 20263    AND cn.country_code !='[pl]'
 20264    AND (cn.name LIKE '%Film%'
 20265         OR cn.name LIKE '%Warner%')
 20266    AND ct.kind ='production companies'
 20267    AND k.keyword ='sequel'
 20268    AND lt.link LIKE '%follow%'
 20269    AND mc.note IS NULL
 20270    AND mi.info IN ('Sweden',
 20271                    'Norway',
 20272                    'Germany',
 20273                    'Denmark',
 20274                    'Swedish',
 20275                    'Denish',
 20276                    'Norwegian',
 20277                    'German',
 20278                    'English')
 20279    AND t.production_year BETWEEN 1950 AND 2010
 20280    AND lt.id = ml.link_type_id
 20281    AND ml.movie_id = t.id
 20282    AND t.id = mk.movie_id
 20283    AND mk.keyword_id = k.id
 20284    AND t.id = mc.movie_id
 20285    AND mc.company_type_id = ct.id
 20286    AND mc.company_id = cn.id
 20287    AND mi.movie_id = t.id
 20288    AND t.id = cc.movie_id
 20289    AND cct1.id = cc.subject_id
 20290    AND cct2.id = cc.status_id
 20291    AND ml.movie_id = mk.movie_id
 20292    AND ml.movie_id = mc.movie_id
 20293    AND mk.movie_id = mc.movie_id
 20294    AND ml.movie_id = mi.movie_id
 20295    AND mk.movie_id = mi.movie_id
 20296    AND mc.movie_id = mi.movie_id
 20297    AND ml.movie_id = cc.movie_id
 20298    AND mk.movie_id = cc.movie_id
 20299    AND mc.movie_id = cc.movie_id
 20300    AND mi.movie_id = cc.movie_id;
 20301  
 20302  `,
 20303  		ExpectedPlan: "Project\n" +
 20304  			" ├─ columns: [min(cn.name):0!null as producing_company, min(lt.link):1!null as link_type, min(t.title):2!null as complete_western_sequel]\n" +
 20305  			" └─ GroupBy\n" +
 20306  			"     ├─ select: MIN(cn.name:11!null), MIN(lt.link:5!null), MIN(t.title:27!null)\n" +
 20307  			"     ├─ group: \n" +
 20308  			"     └─ HashJoin\n" +
 20309  			"         ├─ AND\n" +
 20310  			"         │   ├─ AND\n" +
 20311  			"         │   │   ├─ AND\n" +
 20312  			"         │   │   │   ├─ AND\n" +
 20313  			"         │   │   │   │   ├─ Eq\n" +
 20314  			"         │   │   │   │   │   ├─ ml.movie_id:13!null\n" +
 20315  			"         │   │   │   │   │   └─ t.id:26!null\n" +
 20316  			"         │   │   │   │   └─ Eq\n" +
 20317  			"         │   │   │   │       ├─ t.id:26!null\n" +
 20318  			"         │   │   │   │       └─ mk.movie_id:15!null\n" +
 20319  			"         │   │   │   └─ Eq\n" +
 20320  			"         │   │   │       ├─ t.id:26!null\n" +
 20321  			"         │   │   │       └─ mc.movie_id:19!null\n" +
 20322  			"         │   │   └─ Eq\n" +
 20323  			"         │   │       ├─ mi.movie_id:17!null\n" +
 20324  			"         │   │       └─ t.id:26!null\n" +
 20325  			"         │   └─ Eq\n" +
 20326  			"         │       ├─ t.id:26!null\n" +
 20327  			"         │       └─ cc.movie_id:23\n" +
 20328  			"         ├─ HashJoin\n" +
 20329  			"         │   ├─ Eq\n" +
 20330  			"         │   │   ├─ cct1.id:0!null\n" +
 20331  			"         │   │   └─ cc.subject_id:24!null\n" +
 20332  			"         │   ├─ Filter\n" +
 20333  			"         │   │   ├─ Eq\n" +
 20334  			"         │   │   │   ├─ cct1.kind:1!null\n" +
 20335  			"         │   │   │   └─ cast (longtext)\n" +
 20336  			"         │   │   └─ TableAlias(cct1)\n" +
 20337  			"         │   │       └─ ProcessTable\n" +
 20338  			"         │   │           └─ Table\n" +
 20339  			"         │   │               ├─ name: comp_cast_type\n" +
 20340  			"         │   │               └─ columns: [id kind]\n" +
 20341  			"         │   └─ HashLookup\n" +
 20342  			"         │       ├─ left-key: TUPLE(cct1.id:0!null)\n" +
 20343  			"         │       ├─ right-key: TUPLE(cc.subject_id:22!null)\n" +
 20344  			"         │       └─ HashJoin\n" +
 20345  			"         │           ├─ Eq\n" +
 20346  			"         │           │   ├─ cct2.id:2!null\n" +
 20347  			"         │           │   └─ cc.status_id:25!null\n" +
 20348  			"         │           ├─ Filter\n" +
 20349  			"         │           │   ├─ AND\n" +
 20350  			"         │           │   │   ├─ GreaterThanOrEqual\n" +
 20351  			"         │           │   │   │   ├─ cct2.kind:1!null\n" +
 20352  			"         │           │   │   │   └─ complete (longtext)\n" +
 20353  			"         │           │   │   └─ LessThanOrEqual\n" +
 20354  			"         │           │   │       ├─ cct2.kind:1!null\n" +
 20355  			"         │           │   │       └─ completeÿ (longtext)\n" +
 20356  			"         │           │   └─ TableAlias(cct2)\n" +
 20357  			"         │           │       └─ Table\n" +
 20358  			"         │           │           ├─ name: comp_cast_type\n" +
 20359  			"         │           │           ├─ columns: [id kind]\n" +
 20360  			"         │           │           ├─ colSet: (7,8)\n" +
 20361  			"         │           │           └─ tableId: 3\n" +
 20362  			"         │           └─ HashLookup\n" +
 20363  			"         │               ├─ left-key: TUPLE(cct2.id:2!null)\n" +
 20364  			"         │               ├─ right-key: TUPLE(cc.status_id:21!null)\n" +
 20365  			"         │               └─ HashJoin\n" +
 20366  			"         │                   ├─ Eq\n" +
 20367  			"         │                   │   ├─ lt.id:4!null\n" +
 20368  			"         │                   │   └─ ml.link_type_id:14!null\n" +
 20369  			"         │                   ├─ Filter\n" +
 20370  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 20371  			"         │                   │   └─ TableAlias(lt)\n" +
 20372  			"         │                   │       └─ ProcessTable\n" +
 20373  			"         │                   │           └─ Table\n" +
 20374  			"         │                   │               ├─ name: link_type\n" +
 20375  			"         │                   │               └─ columns: [id link]\n" +
 20376  			"         │                   └─ HashLookup\n" +
 20377  			"         │                       ├─ left-key: TUPLE(lt.id:4!null)\n" +
 20378  			"         │                       ├─ right-key: TUPLE(ml.link_type_id:8!null)\n" +
 20379  			"         │                       └─ HashJoin\n" +
 20380  			"         │                           ├─ Eq\n" +
 20381  			"         │                           │   ├─ mk.keyword_id:16!null\n" +
 20382  			"         │                           │   └─ k.id:6!null\n" +
 20383  			"         │                           ├─ Filter\n" +
 20384  			"         │                           │   ├─ Eq\n" +
 20385  			"         │                           │   │   ├─ k.keyword:1!null\n" +
 20386  			"         │                           │   │   └─ sequel (longtext)\n" +
 20387  			"         │                           │   └─ TableAlias(k)\n" +
 20388  			"         │                           │       └─ ProcessTable\n" +
 20389  			"         │                           │           └─ Table\n" +
 20390  			"         │                           │               ├─ name: keyword\n" +
 20391  			"         │                           │               └─ columns: [id keyword]\n" +
 20392  			"         │                           └─ HashLookup\n" +
 20393  			"         │                               ├─ left-key: TUPLE(k.id:6!null)\n" +
 20394  			"         │                               ├─ right-key: TUPLE(mk.keyword_id:8!null)\n" +
 20395  			"         │                               └─ HashJoin\n" +
 20396  			"         │                                   ├─ Eq\n" +
 20397  			"         │                                   │   ├─ mc.company_type_id:21!null\n" +
 20398  			"         │                                   │   └─ ct.id:8!null\n" +
 20399  			"         │                                   ├─ Filter\n" +
 20400  			"         │                                   │   ├─ Eq\n" +
 20401  			"         │                                   │   │   ├─ ct.kind:1!null\n" +
 20402  			"         │                                   │   │   └─ production companies (longtext)\n" +
 20403  			"         │                                   │   └─ TableAlias(ct)\n" +
 20404  			"         │                                   │       └─ ProcessTable\n" +
 20405  			"         │                                   │           └─ Table\n" +
 20406  			"         │                                   │               ├─ name: company_type\n" +
 20407  			"         │                                   │               └─ columns: [id kind]\n" +
 20408  			"         │                                   └─ HashLookup\n" +
 20409  			"         │                                       ├─ left-key: TUPLE(ct.id:8!null)\n" +
 20410  			"         │                                       ├─ right-key: TUPLE(mc.company_type_id:11!null)\n" +
 20411  			"         │                                       └─ HashJoin\n" +
 20412  			"         │                                           ├─ Eq\n" +
 20413  			"         │                                           │   ├─ mc.company_id:20!null\n" +
 20414  			"         │                                           │   └─ cn.id:10!null\n" +
 20415  			"         │                                           ├─ Filter\n" +
 20416  			"         │                                           │   ├─ AND\n" +
 20417  			"         │                                           │   │   ├─ NOT\n" +
 20418  			"         │                                           │   │   │   └─ Eq\n" +
 20419  			"         │                                           │   │   │       ├─ cn.country_code:2\n" +
 20420  			"         │                                           │   │   │       └─ [pl] (longtext)\n" +
 20421  			"         │                                           │   │   └─ Or\n" +
 20422  			"         │                                           │   │       ├─ cn.name LIKE '%Film%'\n" +
 20423  			"         │                                           │   │       └─ cn.name LIKE '%Warner%'\n" +
 20424  			"         │                                           │   └─ TableAlias(cn)\n" +
 20425  			"         │                                           │       └─ ProcessTable\n" +
 20426  			"         │                                           │           └─ Table\n" +
 20427  			"         │                                           │               ├─ name: company_name\n" +
 20428  			"         │                                           │               └─ columns: [id name country_code]\n" +
 20429  			"         │                                           └─ HashLookup\n" +
 20430  			"         │                                               ├─ left-key: TUPLE(cn.id:10!null)\n" +
 20431  			"         │                                               ├─ right-key: TUPLE(mc.company_id:7!null)\n" +
 20432  			"         │                                               └─ LookupJoin\n" +
 20433  			"         │                                                   ├─ InnerJoin\n" +
 20434  			"         │                                                   │   ├─ Eq\n" +
 20435  			"         │                                                   │   │   ├─ ml.movie_id:13!null\n" +
 20436  			"         │                                                   │   │   └─ mk.movie_id:15!null\n" +
 20437  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 20438  			"         │                                                   │   │   └─ ProcessTable\n" +
 20439  			"         │                                                   │   │       └─ Table\n" +
 20440  			"         │                                                   │   │           ├─ name: movie_link\n" +
 20441  			"         │                                                   │   │           └─ columns: [movie_id link_type_id]\n" +
 20442  			"         │                                                   │   └─ LookupJoin\n" +
 20443  			"         │                                                   │       ├─ InnerJoin\n" +
 20444  			"         │                                                   │       │   ├─ Eq\n" +
 20445  			"         │                                                   │       │   │   ├─ mk.movie_id:15!null\n" +
 20446  			"         │                                                   │       │   │   └─ mi.movie_id:17!null\n" +
 20447  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 20448  			"         │                                                   │       │   │   └─ ProcessTable\n" +
 20449  			"         │                                                   │       │   │       └─ Table\n" +
 20450  			"         │                                                   │       │   │           ├─ name: movie_keyword\n" +
 20451  			"         │                                                   │       │   │           └─ columns: [movie_id keyword_id]\n" +
 20452  			"         │                                                   │       │   └─ Filter\n" +
 20453  			"         │                                                   │       │       ├─ HashIn\n" +
 20454  			"         │                                                   │       │       │   ├─ mi.info:1!null\n" +
 20455  			"         │                                                   │       │       │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext), English (longtext))\n" +
 20456  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 20457  			"         │                                                   │       │           └─ ProcessTable\n" +
 20458  			"         │                                                   │       │               └─ Table\n" +
 20459  			"         │                                                   │       │                   ├─ name: movie_info\n" +
 20460  			"         │                                                   │       │                   └─ columns: [movie_id info]\n" +
 20461  			"         │                                                   │       └─ Filter\n" +
 20462  			"         │                                                   │           ├─ mc.note:3 IS NULL\n" +
 20463  			"         │                                                   │           └─ TableAlias(mc)\n" +
 20464  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 20465  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 20466  			"         │                                                   │                   ├─ keys: [mi.movie_id:17!null]\n" +
 20467  			"         │                                                   │                   ├─ colSet: (23-27)\n" +
 20468  			"         │                                                   │                   ├─ tableId: 8\n" +
 20469  			"         │                                                   │                   └─ Table\n" +
 20470  			"         │                                                   │                       ├─ name: movie_companies\n" +
 20471  			"         │                                                   │                       └─ columns: [movie_id company_id company_type_id note]\n" +
 20472  			"         │                                                   └─ TableAlias(cc)\n" +
 20473  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 20474  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 20475  			"         │                                                           ├─ keys: [mc.movie_id:19!null]\n" +
 20476  			"         │                                                           ├─ colSet: (1-4)\n" +
 20477  			"         │                                                           ├─ tableId: 1\n" +
 20478  			"         │                                                           └─ Table\n" +
 20479  			"         │                                                               ├─ name: complete_cast\n" +
 20480  			"         │                                                               └─ columns: [movie_id subject_id status_id]\n" +
 20481  			"         └─ HashLookup\n" +
 20482  			"             ├─ left-key: TUPLE(ml.movie_id:13!null, mk.movie_id:15!null, mc.movie_id:19!null, mi.movie_id:17!null, cc.movie_id:23)\n" +
 20483  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 20484  			"             └─ Filter\n" +
 20485  			"                 ├─ AND\n" +
 20486  			"                 │   ├─ GreaterThanOrEqual\n" +
 20487  			"                 │   │   ├─ t.production_year:2\n" +
 20488  			"                 │   │   └─ 1950 (smallint)\n" +
 20489  			"                 │   └─ LessThanOrEqual\n" +
 20490  			"                 │       ├─ t.production_year:2\n" +
 20491  			"                 │       └─ 2010 (smallint)\n" +
 20492  			"                 └─ TableAlias(t)\n" +
 20493  			"                     └─ ProcessTable\n" +
 20494  			"                         └─ Table\n" +
 20495  			"                             ├─ name: title\n" +
 20496  			"                             └─ columns: [id title production_year]\n" +
 20497  			"",
 20498  		ExpectedEstimates: "Project\n" +
 20499  			" ├─ columns: [min(cn.name) as producing_company, min(lt.link) as link_type, min(t.title) as complete_western_sequel]\n" +
 20500  			" └─ GroupBy\n" +
 20501  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 20502  			"     ├─ Grouping()\n" +
 20503  			"     └─ HashJoin\n" +
 20504  			"         ├─ (((((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id)) AND (mi.movie_id = t.id)) AND (t.id = cc.movie_id))\n" +
 20505  			"         ├─ HashJoin\n" +
 20506  			"         │   ├─ (cct1.id = cc.subject_id)\n" +
 20507  			"         │   ├─ Filter\n" +
 20508  			"         │   │   ├─ (cct1.kind = 'cast')\n" +
 20509  			"         │   │   └─ TableAlias(cct1)\n" +
 20510  			"         │   │       └─ Table\n" +
 20511  			"         │   │           ├─ name: comp_cast_type\n" +
 20512  			"         │   │           └─ columns: [id kind]\n" +
 20513  			"         │   └─ HashLookup\n" +
 20514  			"         │       ├─ left-key: (cct1.id)\n" +
 20515  			"         │       ├─ right-key: (cc.subject_id)\n" +
 20516  			"         │       └─ HashJoin\n" +
 20517  			"         │           ├─ (cct2.id = cc.status_id)\n" +
 20518  			"         │           ├─ Filter\n" +
 20519  			"         │           │   ├─ ((cct2.kind >= 'complete') AND (cct2.kind <= 'completeÿ'))\n" +
 20520  			"         │           │   └─ TableAlias(cct2)\n" +
 20521  			"         │           │       └─ Table\n" +
 20522  			"         │           │           ├─ name: comp_cast_type\n" +
 20523  			"         │           │           └─ columns: [id kind]\n" +
 20524  			"         │           └─ HashLookup\n" +
 20525  			"         │               ├─ left-key: (cct2.id)\n" +
 20526  			"         │               ├─ right-key: (cc.status_id)\n" +
 20527  			"         │               └─ HashJoin\n" +
 20528  			"         │                   ├─ (lt.id = ml.link_type_id)\n" +
 20529  			"         │                   ├─ Filter\n" +
 20530  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 20531  			"         │                   │   └─ TableAlias(lt)\n" +
 20532  			"         │                   │       └─ Table\n" +
 20533  			"         │                   │           ├─ name: link_type\n" +
 20534  			"         │                   │           └─ columns: [id link]\n" +
 20535  			"         │                   └─ HashLookup\n" +
 20536  			"         │                       ├─ left-key: (lt.id)\n" +
 20537  			"         │                       ├─ right-key: (ml.link_type_id)\n" +
 20538  			"         │                       └─ HashJoin\n" +
 20539  			"         │                           ├─ (mk.keyword_id = k.id)\n" +
 20540  			"         │                           ├─ Filter\n" +
 20541  			"         │                           │   ├─ (k.keyword = 'sequel')\n" +
 20542  			"         │                           │   └─ TableAlias(k)\n" +
 20543  			"         │                           │       └─ Table\n" +
 20544  			"         │                           │           ├─ name: keyword\n" +
 20545  			"         │                           │           └─ columns: [id keyword]\n" +
 20546  			"         │                           └─ HashLookup\n" +
 20547  			"         │                               ├─ left-key: (k.id)\n" +
 20548  			"         │                               ├─ right-key: (mk.keyword_id)\n" +
 20549  			"         │                               └─ HashJoin\n" +
 20550  			"         │                                   ├─ (mc.company_type_id = ct.id)\n" +
 20551  			"         │                                   ├─ Filter\n" +
 20552  			"         │                                   │   ├─ (ct.kind = 'production companies')\n" +
 20553  			"         │                                   │   └─ TableAlias(ct)\n" +
 20554  			"         │                                   │       └─ Table\n" +
 20555  			"         │                                   │           ├─ name: company_type\n" +
 20556  			"         │                                   │           └─ columns: [id kind]\n" +
 20557  			"         │                                   └─ HashLookup\n" +
 20558  			"         │                                       ├─ left-key: (ct.id)\n" +
 20559  			"         │                                       ├─ right-key: (mc.company_type_id)\n" +
 20560  			"         │                                       └─ HashJoin\n" +
 20561  			"         │                                           ├─ (mc.company_id = cn.id)\n" +
 20562  			"         │                                           ├─ Filter\n" +
 20563  			"         │                                           │   ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 20564  			"         │                                           │   └─ TableAlias(cn)\n" +
 20565  			"         │                                           │       └─ Table\n" +
 20566  			"         │                                           │           ├─ name: company_name\n" +
 20567  			"         │                                           │           └─ columns: [id name country_code]\n" +
 20568  			"         │                                           └─ HashLookup\n" +
 20569  			"         │                                               ├─ left-key: (cn.id)\n" +
 20570  			"         │                                               ├─ right-key: (mc.company_id)\n" +
 20571  			"         │                                               └─ LookupJoin\n" +
 20572  			"         │                                                   ├─ InnerJoin\n" +
 20573  			"         │                                                   │   ├─ (ml.movie_id = mk.movie_id)\n" +
 20574  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 20575  			"         │                                                   │   │   └─ Table\n" +
 20576  			"         │                                                   │   │       ├─ name: movie_link\n" +
 20577  			"         │                                                   │   │       └─ columns: [movie_id link_type_id]\n" +
 20578  			"         │                                                   │   └─ LookupJoin\n" +
 20579  			"         │                                                   │       ├─ InnerJoin\n" +
 20580  			"         │                                                   │       │   ├─ (mk.movie_id = mi.movie_id)\n" +
 20581  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 20582  			"         │                                                   │       │   │   └─ Table\n" +
 20583  			"         │                                                   │       │   │       ├─ name: movie_keyword\n" +
 20584  			"         │                                                   │       │   │       └─ columns: [movie_id keyword_id]\n" +
 20585  			"         │                                                   │       │   └─ Filter\n" +
 20586  			"         │                                                   │       │       ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'English'))\n" +
 20587  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 20588  			"         │                                                   │       │           └─ Table\n" +
 20589  			"         │                                                   │       │               ├─ name: movie_info\n" +
 20590  			"         │                                                   │       │               └─ columns: [movie_id info]\n" +
 20591  			"         │                                                   │       └─ Filter\n" +
 20592  			"         │                                                   │           ├─ mc.note IS NULL\n" +
 20593  			"         │                                                   │           └─ TableAlias(mc)\n" +
 20594  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 20595  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 20596  			"         │                                                   │                   ├─ columns: [movie_id company_id company_type_id note]\n" +
 20597  			"         │                                                   │                   └─ keys: mi.movie_id\n" +
 20598  			"         │                                                   └─ TableAlias(cc)\n" +
 20599  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 20600  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 20601  			"         │                                                           ├─ columns: [movie_id subject_id status_id]\n" +
 20602  			"         │                                                           └─ keys: mc.movie_id\n" +
 20603  			"         └─ HashLookup\n" +
 20604  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id, mi.movie_id, cc.movie_id)\n" +
 20605  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 20606  			"             └─ Filter\n" +
 20607  			"                 ├─ ((t.production_year >= 1950) AND (t.production_year <= 2010))\n" +
 20608  			"                 └─ TableAlias(t)\n" +
 20609  			"                     └─ Table\n" +
 20610  			"                         ├─ name: title\n" +
 20611  			"                         └─ columns: [id title production_year]\n" +
 20612  			"",
 20613  		ExpectedAnalysis: "Project\n" +
 20614  			" ├─ columns: [min(cn.name) as producing_company, min(lt.link) as link_type, min(t.title) as complete_western_sequel]\n" +
 20615  			" └─ GroupBy\n" +
 20616  			"     ├─ SelectedExprs(MIN(cn.name), MIN(lt.link), MIN(t.title))\n" +
 20617  			"     ├─ Grouping()\n" +
 20618  			"     └─ HashJoin\n" +
 20619  			"         ├─ (((((ml.movie_id = t.id) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id)) AND (mi.movie_id = t.id)) AND (t.id = cc.movie_id))\n" +
 20620  			"         ├─ HashJoin\n" +
 20621  			"         │   ├─ (cct1.id = cc.subject_id)\n" +
 20622  			"         │   ├─ Filter\n" +
 20623  			"         │   │   ├─ (cct1.kind = 'cast')\n" +
 20624  			"         │   │   └─ TableAlias(cct1)\n" +
 20625  			"         │   │       └─ Table\n" +
 20626  			"         │   │           ├─ name: comp_cast_type\n" +
 20627  			"         │   │           └─ columns: [id kind]\n" +
 20628  			"         │   └─ HashLookup\n" +
 20629  			"         │       ├─ left-key: (cct1.id)\n" +
 20630  			"         │       ├─ right-key: (cc.subject_id)\n" +
 20631  			"         │       └─ HashJoin\n" +
 20632  			"         │           ├─ (cct2.id = cc.status_id)\n" +
 20633  			"         │           ├─ Filter\n" +
 20634  			"         │           │   ├─ ((cct2.kind >= 'complete') AND (cct2.kind <= 'completeÿ'))\n" +
 20635  			"         │           │   └─ TableAlias(cct2)\n" +
 20636  			"         │           │       └─ Table\n" +
 20637  			"         │           │           ├─ name: comp_cast_type\n" +
 20638  			"         │           │           └─ columns: [id kind]\n" +
 20639  			"         │           └─ HashLookup\n" +
 20640  			"         │               ├─ left-key: (cct2.id)\n" +
 20641  			"         │               ├─ right-key: (cc.status_id)\n" +
 20642  			"         │               └─ HashJoin\n" +
 20643  			"         │                   ├─ (lt.id = ml.link_type_id)\n" +
 20644  			"         │                   ├─ Filter\n" +
 20645  			"         │                   │   ├─ lt.link LIKE '%follow%'\n" +
 20646  			"         │                   │   └─ TableAlias(lt)\n" +
 20647  			"         │                   │       └─ Table\n" +
 20648  			"         │                   │           ├─ name: link_type\n" +
 20649  			"         │                   │           └─ columns: [id link]\n" +
 20650  			"         │                   └─ HashLookup\n" +
 20651  			"         │                       ├─ left-key: (lt.id)\n" +
 20652  			"         │                       ├─ right-key: (ml.link_type_id)\n" +
 20653  			"         │                       └─ HashJoin\n" +
 20654  			"         │                           ├─ (mk.keyword_id = k.id)\n" +
 20655  			"         │                           ├─ Filter\n" +
 20656  			"         │                           │   ├─ (k.keyword = 'sequel')\n" +
 20657  			"         │                           │   └─ TableAlias(k)\n" +
 20658  			"         │                           │       └─ Table\n" +
 20659  			"         │                           │           ├─ name: keyword\n" +
 20660  			"         │                           │           └─ columns: [id keyword]\n" +
 20661  			"         │                           └─ HashLookup\n" +
 20662  			"         │                               ├─ left-key: (k.id)\n" +
 20663  			"         │                               ├─ right-key: (mk.keyword_id)\n" +
 20664  			"         │                               └─ HashJoin\n" +
 20665  			"         │                                   ├─ (mc.company_type_id = ct.id)\n" +
 20666  			"         │                                   ├─ Filter\n" +
 20667  			"         │                                   │   ├─ (ct.kind = 'production companies')\n" +
 20668  			"         │                                   │   └─ TableAlias(ct)\n" +
 20669  			"         │                                   │       └─ Table\n" +
 20670  			"         │                                   │           ├─ name: company_type\n" +
 20671  			"         │                                   │           └─ columns: [id kind]\n" +
 20672  			"         │                                   └─ HashLookup\n" +
 20673  			"         │                                       ├─ left-key: (ct.id)\n" +
 20674  			"         │                                       ├─ right-key: (mc.company_type_id)\n" +
 20675  			"         │                                       └─ HashJoin\n" +
 20676  			"         │                                           ├─ (mc.company_id = cn.id)\n" +
 20677  			"         │                                           ├─ Filter\n" +
 20678  			"         │                                           │   ├─ ((NOT((cn.country_code = '[pl]'))) AND (cn.name LIKE '%Film%' OR cn.name LIKE '%Warner%'))\n" +
 20679  			"         │                                           │   └─ TableAlias(cn)\n" +
 20680  			"         │                                           │       └─ Table\n" +
 20681  			"         │                                           │           ├─ name: company_name\n" +
 20682  			"         │                                           │           └─ columns: [id name country_code]\n" +
 20683  			"         │                                           └─ HashLookup\n" +
 20684  			"         │                                               ├─ left-key: (cn.id)\n" +
 20685  			"         │                                               ├─ right-key: (mc.company_id)\n" +
 20686  			"         │                                               └─ LookupJoin\n" +
 20687  			"         │                                                   ├─ InnerJoin\n" +
 20688  			"         │                                                   │   ├─ (ml.movie_id = mk.movie_id)\n" +
 20689  			"         │                                                   │   ├─ TableAlias(ml)\n" +
 20690  			"         │                                                   │   │   └─ Table\n" +
 20691  			"         │                                                   │   │       ├─ name: movie_link\n" +
 20692  			"         │                                                   │   │       └─ columns: [movie_id link_type_id]\n" +
 20693  			"         │                                                   │   └─ LookupJoin\n" +
 20694  			"         │                                                   │       ├─ InnerJoin\n" +
 20695  			"         │                                                   │       │   ├─ (mk.movie_id = mi.movie_id)\n" +
 20696  			"         │                                                   │       │   ├─ TableAlias(mk)\n" +
 20697  			"         │                                                   │       │   │   └─ Table\n" +
 20698  			"         │                                                   │       │   │       ├─ name: movie_keyword\n" +
 20699  			"         │                                                   │       │   │       └─ columns: [movie_id keyword_id]\n" +
 20700  			"         │                                                   │       │   └─ Filter\n" +
 20701  			"         │                                                   │       │       ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'English'))\n" +
 20702  			"         │                                                   │       │       └─ TableAlias(mi)\n" +
 20703  			"         │                                                   │       │           └─ Table\n" +
 20704  			"         │                                                   │       │               ├─ name: movie_info\n" +
 20705  			"         │                                                   │       │               └─ columns: [movie_id info]\n" +
 20706  			"         │                                                   │       └─ Filter\n" +
 20707  			"         │                                                   │           ├─ mc.note IS NULL\n" +
 20708  			"         │                                                   │           └─ TableAlias(mc)\n" +
 20709  			"         │                                                   │               └─ IndexedTableAccess(movie_companies)\n" +
 20710  			"         │                                                   │                   ├─ index: [movie_companies.movie_id]\n" +
 20711  			"         │                                                   │                   ├─ columns: [movie_id company_id company_type_id note]\n" +
 20712  			"         │                                                   │                   └─ keys: mi.movie_id\n" +
 20713  			"         │                                                   └─ TableAlias(cc)\n" +
 20714  			"         │                                                       └─ IndexedTableAccess(complete_cast)\n" +
 20715  			"         │                                                           ├─ index: [complete_cast.movie_id]\n" +
 20716  			"         │                                                           ├─ columns: [movie_id subject_id status_id]\n" +
 20717  			"         │                                                           └─ keys: mc.movie_id\n" +
 20718  			"         └─ HashLookup\n" +
 20719  			"             ├─ left-key: (ml.movie_id, mk.movie_id, mc.movie_id, mi.movie_id, cc.movie_id)\n" +
 20720  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 20721  			"             └─ Filter\n" +
 20722  			"                 ├─ ((t.production_year >= 1950) AND (t.production_year <= 2010))\n" +
 20723  			"                 └─ TableAlias(t)\n" +
 20724  			"                     └─ Table\n" +
 20725  			"                         ├─ name: title\n" +
 20726  			"                         └─ columns: [id title production_year]\n" +
 20727  			"",
 20728  	},
 20729  	{
 20730  		Query: `
 20731  SELECT MIN(cn.name) AS movie_company,
 20732         MIN(mi_idx.info) AS rating,
 20733         MIN(t.title) AS complete_euro_dark_movie
 20734  FROM complete_cast AS cc,
 20735       comp_cast_type AS cct1,
 20736       comp_cast_type AS cct2,
 20737       company_name AS cn,
 20738       company_type AS ct,
 20739       info_type AS it1,
 20740       info_type AS it2,
 20741       keyword AS k,
 20742       kind_type AS kt,
 20743       movie_companies AS mc,
 20744       movie_info AS mi,
 20745       movie_info_idx AS mi_idx,
 20746       movie_keyword AS mk,
 20747       title AS t
 20748  WHERE cct1.kind = 'crew'
 20749    AND cct2.kind != 'complete+verified'
 20750    AND cn.country_code != '[us]'
 20751    AND it1.info = 'countries'
 20752    AND it2.info = 'rating'
 20753    AND k.keyword IN ('murder',
 20754                      'murder-in-title',
 20755                      'blood',
 20756                      'violence')
 20757    AND kt.kind IN ('movie',
 20758                    'episode')
 20759    AND mc.note NOT LIKE '%(USA)%'
 20760    AND mc.note LIKE '%(200%)%'
 20761    AND mi.info IN ('Sweden',
 20762                    'Norway',
 20763                    'Germany',
 20764                    'Denmark',
 20765                    'Swedish',
 20766                    'Danish',
 20767                    'Norwegian',
 20768                    'German',
 20769                    'USA',
 20770                    'American')
 20771    AND mi_idx.info < '8.5'
 20772    AND t.production_year > 2000
 20773    AND kt.id = t.kind_id
 20774    AND t.id = mi.movie_id
 20775    AND t.id = mk.movie_id
 20776    AND t.id = mi_idx.movie_id
 20777    AND t.id = mc.movie_id
 20778    AND t.id = cc.movie_id
 20779    AND mk.movie_id = mi.movie_id
 20780    AND mk.movie_id = mi_idx.movie_id
 20781    AND mk.movie_id = mc.movie_id
 20782    AND mk.movie_id = cc.movie_id
 20783    AND mi.movie_id = mi_idx.movie_id
 20784    AND mi.movie_id = mc.movie_id
 20785    AND mi.movie_id = cc.movie_id
 20786    AND mc.movie_id = mi_idx.movie_id
 20787    AND mc.movie_id = cc.movie_id
 20788    AND mi_idx.movie_id = cc.movie_id
 20789    AND k.id = mk.keyword_id
 20790    AND it1.id = mi.info_type_id
 20791    AND it2.id = mi_idx.info_type_id
 20792    AND ct.id = mc.company_type_id
 20793    AND cn.id = mc.company_id
 20794    AND cct1.id = cc.subject_id
 20795    AND cct2.id = cc.status_id;
 20796  
 20797  `,
 20798  		ExpectedPlan: "Project\n" +
 20799  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as complete_euro_dark_movie]\n" +
 20800  			" └─ GroupBy\n" +
 20801  			"     ├─ select: MIN(cn.name:23!null), MIN(mi_idx.info:32!null), MIN(t.title:1!null)\n" +
 20802  			"     ├─ group: \n" +
 20803  			"     └─ InnerJoin\n" +
 20804  			"         ├─ AND\n" +
 20805  			"         │   ├─ AND\n" +
 20806  			"         │   │   ├─ AND\n" +
 20807  			"         │   │   │   ├─ AND\n" +
 20808  			"         │   │   │   │   ├─ Eq\n" +
 20809  			"         │   │   │   │   │   ├─ mi.movie_id:13!null\n" +
 20810  			"         │   │   │   │   │   └─ mi_idx.movie_id:30!null\n" +
 20811  			"         │   │   │   │   └─ Eq\n" +
 20812  			"         │   │   │   │       ├─ mc.movie_id:18!null\n" +
 20813  			"         │   │   │   │       └─ mi_idx.movie_id:30!null\n" +
 20814  			"         │   │   │   └─ Eq\n" +
 20815  			"         │   │   │       ├─ mi_idx.movie_id:30!null\n" +
 20816  			"         │   │   │       └─ cc.movie_id:8\n" +
 20817  			"         │   │   └─ Eq\n" +
 20818  			"         │   │       ├─ mk.movie_id:26!null\n" +
 20819  			"         │   │       └─ mi_idx.movie_id:30!null\n" +
 20820  			"         │   └─ Eq\n" +
 20821  			"         │       ├─ t.id:0!null\n" +
 20822  			"         │       └─ mi_idx.movie_id:30!null\n" +
 20823  			"         ├─ InnerJoin\n" +
 20824  			"         │   ├─ AND\n" +
 20825  			"         │   │   ├─ AND\n" +
 20826  			"         │   │   │   ├─ Eq\n" +
 20827  			"         │   │   │   │   ├─ mk.movie_id:26!null\n" +
 20828  			"         │   │   │   │   └─ mi.movie_id:13!null\n" +
 20829  			"         │   │   │   └─ Eq\n" +
 20830  			"         │   │   │       ├─ mk.movie_id:26!null\n" +
 20831  			"         │   │   │       └─ mc.movie_id:18!null\n" +
 20832  			"         │   │   └─ Eq\n" +
 20833  			"         │   │       ├─ t.id:0!null\n" +
 20834  			"         │   │       └─ mk.movie_id:26!null\n" +
 20835  			"         │   ├─ InnerJoin\n" +
 20836  			"         │   │   ├─ AND\n" +
 20837  			"         │   │   │   ├─ Eq\n" +
 20838  			"         │   │   │   │   ├─ mi.movie_id:13!null\n" +
 20839  			"         │   │   │   │   └─ mc.movie_id:18!null\n" +
 20840  			"         │   │   │   └─ Eq\n" +
 20841  			"         │   │   │       ├─ t.id:0!null\n" +
 20842  			"         │   │   │       └─ mc.movie_id:18!null\n" +
 20843  			"         │   │   ├─ InnerJoin\n" +
 20844  			"         │   │   │   ├─ Eq\n" +
 20845  			"         │   │   │   │   ├─ t.id:0!null\n" +
 20846  			"         │   │   │   │   └─ mi.movie_id:13!null\n" +
 20847  			"         │   │   │   ├─ InnerJoin\n" +
 20848  			"         │   │   │   │   ├─ Eq\n" +
 20849  			"         │   │   │   │   │   ├─ kt.id:11!null\n" +
 20850  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 20851  			"         │   │   │   │   ├─ InnerJoin\n" +
 20852  			"         │   │   │   │   │   ├─ Eq\n" +
 20853  			"         │   │   │   │   │   │   ├─ t.id:0!null\n" +
 20854  			"         │   │   │   │   │   │   └─ cc.movie_id:8\n" +
 20855  			"         │   │   │   │   │   ├─ Filter\n" +
 20856  			"         │   │   │   │   │   │   ├─ GreaterThan\n" +
 20857  			"         │   │   │   │   │   │   │   ├─ t.production_year:3\n" +
 20858  			"         │   │   │   │   │   │   │   └─ 2000 (smallint)\n" +
 20859  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 20860  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 20861  			"         │   │   │   │   │   │           └─ Table\n" +
 20862  			"         │   │   │   │   │   │               ├─ name: title\n" +
 20863  			"         │   │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 20864  			"         │   │   │   │   │   └─ InnerJoin\n" +
 20865  			"         │   │   │   │   │       ├─ Eq\n" +
 20866  			"         │   │   │   │   │       │   ├─ cct2.id:4!null\n" +
 20867  			"         │   │   │   │   │       │   └─ cc.status_id:10!null\n" +
 20868  			"         │   │   │   │   │       ├─ Filter\n" +
 20869  			"         │   │   │   │   │       │   ├─ NOT\n" +
 20870  			"         │   │   │   │   │       │   │   └─ Eq\n" +
 20871  			"         │   │   │   │   │       │   │       ├─ cct2.kind:1!null\n" +
 20872  			"         │   │   │   │   │       │   │       └─ complete+verified (longtext)\n" +
 20873  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 20874  			"         │   │   │   │   │       │       └─ ProcessTable\n" +
 20875  			"         │   │   │   │   │       │           └─ Table\n" +
 20876  			"         │   │   │   │   │       │               ├─ name: comp_cast_type\n" +
 20877  			"         │   │   │   │   │       │               └─ columns: [id kind]\n" +
 20878  			"         │   │   │   │   │       └─ InnerJoin\n" +
 20879  			"         │   │   │   │   │           ├─ Eq\n" +
 20880  			"         │   │   │   │   │           │   ├─ cct1.id:6!null\n" +
 20881  			"         │   │   │   │   │           │   └─ cc.subject_id:9!null\n" +
 20882  			"         │   │   │   │   │           ├─ Filter\n" +
 20883  			"         │   │   │   │   │           │   ├─ Eq\n" +
 20884  			"         │   │   │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 20885  			"         │   │   │   │   │           │   │   └─ crew (longtext)\n" +
 20886  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 20887  			"         │   │   │   │   │           │       └─ Table\n" +
 20888  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 20889  			"         │   │   │   │   │           │           ├─ columns: [id kind]\n" +
 20890  			"         │   │   │   │   │           │           ├─ colSet: (5,6)\n" +
 20891  			"         │   │   │   │   │           │           └─ tableId: 2\n" +
 20892  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 20893  			"         │   │   │   │   │               └─ ProcessTable\n" +
 20894  			"         │   │   │   │   │                   └─ Table\n" +
 20895  			"         │   │   │   │   │                       ├─ name: complete_cast\n" +
 20896  			"         │   │   │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 20897  			"         │   │   │   │   └─ Filter\n" +
 20898  			"         │   │   │   │       ├─ HashIn\n" +
 20899  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 20900  			"         │   │   │   │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
 20901  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 20902  			"         │   │   │   │           └─ ProcessTable\n" +
 20903  			"         │   │   │   │               └─ Table\n" +
 20904  			"         │   │   │   │                   ├─ name: kind_type\n" +
 20905  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 20906  			"         │   │   │   └─ InnerJoin\n" +
 20907  			"         │   │   │       ├─ Eq\n" +
 20908  			"         │   │   │       │   ├─ it1.id:16!null\n" +
 20909  			"         │   │   │       │   └─ mi.info_type_id:14!null\n" +
 20910  			"         │   │   │       ├─ Filter\n" +
 20911  			"         │   │   │       │   ├─ HashIn\n" +
 20912  			"         │   │   │       │   │   ├─ mi.info:2!null\n" +
 20913  			"         │   │   │       │   │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Danish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 20914  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 20915  			"         │   │   │       │       └─ ProcessTable\n" +
 20916  			"         │   │   │       │           └─ Table\n" +
 20917  			"         │   │   │       │               ├─ name: movie_info\n" +
 20918  			"         │   │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 20919  			"         │   │   │       └─ Filter\n" +
 20920  			"         │   │   │           ├─ Eq\n" +
 20921  			"         │   │   │           │   ├─ it1.info:1!null\n" +
 20922  			"         │   │   │           │   └─ countries (longtext)\n" +
 20923  			"         │   │   │           └─ TableAlias(it1)\n" +
 20924  			"         │   │   │               └─ ProcessTable\n" +
 20925  			"         │   │   │                   └─ Table\n" +
 20926  			"         │   │   │                       ├─ name: info_type\n" +
 20927  			"         │   │   │                       └─ columns: [id info]\n" +
 20928  			"         │   │   └─ InnerJoin\n" +
 20929  			"         │   │       ├─ Eq\n" +
 20930  			"         │   │       │   ├─ ct.id:25!null\n" +
 20931  			"         │   │       │   └─ mc.company_type_id:20!null\n" +
 20932  			"         │   │       ├─ InnerJoin\n" +
 20933  			"         │   │       │   ├─ Eq\n" +
 20934  			"         │   │       │   │   ├─ cn.id:22!null\n" +
 20935  			"         │   │       │   │   └─ mc.company_id:19!null\n" +
 20936  			"         │   │       │   ├─ Filter\n" +
 20937  			"         │   │       │   │   ├─ AND\n" +
 20938  			"         │   │       │   │   │   ├─ NOT\n" +
 20939  			"         │   │       │   │   │   │   └─ mc.note LIKE '%(USA)%'\n" +
 20940  			"         │   │       │   │   │   └─ mc.note LIKE '%(200%)%'\n" +
 20941  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 20942  			"         │   │       │   │       └─ ProcessTable\n" +
 20943  			"         │   │       │   │           └─ Table\n" +
 20944  			"         │   │       │   │               ├─ name: movie_companies\n" +
 20945  			"         │   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 20946  			"         │   │       │   └─ Filter\n" +
 20947  			"         │   │       │       ├─ NOT\n" +
 20948  			"         │   │       │       │   └─ Eq\n" +
 20949  			"         │   │       │       │       ├─ cn.country_code:2\n" +
 20950  			"         │   │       │       │       └─ [us] (longtext)\n" +
 20951  			"         │   │       │       └─ TableAlias(cn)\n" +
 20952  			"         │   │       │           └─ ProcessTable\n" +
 20953  			"         │   │       │               └─ Table\n" +
 20954  			"         │   │       │                   ├─ name: company_name\n" +
 20955  			"         │   │       │                   └─ columns: [id name country_code]\n" +
 20956  			"         │   │       └─ TableAlias(ct)\n" +
 20957  			"         │   │           └─ ProcessTable\n" +
 20958  			"         │   │               └─ Table\n" +
 20959  			"         │   │                   ├─ name: company_type\n" +
 20960  			"         │   │                   └─ columns: [id]\n" +
 20961  			"         │   └─ InnerJoin\n" +
 20962  			"         │       ├─ Eq\n" +
 20963  			"         │       │   ├─ k.id:28!null\n" +
 20964  			"         │       │   └─ mk.keyword_id:27!null\n" +
 20965  			"         │       ├─ TableAlias(mk)\n" +
 20966  			"         │       │   └─ ProcessTable\n" +
 20967  			"         │       │       └─ Table\n" +
 20968  			"         │       │           ├─ name: movie_keyword\n" +
 20969  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 20970  			"         │       └─ Filter\n" +
 20971  			"         │           ├─ HashIn\n" +
 20972  			"         │           │   ├─ k.keyword:1!null\n" +
 20973  			"         │           │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
 20974  			"         │           └─ TableAlias(k)\n" +
 20975  			"         │               └─ ProcessTable\n" +
 20976  			"         │                   └─ Table\n" +
 20977  			"         │                       ├─ name: keyword\n" +
 20978  			"         │                       └─ columns: [id keyword]\n" +
 20979  			"         └─ InnerJoin\n" +
 20980  			"             ├─ Eq\n" +
 20981  			"             │   ├─ it2.id:33!null\n" +
 20982  			"             │   └─ mi_idx.info_type_id:31!null\n" +
 20983  			"             ├─ Filter\n" +
 20984  			"             │   ├─ LessThan\n" +
 20985  			"             │   │   ├─ mi_idx.info:2!null\n" +
 20986  			"             │   │   └─ 8.5 (longtext)\n" +
 20987  			"             │   └─ TableAlias(mi_idx)\n" +
 20988  			"             │       └─ ProcessTable\n" +
 20989  			"             │           └─ Table\n" +
 20990  			"             │               ├─ name: movie_info_idx\n" +
 20991  			"             │               └─ columns: [movie_id info_type_id info]\n" +
 20992  			"             └─ Filter\n" +
 20993  			"                 ├─ Eq\n" +
 20994  			"                 │   ├─ it2.info:1!null\n" +
 20995  			"                 │   └─ rating (longtext)\n" +
 20996  			"                 └─ TableAlias(it2)\n" +
 20997  			"                     └─ Table\n" +
 20998  			"                         ├─ name: info_type\n" +
 20999  			"                         ├─ columns: [id info]\n" +
 21000  			"                         ├─ colSet: (20,21)\n" +
 21001  			"                         └─ tableId: 7\n" +
 21002  			"",
 21003  		ExpectedEstimates: "Project\n" +
 21004  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as complete_euro_dark_movie]\n" +
 21005  			" └─ GroupBy\n" +
 21006  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 21007  			"     ├─ Grouping()\n" +
 21008  			"     └─ InnerJoin\n" +
 21009  			"         ├─ (((((mi.movie_id = mi_idx.movie_id) AND (mc.movie_id = mi_idx.movie_id)) AND (mi_idx.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 21010  			"         ├─ InnerJoin\n" +
 21011  			"         │   ├─ (((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 21012  			"         │   ├─ InnerJoin\n" +
 21013  			"         │   │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 21014  			"         │   │   ├─ InnerJoin\n" +
 21015  			"         │   │   │   ├─ (t.id = mi.movie_id)\n" +
 21016  			"         │   │   │   ├─ InnerJoin\n" +
 21017  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 21018  			"         │   │   │   │   ├─ InnerJoin\n" +
 21019  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 21020  			"         │   │   │   │   │   ├─ Filter\n" +
 21021  			"         │   │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 21022  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 21023  			"         │   │   │   │   │   │       └─ Table\n" +
 21024  			"         │   │   │   │   │   │           ├─ name: title\n" +
 21025  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 21026  			"         │   │   │   │   │   └─ InnerJoin\n" +
 21027  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 21028  			"         │   │   │   │   │       ├─ Filter\n" +
 21029  			"         │   │   │   │   │       │   ├─ (NOT((cct2.kind = 'complete+verified')))\n" +
 21030  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 21031  			"         │   │   │   │   │       │       └─ Table\n" +
 21032  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 21033  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 21034  			"         │   │   │   │   │       └─ InnerJoin\n" +
 21035  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 21036  			"         │   │   │   │   │           ├─ Filter\n" +
 21037  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'crew')\n" +
 21038  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 21039  			"         │   │   │   │   │           │       └─ Table\n" +
 21040  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 21041  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 21042  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 21043  			"         │   │   │   │   │               └─ Table\n" +
 21044  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 21045  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 21046  			"         │   │   │   │   └─ Filter\n" +
 21047  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 21048  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 21049  			"         │   │   │   │           └─ Table\n" +
 21050  			"         │   │   │   │               ├─ name: kind_type\n" +
 21051  			"         │   │   │   │               └─ columns: [id kind]\n" +
 21052  			"         │   │   │   └─ InnerJoin\n" +
 21053  			"         │   │   │       ├─ (it1.id = mi.info_type_id)\n" +
 21054  			"         │   │   │       ├─ Filter\n" +
 21055  			"         │   │   │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 21056  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 21057  			"         │   │   │       │       └─ Table\n" +
 21058  			"         │   │   │       │           ├─ name: movie_info\n" +
 21059  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 21060  			"         │   │   │       └─ Filter\n" +
 21061  			"         │   │   │           ├─ (it1.info = 'countries')\n" +
 21062  			"         │   │   │           └─ TableAlias(it1)\n" +
 21063  			"         │   │   │               └─ Table\n" +
 21064  			"         │   │   │                   ├─ name: info_type\n" +
 21065  			"         │   │   │                   └─ columns: [id info]\n" +
 21066  			"         │   │   └─ InnerJoin\n" +
 21067  			"         │   │       ├─ (ct.id = mc.company_type_id)\n" +
 21068  			"         │   │       ├─ InnerJoin\n" +
 21069  			"         │   │       │   ├─ (cn.id = mc.company_id)\n" +
 21070  			"         │   │       │   ├─ Filter\n" +
 21071  			"         │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 21072  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 21073  			"         │   │       │   │       └─ Table\n" +
 21074  			"         │   │       │   │           ├─ name: movie_companies\n" +
 21075  			"         │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 21076  			"         │   │       │   └─ Filter\n" +
 21077  			"         │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 21078  			"         │   │       │       └─ TableAlias(cn)\n" +
 21079  			"         │   │       │           └─ Table\n" +
 21080  			"         │   │       │               ├─ name: company_name\n" +
 21081  			"         │   │       │               └─ columns: [id name country_code]\n" +
 21082  			"         │   │       └─ TableAlias(ct)\n" +
 21083  			"         │   │           └─ Table\n" +
 21084  			"         │   │               ├─ name: company_type\n" +
 21085  			"         │   │               └─ columns: [id]\n" +
 21086  			"         │   └─ InnerJoin\n" +
 21087  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 21088  			"         │       ├─ TableAlias(mk)\n" +
 21089  			"         │       │   └─ Table\n" +
 21090  			"         │       │       ├─ name: movie_keyword\n" +
 21091  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 21092  			"         │       └─ Filter\n" +
 21093  			"         │           ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 21094  			"         │           └─ TableAlias(k)\n" +
 21095  			"         │               └─ Table\n" +
 21096  			"         │                   ├─ name: keyword\n" +
 21097  			"         │                   └─ columns: [id keyword]\n" +
 21098  			"         └─ InnerJoin\n" +
 21099  			"             ├─ (it2.id = mi_idx.info_type_id)\n" +
 21100  			"             ├─ Filter\n" +
 21101  			"             │   ├─ (mi_idx.info < '8.5')\n" +
 21102  			"             │   └─ TableAlias(mi_idx)\n" +
 21103  			"             │       └─ Table\n" +
 21104  			"             │           ├─ name: movie_info_idx\n" +
 21105  			"             │           └─ columns: [movie_id info_type_id info]\n" +
 21106  			"             └─ Filter\n" +
 21107  			"                 ├─ (it2.info = 'rating')\n" +
 21108  			"                 └─ TableAlias(it2)\n" +
 21109  			"                     └─ Table\n" +
 21110  			"                         ├─ name: info_type\n" +
 21111  			"                         └─ columns: [id info]\n" +
 21112  			"",
 21113  		ExpectedAnalysis: "Project\n" +
 21114  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as complete_euro_dark_movie]\n" +
 21115  			" └─ GroupBy\n" +
 21116  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 21117  			"     ├─ Grouping()\n" +
 21118  			"     └─ InnerJoin\n" +
 21119  			"         ├─ (((((mi.movie_id = mi_idx.movie_id) AND (mc.movie_id = mi_idx.movie_id)) AND (mi_idx.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 21120  			"         ├─ InnerJoin\n" +
 21121  			"         │   ├─ (((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 21122  			"         │   ├─ InnerJoin\n" +
 21123  			"         │   │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 21124  			"         │   │   ├─ InnerJoin\n" +
 21125  			"         │   │   │   ├─ (t.id = mi.movie_id)\n" +
 21126  			"         │   │   │   ├─ InnerJoin\n" +
 21127  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 21128  			"         │   │   │   │   ├─ InnerJoin\n" +
 21129  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 21130  			"         │   │   │   │   │   ├─ Filter\n" +
 21131  			"         │   │   │   │   │   │   ├─ (t.production_year > 2000)\n" +
 21132  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 21133  			"         │   │   │   │   │   │       └─ Table\n" +
 21134  			"         │   │   │   │   │   │           ├─ name: title\n" +
 21135  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 21136  			"         │   │   │   │   │   └─ InnerJoin\n" +
 21137  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 21138  			"         │   │   │   │   │       ├─ Filter\n" +
 21139  			"         │   │   │   │   │       │   ├─ (NOT((cct2.kind = 'complete+verified')))\n" +
 21140  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 21141  			"         │   │   │   │   │       │       └─ Table\n" +
 21142  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 21143  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 21144  			"         │   │   │   │   │       └─ InnerJoin\n" +
 21145  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 21146  			"         │   │   │   │   │           ├─ Filter\n" +
 21147  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'crew')\n" +
 21148  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 21149  			"         │   │   │   │   │           │       └─ Table\n" +
 21150  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 21151  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 21152  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 21153  			"         │   │   │   │   │               └─ Table\n" +
 21154  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 21155  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 21156  			"         │   │   │   │   └─ Filter\n" +
 21157  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 21158  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 21159  			"         │   │   │   │           └─ Table\n" +
 21160  			"         │   │   │   │               ├─ name: kind_type\n" +
 21161  			"         │   │   │   │               └─ columns: [id kind]\n" +
 21162  			"         │   │   │   └─ InnerJoin\n" +
 21163  			"         │   │   │       ├─ (it1.id = mi.info_type_id)\n" +
 21164  			"         │   │   │       ├─ Filter\n" +
 21165  			"         │   │   │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 21166  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 21167  			"         │   │   │       │       └─ Table\n" +
 21168  			"         │   │   │       │           ├─ name: movie_info\n" +
 21169  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 21170  			"         │   │   │       └─ Filter\n" +
 21171  			"         │   │   │           ├─ (it1.info = 'countries')\n" +
 21172  			"         │   │   │           └─ TableAlias(it1)\n" +
 21173  			"         │   │   │               └─ Table\n" +
 21174  			"         │   │   │                   ├─ name: info_type\n" +
 21175  			"         │   │   │                   └─ columns: [id info]\n" +
 21176  			"         │   │   └─ InnerJoin\n" +
 21177  			"         │   │       ├─ (ct.id = mc.company_type_id)\n" +
 21178  			"         │   │       ├─ InnerJoin\n" +
 21179  			"         │   │       │   ├─ (cn.id = mc.company_id)\n" +
 21180  			"         │   │       │   ├─ Filter\n" +
 21181  			"         │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 21182  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 21183  			"         │   │       │   │       └─ Table\n" +
 21184  			"         │   │       │   │           ├─ name: movie_companies\n" +
 21185  			"         │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 21186  			"         │   │       │   └─ Filter\n" +
 21187  			"         │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 21188  			"         │   │       │       └─ TableAlias(cn)\n" +
 21189  			"         │   │       │           └─ Table\n" +
 21190  			"         │   │       │               ├─ name: company_name\n" +
 21191  			"         │   │       │               └─ columns: [id name country_code]\n" +
 21192  			"         │   │       └─ TableAlias(ct)\n" +
 21193  			"         │   │           └─ Table\n" +
 21194  			"         │   │               ├─ name: company_type\n" +
 21195  			"         │   │               └─ columns: [id]\n" +
 21196  			"         │   └─ InnerJoin\n" +
 21197  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 21198  			"         │       ├─ TableAlias(mk)\n" +
 21199  			"         │       │   └─ Table\n" +
 21200  			"         │       │       ├─ name: movie_keyword\n" +
 21201  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 21202  			"         │       └─ Filter\n" +
 21203  			"         │           ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 21204  			"         │           └─ TableAlias(k)\n" +
 21205  			"         │               └─ Table\n" +
 21206  			"         │                   ├─ name: keyword\n" +
 21207  			"         │                   └─ columns: [id keyword]\n" +
 21208  			"         └─ InnerJoin\n" +
 21209  			"             ├─ (it2.id = mi_idx.info_type_id)\n" +
 21210  			"             ├─ Filter\n" +
 21211  			"             │   ├─ (mi_idx.info < '8.5')\n" +
 21212  			"             │   └─ TableAlias(mi_idx)\n" +
 21213  			"             │       └─ Table\n" +
 21214  			"             │           ├─ name: movie_info_idx\n" +
 21215  			"             │           └─ columns: [movie_id info_type_id info]\n" +
 21216  			"             └─ Filter\n" +
 21217  			"                 ├─ (it2.info = 'rating')\n" +
 21218  			"                 └─ TableAlias(it2)\n" +
 21219  			"                     └─ Table\n" +
 21220  			"                         ├─ name: info_type\n" +
 21221  			"                         └─ columns: [id info]\n" +
 21222  			"",
 21223  	},
 21224  	{
 21225  		Query: `
 21226  SELECT MIN(cn.name) AS movie_company,
 21227         MIN(mi_idx.info) AS rating,
 21228         MIN(t.title) AS complete_euro_dark_movie
 21229  FROM complete_cast AS cc,
 21230       comp_cast_type AS cct1,
 21231       comp_cast_type AS cct2,
 21232       company_name AS cn,
 21233       company_type AS ct,
 21234       info_type AS it1,
 21235       info_type AS it2,
 21236       keyword AS k,
 21237       kind_type AS kt,
 21238       movie_companies AS mc,
 21239       movie_info AS mi,
 21240       movie_info_idx AS mi_idx,
 21241       movie_keyword AS mk,
 21242       title AS t
 21243  WHERE cct1.kind = 'crew'
 21244    AND cct2.kind != 'complete+verified'
 21245    AND cn.country_code != '[us]'
 21246    AND it1.info = 'countries'
 21247    AND it2.info = 'rating'
 21248    AND k.keyword IN ('murder',
 21249                      'murder-in-title',
 21250                      'blood',
 21251                      'violence')
 21252    AND kt.kind IN ('movie',
 21253                    'episode')
 21254    AND mc.note NOT LIKE '%(USA)%'
 21255    AND mc.note LIKE '%(200%)%'
 21256    AND mi.info IN ('Sweden',
 21257                    'Germany',
 21258                    'Swedish',
 21259                    'German')
 21260    AND mi_idx.info > '6.5'
 21261    AND t.production_year > 2005
 21262    AND kt.id = t.kind_id
 21263    AND t.id = mi.movie_id
 21264    AND t.id = mk.movie_id
 21265    AND t.id = mi_idx.movie_id
 21266    AND t.id = mc.movie_id
 21267    AND t.id = cc.movie_id
 21268    AND mk.movie_id = mi.movie_id
 21269    AND mk.movie_id = mi_idx.movie_id
 21270    AND mk.movie_id = mc.movie_id
 21271    AND mk.movie_id = cc.movie_id
 21272    AND mi.movie_id = mi_idx.movie_id
 21273    AND mi.movie_id = mc.movie_id
 21274    AND mi.movie_id = cc.movie_id
 21275    AND mc.movie_id = mi_idx.movie_id
 21276    AND mc.movie_id = cc.movie_id
 21277    AND mi_idx.movie_id = cc.movie_id
 21278    AND k.id = mk.keyword_id
 21279    AND it1.id = mi.info_type_id
 21280    AND it2.id = mi_idx.info_type_id
 21281    AND ct.id = mc.company_type_id
 21282    AND cn.id = mc.company_id
 21283    AND cct1.id = cc.subject_id
 21284    AND cct2.id = cc.status_id;
 21285  
 21286  `,
 21287  		ExpectedPlan: "Project\n" +
 21288  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as complete_euro_dark_movie]\n" +
 21289  			" └─ GroupBy\n" +
 21290  			"     ├─ select: MIN(cn.name:23!null), MIN(mi_idx.info:32!null), MIN(t.title:1!null)\n" +
 21291  			"     ├─ group: \n" +
 21292  			"     └─ InnerJoin\n" +
 21293  			"         ├─ AND\n" +
 21294  			"         │   ├─ AND\n" +
 21295  			"         │   │   ├─ AND\n" +
 21296  			"         │   │   │   ├─ AND\n" +
 21297  			"         │   │   │   │   ├─ Eq\n" +
 21298  			"         │   │   │   │   │   ├─ mi.movie_id:13!null\n" +
 21299  			"         │   │   │   │   │   └─ mi_idx.movie_id:30!null\n" +
 21300  			"         │   │   │   │   └─ Eq\n" +
 21301  			"         │   │   │   │       ├─ mc.movie_id:18!null\n" +
 21302  			"         │   │   │   │       └─ mi_idx.movie_id:30!null\n" +
 21303  			"         │   │   │   └─ Eq\n" +
 21304  			"         │   │   │       ├─ mi_idx.movie_id:30!null\n" +
 21305  			"         │   │   │       └─ cc.movie_id:8\n" +
 21306  			"         │   │   └─ Eq\n" +
 21307  			"         │   │       ├─ mk.movie_id:26!null\n" +
 21308  			"         │   │       └─ mi_idx.movie_id:30!null\n" +
 21309  			"         │   └─ Eq\n" +
 21310  			"         │       ├─ t.id:0!null\n" +
 21311  			"         │       └─ mi_idx.movie_id:30!null\n" +
 21312  			"         ├─ InnerJoin\n" +
 21313  			"         │   ├─ AND\n" +
 21314  			"         │   │   ├─ AND\n" +
 21315  			"         │   │   │   ├─ Eq\n" +
 21316  			"         │   │   │   │   ├─ mk.movie_id:26!null\n" +
 21317  			"         │   │   │   │   └─ mi.movie_id:13!null\n" +
 21318  			"         │   │   │   └─ Eq\n" +
 21319  			"         │   │   │       ├─ mk.movie_id:26!null\n" +
 21320  			"         │   │   │       └─ mc.movie_id:18!null\n" +
 21321  			"         │   │   └─ Eq\n" +
 21322  			"         │   │       ├─ t.id:0!null\n" +
 21323  			"         │   │       └─ mk.movie_id:26!null\n" +
 21324  			"         │   ├─ InnerJoin\n" +
 21325  			"         │   │   ├─ AND\n" +
 21326  			"         │   │   │   ├─ Eq\n" +
 21327  			"         │   │   │   │   ├─ mi.movie_id:13!null\n" +
 21328  			"         │   │   │   │   └─ mc.movie_id:18!null\n" +
 21329  			"         │   │   │   └─ Eq\n" +
 21330  			"         │   │   │       ├─ t.id:0!null\n" +
 21331  			"         │   │   │       └─ mc.movie_id:18!null\n" +
 21332  			"         │   │   ├─ InnerJoin\n" +
 21333  			"         │   │   │   ├─ Eq\n" +
 21334  			"         │   │   │   │   ├─ t.id:0!null\n" +
 21335  			"         │   │   │   │   └─ mi.movie_id:13!null\n" +
 21336  			"         │   │   │   ├─ InnerJoin\n" +
 21337  			"         │   │   │   │   ├─ Eq\n" +
 21338  			"         │   │   │   │   │   ├─ kt.id:11!null\n" +
 21339  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 21340  			"         │   │   │   │   ├─ InnerJoin\n" +
 21341  			"         │   │   │   │   │   ├─ Eq\n" +
 21342  			"         │   │   │   │   │   │   ├─ t.id:0!null\n" +
 21343  			"         │   │   │   │   │   │   └─ cc.movie_id:8\n" +
 21344  			"         │   │   │   │   │   ├─ Filter\n" +
 21345  			"         │   │   │   │   │   │   ├─ GreaterThan\n" +
 21346  			"         │   │   │   │   │   │   │   ├─ t.production_year:3\n" +
 21347  			"         │   │   │   │   │   │   │   └─ 2005 (smallint)\n" +
 21348  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 21349  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 21350  			"         │   │   │   │   │   │           └─ Table\n" +
 21351  			"         │   │   │   │   │   │               ├─ name: title\n" +
 21352  			"         │   │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 21353  			"         │   │   │   │   │   └─ InnerJoin\n" +
 21354  			"         │   │   │   │   │       ├─ Eq\n" +
 21355  			"         │   │   │   │   │       │   ├─ cct2.id:4!null\n" +
 21356  			"         │   │   │   │   │       │   └─ cc.status_id:10!null\n" +
 21357  			"         │   │   │   │   │       ├─ Filter\n" +
 21358  			"         │   │   │   │   │       │   ├─ NOT\n" +
 21359  			"         │   │   │   │   │       │   │   └─ Eq\n" +
 21360  			"         │   │   │   │   │       │   │       ├─ cct2.kind:1!null\n" +
 21361  			"         │   │   │   │   │       │   │       └─ complete+verified (longtext)\n" +
 21362  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 21363  			"         │   │   │   │   │       │       └─ ProcessTable\n" +
 21364  			"         │   │   │   │   │       │           └─ Table\n" +
 21365  			"         │   │   │   │   │       │               ├─ name: comp_cast_type\n" +
 21366  			"         │   │   │   │   │       │               └─ columns: [id kind]\n" +
 21367  			"         │   │   │   │   │       └─ InnerJoin\n" +
 21368  			"         │   │   │   │   │           ├─ Eq\n" +
 21369  			"         │   │   │   │   │           │   ├─ cct1.id:6!null\n" +
 21370  			"         │   │   │   │   │           │   └─ cc.subject_id:9!null\n" +
 21371  			"         │   │   │   │   │           ├─ Filter\n" +
 21372  			"         │   │   │   │   │           │   ├─ Eq\n" +
 21373  			"         │   │   │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 21374  			"         │   │   │   │   │           │   │   └─ crew (longtext)\n" +
 21375  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 21376  			"         │   │   │   │   │           │       └─ Table\n" +
 21377  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 21378  			"         │   │   │   │   │           │           ├─ columns: [id kind]\n" +
 21379  			"         │   │   │   │   │           │           ├─ colSet: (5,6)\n" +
 21380  			"         │   │   │   │   │           │           └─ tableId: 2\n" +
 21381  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 21382  			"         │   │   │   │   │               └─ ProcessTable\n" +
 21383  			"         │   │   │   │   │                   └─ Table\n" +
 21384  			"         │   │   │   │   │                       ├─ name: complete_cast\n" +
 21385  			"         │   │   │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 21386  			"         │   │   │   │   └─ Filter\n" +
 21387  			"         │   │   │   │       ├─ HashIn\n" +
 21388  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 21389  			"         │   │   │   │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
 21390  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 21391  			"         │   │   │   │           └─ ProcessTable\n" +
 21392  			"         │   │   │   │               └─ Table\n" +
 21393  			"         │   │   │   │                   ├─ name: kind_type\n" +
 21394  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 21395  			"         │   │   │   └─ InnerJoin\n" +
 21396  			"         │   │   │       ├─ Eq\n" +
 21397  			"         │   │   │       │   ├─ it1.id:16!null\n" +
 21398  			"         │   │   │       │   └─ mi.info_type_id:14!null\n" +
 21399  			"         │   │   │       ├─ Filter\n" +
 21400  			"         │   │   │       │   ├─ HashIn\n" +
 21401  			"         │   │   │       │   │   ├─ mi.info:2!null\n" +
 21402  			"         │   │   │       │   │   └─ TUPLE(Sweden (longtext), Germany (longtext), Swedish (longtext), German (longtext))\n" +
 21403  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 21404  			"         │   │   │       │       └─ ProcessTable\n" +
 21405  			"         │   │   │       │           └─ Table\n" +
 21406  			"         │   │   │       │               ├─ name: movie_info\n" +
 21407  			"         │   │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 21408  			"         │   │   │       └─ Filter\n" +
 21409  			"         │   │   │           ├─ Eq\n" +
 21410  			"         │   │   │           │   ├─ it1.info:1!null\n" +
 21411  			"         │   │   │           │   └─ countries (longtext)\n" +
 21412  			"         │   │   │           └─ TableAlias(it1)\n" +
 21413  			"         │   │   │               └─ ProcessTable\n" +
 21414  			"         │   │   │                   └─ Table\n" +
 21415  			"         │   │   │                       ├─ name: info_type\n" +
 21416  			"         │   │   │                       └─ columns: [id info]\n" +
 21417  			"         │   │   └─ InnerJoin\n" +
 21418  			"         │   │       ├─ Eq\n" +
 21419  			"         │   │       │   ├─ ct.id:25!null\n" +
 21420  			"         │   │       │   └─ mc.company_type_id:20!null\n" +
 21421  			"         │   │       ├─ InnerJoin\n" +
 21422  			"         │   │       │   ├─ Eq\n" +
 21423  			"         │   │       │   │   ├─ cn.id:22!null\n" +
 21424  			"         │   │       │   │   └─ mc.company_id:19!null\n" +
 21425  			"         │   │       │   ├─ Filter\n" +
 21426  			"         │   │       │   │   ├─ AND\n" +
 21427  			"         │   │       │   │   │   ├─ NOT\n" +
 21428  			"         │   │       │   │   │   │   └─ mc.note LIKE '%(USA)%'\n" +
 21429  			"         │   │       │   │   │   └─ mc.note LIKE '%(200%)%'\n" +
 21430  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 21431  			"         │   │       │   │       └─ ProcessTable\n" +
 21432  			"         │   │       │   │           └─ Table\n" +
 21433  			"         │   │       │   │               ├─ name: movie_companies\n" +
 21434  			"         │   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 21435  			"         │   │       │   └─ Filter\n" +
 21436  			"         │   │       │       ├─ NOT\n" +
 21437  			"         │   │       │       │   └─ Eq\n" +
 21438  			"         │   │       │       │       ├─ cn.country_code:2\n" +
 21439  			"         │   │       │       │       └─ [us] (longtext)\n" +
 21440  			"         │   │       │       └─ TableAlias(cn)\n" +
 21441  			"         │   │       │           └─ ProcessTable\n" +
 21442  			"         │   │       │               └─ Table\n" +
 21443  			"         │   │       │                   ├─ name: company_name\n" +
 21444  			"         │   │       │                   └─ columns: [id name country_code]\n" +
 21445  			"         │   │       └─ TableAlias(ct)\n" +
 21446  			"         │   │           └─ ProcessTable\n" +
 21447  			"         │   │               └─ Table\n" +
 21448  			"         │   │                   ├─ name: company_type\n" +
 21449  			"         │   │                   └─ columns: [id]\n" +
 21450  			"         │   └─ InnerJoin\n" +
 21451  			"         │       ├─ Eq\n" +
 21452  			"         │       │   ├─ k.id:28!null\n" +
 21453  			"         │       │   └─ mk.keyword_id:27!null\n" +
 21454  			"         │       ├─ TableAlias(mk)\n" +
 21455  			"         │       │   └─ ProcessTable\n" +
 21456  			"         │       │       └─ Table\n" +
 21457  			"         │       │           ├─ name: movie_keyword\n" +
 21458  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 21459  			"         │       └─ Filter\n" +
 21460  			"         │           ├─ HashIn\n" +
 21461  			"         │           │   ├─ k.keyword:1!null\n" +
 21462  			"         │           │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
 21463  			"         │           └─ TableAlias(k)\n" +
 21464  			"         │               └─ ProcessTable\n" +
 21465  			"         │                   └─ Table\n" +
 21466  			"         │                       ├─ name: keyword\n" +
 21467  			"         │                       └─ columns: [id keyword]\n" +
 21468  			"         └─ InnerJoin\n" +
 21469  			"             ├─ Eq\n" +
 21470  			"             │   ├─ it2.id:33!null\n" +
 21471  			"             │   └─ mi_idx.info_type_id:31!null\n" +
 21472  			"             ├─ Filter\n" +
 21473  			"             │   ├─ GreaterThan\n" +
 21474  			"             │   │   ├─ mi_idx.info:2!null\n" +
 21475  			"             │   │   └─ 6.5 (longtext)\n" +
 21476  			"             │   └─ TableAlias(mi_idx)\n" +
 21477  			"             │       └─ ProcessTable\n" +
 21478  			"             │           └─ Table\n" +
 21479  			"             │               ├─ name: movie_info_idx\n" +
 21480  			"             │               └─ columns: [movie_id info_type_id info]\n" +
 21481  			"             └─ Filter\n" +
 21482  			"                 ├─ Eq\n" +
 21483  			"                 │   ├─ it2.info:1!null\n" +
 21484  			"                 │   └─ rating (longtext)\n" +
 21485  			"                 └─ TableAlias(it2)\n" +
 21486  			"                     └─ Table\n" +
 21487  			"                         ├─ name: info_type\n" +
 21488  			"                         ├─ columns: [id info]\n" +
 21489  			"                         ├─ colSet: (20,21)\n" +
 21490  			"                         └─ tableId: 7\n" +
 21491  			"",
 21492  		ExpectedEstimates: "Project\n" +
 21493  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as complete_euro_dark_movie]\n" +
 21494  			" └─ GroupBy\n" +
 21495  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 21496  			"     ├─ Grouping()\n" +
 21497  			"     └─ InnerJoin\n" +
 21498  			"         ├─ (((((mi.movie_id = mi_idx.movie_id) AND (mc.movie_id = mi_idx.movie_id)) AND (mi_idx.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 21499  			"         ├─ InnerJoin\n" +
 21500  			"         │   ├─ (((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 21501  			"         │   ├─ InnerJoin\n" +
 21502  			"         │   │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 21503  			"         │   │   ├─ InnerJoin\n" +
 21504  			"         │   │   │   ├─ (t.id = mi.movie_id)\n" +
 21505  			"         │   │   │   ├─ InnerJoin\n" +
 21506  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 21507  			"         │   │   │   │   ├─ InnerJoin\n" +
 21508  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 21509  			"         │   │   │   │   │   ├─ Filter\n" +
 21510  			"         │   │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 21511  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 21512  			"         │   │   │   │   │   │       └─ Table\n" +
 21513  			"         │   │   │   │   │   │           ├─ name: title\n" +
 21514  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 21515  			"         │   │   │   │   │   └─ InnerJoin\n" +
 21516  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 21517  			"         │   │   │   │   │       ├─ Filter\n" +
 21518  			"         │   │   │   │   │       │   ├─ (NOT((cct2.kind = 'complete+verified')))\n" +
 21519  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 21520  			"         │   │   │   │   │       │       └─ Table\n" +
 21521  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 21522  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 21523  			"         │   │   │   │   │       └─ InnerJoin\n" +
 21524  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 21525  			"         │   │   │   │   │           ├─ Filter\n" +
 21526  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'crew')\n" +
 21527  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 21528  			"         │   │   │   │   │           │       └─ Table\n" +
 21529  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 21530  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 21531  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 21532  			"         │   │   │   │   │               └─ Table\n" +
 21533  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 21534  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 21535  			"         │   │   │   │   └─ Filter\n" +
 21536  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 21537  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 21538  			"         │   │   │   │           └─ Table\n" +
 21539  			"         │   │   │   │               ├─ name: kind_type\n" +
 21540  			"         │   │   │   │               └─ columns: [id kind]\n" +
 21541  			"         │   │   │   └─ InnerJoin\n" +
 21542  			"         │   │   │       ├─ (it1.id = mi.info_type_id)\n" +
 21543  			"         │   │   │       ├─ Filter\n" +
 21544  			"         │   │   │       │   ├─ (mi.info HASH IN ('Sweden', 'Germany', 'Swedish', 'German'))\n" +
 21545  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 21546  			"         │   │   │       │       └─ Table\n" +
 21547  			"         │   │   │       │           ├─ name: movie_info\n" +
 21548  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 21549  			"         │   │   │       └─ Filter\n" +
 21550  			"         │   │   │           ├─ (it1.info = 'countries')\n" +
 21551  			"         │   │   │           └─ TableAlias(it1)\n" +
 21552  			"         │   │   │               └─ Table\n" +
 21553  			"         │   │   │                   ├─ name: info_type\n" +
 21554  			"         │   │   │                   └─ columns: [id info]\n" +
 21555  			"         │   │   └─ InnerJoin\n" +
 21556  			"         │   │       ├─ (ct.id = mc.company_type_id)\n" +
 21557  			"         │   │       ├─ InnerJoin\n" +
 21558  			"         │   │       │   ├─ (cn.id = mc.company_id)\n" +
 21559  			"         │   │       │   ├─ Filter\n" +
 21560  			"         │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 21561  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 21562  			"         │   │       │   │       └─ Table\n" +
 21563  			"         │   │       │   │           ├─ name: movie_companies\n" +
 21564  			"         │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 21565  			"         │   │       │   └─ Filter\n" +
 21566  			"         │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 21567  			"         │   │       │       └─ TableAlias(cn)\n" +
 21568  			"         │   │       │           └─ Table\n" +
 21569  			"         │   │       │               ├─ name: company_name\n" +
 21570  			"         │   │       │               └─ columns: [id name country_code]\n" +
 21571  			"         │   │       └─ TableAlias(ct)\n" +
 21572  			"         │   │           └─ Table\n" +
 21573  			"         │   │               ├─ name: company_type\n" +
 21574  			"         │   │               └─ columns: [id]\n" +
 21575  			"         │   └─ InnerJoin\n" +
 21576  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 21577  			"         │       ├─ TableAlias(mk)\n" +
 21578  			"         │       │   └─ Table\n" +
 21579  			"         │       │       ├─ name: movie_keyword\n" +
 21580  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 21581  			"         │       └─ Filter\n" +
 21582  			"         │           ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 21583  			"         │           └─ TableAlias(k)\n" +
 21584  			"         │               └─ Table\n" +
 21585  			"         │                   ├─ name: keyword\n" +
 21586  			"         │                   └─ columns: [id keyword]\n" +
 21587  			"         └─ InnerJoin\n" +
 21588  			"             ├─ (it2.id = mi_idx.info_type_id)\n" +
 21589  			"             ├─ Filter\n" +
 21590  			"             │   ├─ (mi_idx.info > '6.5')\n" +
 21591  			"             │   └─ TableAlias(mi_idx)\n" +
 21592  			"             │       └─ Table\n" +
 21593  			"             │           ├─ name: movie_info_idx\n" +
 21594  			"             │           └─ columns: [movie_id info_type_id info]\n" +
 21595  			"             └─ Filter\n" +
 21596  			"                 ├─ (it2.info = 'rating')\n" +
 21597  			"                 └─ TableAlias(it2)\n" +
 21598  			"                     └─ Table\n" +
 21599  			"                         ├─ name: info_type\n" +
 21600  			"                         └─ columns: [id info]\n" +
 21601  			"",
 21602  		ExpectedAnalysis: "Project\n" +
 21603  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as complete_euro_dark_movie]\n" +
 21604  			" └─ GroupBy\n" +
 21605  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 21606  			"     ├─ Grouping()\n" +
 21607  			"     └─ InnerJoin\n" +
 21608  			"         ├─ (((((mi.movie_id = mi_idx.movie_id) AND (mc.movie_id = mi_idx.movie_id)) AND (mi_idx.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 21609  			"         ├─ InnerJoin\n" +
 21610  			"         │   ├─ (((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 21611  			"         │   ├─ InnerJoin\n" +
 21612  			"         │   │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 21613  			"         │   │   ├─ InnerJoin\n" +
 21614  			"         │   │   │   ├─ (t.id = mi.movie_id)\n" +
 21615  			"         │   │   │   ├─ InnerJoin\n" +
 21616  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 21617  			"         │   │   │   │   ├─ InnerJoin\n" +
 21618  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 21619  			"         │   │   │   │   │   ├─ Filter\n" +
 21620  			"         │   │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 21621  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 21622  			"         │   │   │   │   │   │       └─ Table\n" +
 21623  			"         │   │   │   │   │   │           ├─ name: title\n" +
 21624  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 21625  			"         │   │   │   │   │   └─ InnerJoin\n" +
 21626  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 21627  			"         │   │   │   │   │       ├─ Filter\n" +
 21628  			"         │   │   │   │   │       │   ├─ (NOT((cct2.kind = 'complete+verified')))\n" +
 21629  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 21630  			"         │   │   │   │   │       │       └─ Table\n" +
 21631  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 21632  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 21633  			"         │   │   │   │   │       └─ InnerJoin\n" +
 21634  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 21635  			"         │   │   │   │   │           ├─ Filter\n" +
 21636  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'crew')\n" +
 21637  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 21638  			"         │   │   │   │   │           │       └─ Table\n" +
 21639  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 21640  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 21641  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 21642  			"         │   │   │   │   │               └─ Table\n" +
 21643  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 21644  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 21645  			"         │   │   │   │   └─ Filter\n" +
 21646  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 21647  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 21648  			"         │   │   │   │           └─ Table\n" +
 21649  			"         │   │   │   │               ├─ name: kind_type\n" +
 21650  			"         │   │   │   │               └─ columns: [id kind]\n" +
 21651  			"         │   │   │   └─ InnerJoin\n" +
 21652  			"         │   │   │       ├─ (it1.id = mi.info_type_id)\n" +
 21653  			"         │   │   │       ├─ Filter\n" +
 21654  			"         │   │   │       │   ├─ (mi.info HASH IN ('Sweden', 'Germany', 'Swedish', 'German'))\n" +
 21655  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 21656  			"         │   │   │       │       └─ Table\n" +
 21657  			"         │   │   │       │           ├─ name: movie_info\n" +
 21658  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 21659  			"         │   │   │       └─ Filter\n" +
 21660  			"         │   │   │           ├─ (it1.info = 'countries')\n" +
 21661  			"         │   │   │           └─ TableAlias(it1)\n" +
 21662  			"         │   │   │               └─ Table\n" +
 21663  			"         │   │   │                   ├─ name: info_type\n" +
 21664  			"         │   │   │                   └─ columns: [id info]\n" +
 21665  			"         │   │   └─ InnerJoin\n" +
 21666  			"         │   │       ├─ (ct.id = mc.company_type_id)\n" +
 21667  			"         │   │       ├─ InnerJoin\n" +
 21668  			"         │   │       │   ├─ (cn.id = mc.company_id)\n" +
 21669  			"         │   │       │   ├─ Filter\n" +
 21670  			"         │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 21671  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 21672  			"         │   │       │   │       └─ Table\n" +
 21673  			"         │   │       │   │           ├─ name: movie_companies\n" +
 21674  			"         │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 21675  			"         │   │       │   └─ Filter\n" +
 21676  			"         │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 21677  			"         │   │       │       └─ TableAlias(cn)\n" +
 21678  			"         │   │       │           └─ Table\n" +
 21679  			"         │   │       │               ├─ name: company_name\n" +
 21680  			"         │   │       │               └─ columns: [id name country_code]\n" +
 21681  			"         │   │       └─ TableAlias(ct)\n" +
 21682  			"         │   │           └─ Table\n" +
 21683  			"         │   │               ├─ name: company_type\n" +
 21684  			"         │   │               └─ columns: [id]\n" +
 21685  			"         │   └─ InnerJoin\n" +
 21686  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 21687  			"         │       ├─ TableAlias(mk)\n" +
 21688  			"         │       │   └─ Table\n" +
 21689  			"         │       │       ├─ name: movie_keyword\n" +
 21690  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 21691  			"         │       └─ Filter\n" +
 21692  			"         │           ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 21693  			"         │           └─ TableAlias(k)\n" +
 21694  			"         │               └─ Table\n" +
 21695  			"         │                   ├─ name: keyword\n" +
 21696  			"         │                   └─ columns: [id keyword]\n" +
 21697  			"         └─ InnerJoin\n" +
 21698  			"             ├─ (it2.id = mi_idx.info_type_id)\n" +
 21699  			"             ├─ Filter\n" +
 21700  			"             │   ├─ (mi_idx.info > '6.5')\n" +
 21701  			"             │   └─ TableAlias(mi_idx)\n" +
 21702  			"             │       └─ Table\n" +
 21703  			"             │           ├─ name: movie_info_idx\n" +
 21704  			"             │           └─ columns: [movie_id info_type_id info]\n" +
 21705  			"             └─ Filter\n" +
 21706  			"                 ├─ (it2.info = 'rating')\n" +
 21707  			"                 └─ TableAlias(it2)\n" +
 21708  			"                     └─ Table\n" +
 21709  			"                         ├─ name: info_type\n" +
 21710  			"                         └─ columns: [id info]\n" +
 21711  			"",
 21712  	},
 21713  	{
 21714  		Query: `
 21715  SELECT MIN(cn.name) AS movie_company,
 21716         MIN(mi_idx.info) AS rating,
 21717         MIN(t.title) AS complete_euro_dark_movie
 21718  FROM complete_cast AS cc,
 21719       comp_cast_type AS cct1,
 21720       comp_cast_type AS cct2,
 21721       company_name AS cn,
 21722       company_type AS ct,
 21723       info_type AS it1,
 21724       info_type AS it2,
 21725       keyword AS k,
 21726       kind_type AS kt,
 21727       movie_companies AS mc,
 21728       movie_info AS mi,
 21729       movie_info_idx AS mi_idx,
 21730       movie_keyword AS mk,
 21731       title AS t
 21732  WHERE cct1.kind = 'cast'
 21733    AND cct2.kind = 'complete'
 21734    AND cn.country_code != '[us]'
 21735    AND it1.info = 'countries'
 21736    AND it2.info = 'rating'
 21737    AND k.keyword IN ('murder',
 21738                      'murder-in-title',
 21739                      'blood',
 21740                      'violence')
 21741    AND kt.kind IN ('movie',
 21742                    'episode')
 21743    AND mc.note NOT LIKE '%(USA)%'
 21744    AND mc.note LIKE '%(200%)%'
 21745    AND mi.info IN ('Sweden',
 21746                    'Norway',
 21747                    'Germany',
 21748                    'Denmark',
 21749                    'Swedish',
 21750                    'Danish',
 21751                    'Norwegian',
 21752                    'German',
 21753                    'USA',
 21754                    'American')
 21755    AND mi_idx.info < '8.5'
 21756    AND t.production_year > 2005
 21757    AND kt.id = t.kind_id
 21758    AND t.id = mi.movie_id
 21759    AND t.id = mk.movie_id
 21760    AND t.id = mi_idx.movie_id
 21761    AND t.id = mc.movie_id
 21762    AND t.id = cc.movie_id
 21763    AND mk.movie_id = mi.movie_id
 21764    AND mk.movie_id = mi_idx.movie_id
 21765    AND mk.movie_id = mc.movie_id
 21766    AND mk.movie_id = cc.movie_id
 21767    AND mi.movie_id = mi_idx.movie_id
 21768    AND mi.movie_id = mc.movie_id
 21769    AND mi.movie_id = cc.movie_id
 21770    AND mc.movie_id = mi_idx.movie_id
 21771    AND mc.movie_id = cc.movie_id
 21772    AND mi_idx.movie_id = cc.movie_id
 21773    AND k.id = mk.keyword_id
 21774    AND it1.id = mi.info_type_id
 21775    AND it2.id = mi_idx.info_type_id
 21776    AND ct.id = mc.company_type_id
 21777    AND cn.id = mc.company_id
 21778    AND cct1.id = cc.subject_id
 21779    AND cct2.id = cc.status_id;
 21780  
 21781  `,
 21782  		ExpectedPlan: "Project\n" +
 21783  			" ├─ columns: [min(cn.name):0!null as movie_company, min(mi_idx.info):1!null as rating, min(t.title):2!null as complete_euro_dark_movie]\n" +
 21784  			" └─ GroupBy\n" +
 21785  			"     ├─ select: MIN(cn.name:23!null), MIN(mi_idx.info:32!null), MIN(t.title:1!null)\n" +
 21786  			"     ├─ group: \n" +
 21787  			"     └─ InnerJoin\n" +
 21788  			"         ├─ AND\n" +
 21789  			"         │   ├─ AND\n" +
 21790  			"         │   │   ├─ AND\n" +
 21791  			"         │   │   │   ├─ AND\n" +
 21792  			"         │   │   │   │   ├─ Eq\n" +
 21793  			"         │   │   │   │   │   ├─ mi.movie_id:13!null\n" +
 21794  			"         │   │   │   │   │   └─ mi_idx.movie_id:30!null\n" +
 21795  			"         │   │   │   │   └─ Eq\n" +
 21796  			"         │   │   │   │       ├─ mc.movie_id:18!null\n" +
 21797  			"         │   │   │   │       └─ mi_idx.movie_id:30!null\n" +
 21798  			"         │   │   │   └─ Eq\n" +
 21799  			"         │   │   │       ├─ mi_idx.movie_id:30!null\n" +
 21800  			"         │   │   │       └─ cc.movie_id:8\n" +
 21801  			"         │   │   └─ Eq\n" +
 21802  			"         │   │       ├─ mk.movie_id:26!null\n" +
 21803  			"         │   │       └─ mi_idx.movie_id:30!null\n" +
 21804  			"         │   └─ Eq\n" +
 21805  			"         │       ├─ t.id:0!null\n" +
 21806  			"         │       └─ mi_idx.movie_id:30!null\n" +
 21807  			"         ├─ InnerJoin\n" +
 21808  			"         │   ├─ AND\n" +
 21809  			"         │   │   ├─ AND\n" +
 21810  			"         │   │   │   ├─ Eq\n" +
 21811  			"         │   │   │   │   ├─ mk.movie_id:26!null\n" +
 21812  			"         │   │   │   │   └─ mi.movie_id:13!null\n" +
 21813  			"         │   │   │   └─ Eq\n" +
 21814  			"         │   │   │       ├─ mk.movie_id:26!null\n" +
 21815  			"         │   │   │       └─ mc.movie_id:18!null\n" +
 21816  			"         │   │   └─ Eq\n" +
 21817  			"         │   │       ├─ t.id:0!null\n" +
 21818  			"         │   │       └─ mk.movie_id:26!null\n" +
 21819  			"         │   ├─ InnerJoin\n" +
 21820  			"         │   │   ├─ AND\n" +
 21821  			"         │   │   │   ├─ Eq\n" +
 21822  			"         │   │   │   │   ├─ mi.movie_id:13!null\n" +
 21823  			"         │   │   │   │   └─ mc.movie_id:18!null\n" +
 21824  			"         │   │   │   └─ Eq\n" +
 21825  			"         │   │   │       ├─ t.id:0!null\n" +
 21826  			"         │   │   │       └─ mc.movie_id:18!null\n" +
 21827  			"         │   │   ├─ InnerJoin\n" +
 21828  			"         │   │   │   ├─ Eq\n" +
 21829  			"         │   │   │   │   ├─ t.id:0!null\n" +
 21830  			"         │   │   │   │   └─ mi.movie_id:13!null\n" +
 21831  			"         │   │   │   ├─ InnerJoin\n" +
 21832  			"         │   │   │   │   ├─ Eq\n" +
 21833  			"         │   │   │   │   │   ├─ kt.id:11!null\n" +
 21834  			"         │   │   │   │   │   └─ t.kind_id:2!null\n" +
 21835  			"         │   │   │   │   ├─ InnerJoin\n" +
 21836  			"         │   │   │   │   │   ├─ Eq\n" +
 21837  			"         │   │   │   │   │   │   ├─ t.id:0!null\n" +
 21838  			"         │   │   │   │   │   │   └─ cc.movie_id:8\n" +
 21839  			"         │   │   │   │   │   ├─ Filter\n" +
 21840  			"         │   │   │   │   │   │   ├─ GreaterThan\n" +
 21841  			"         │   │   │   │   │   │   │   ├─ t.production_year:3\n" +
 21842  			"         │   │   │   │   │   │   │   └─ 2005 (smallint)\n" +
 21843  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 21844  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 21845  			"         │   │   │   │   │   │           └─ Table\n" +
 21846  			"         │   │   │   │   │   │               ├─ name: title\n" +
 21847  			"         │   │   │   │   │   │               └─ columns: [id title kind_id production_year]\n" +
 21848  			"         │   │   │   │   │   └─ InnerJoin\n" +
 21849  			"         │   │   │   │   │       ├─ Eq\n" +
 21850  			"         │   │   │   │   │       │   ├─ cct2.id:4!null\n" +
 21851  			"         │   │   │   │   │       │   └─ cc.status_id:10!null\n" +
 21852  			"         │   │   │   │   │       ├─ Filter\n" +
 21853  			"         │   │   │   │   │       │   ├─ Eq\n" +
 21854  			"         │   │   │   │   │       │   │   ├─ cct2.kind:1!null\n" +
 21855  			"         │   │   │   │   │       │   │   └─ complete (longtext)\n" +
 21856  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 21857  			"         │   │   │   │   │       │       └─ ProcessTable\n" +
 21858  			"         │   │   │   │   │       │           └─ Table\n" +
 21859  			"         │   │   │   │   │       │               ├─ name: comp_cast_type\n" +
 21860  			"         │   │   │   │   │       │               └─ columns: [id kind]\n" +
 21861  			"         │   │   │   │   │       └─ InnerJoin\n" +
 21862  			"         │   │   │   │   │           ├─ Eq\n" +
 21863  			"         │   │   │   │   │           │   ├─ cct1.id:6!null\n" +
 21864  			"         │   │   │   │   │           │   └─ cc.subject_id:9!null\n" +
 21865  			"         │   │   │   │   │           ├─ Filter\n" +
 21866  			"         │   │   │   │   │           │   ├─ Eq\n" +
 21867  			"         │   │   │   │   │           │   │   ├─ cct1.kind:1!null\n" +
 21868  			"         │   │   │   │   │           │   │   └─ cast (longtext)\n" +
 21869  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 21870  			"         │   │   │   │   │           │       └─ Table\n" +
 21871  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 21872  			"         │   │   │   │   │           │           ├─ columns: [id kind]\n" +
 21873  			"         │   │   │   │   │           │           ├─ colSet: (5,6)\n" +
 21874  			"         │   │   │   │   │           │           └─ tableId: 2\n" +
 21875  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 21876  			"         │   │   │   │   │               └─ ProcessTable\n" +
 21877  			"         │   │   │   │   │                   └─ Table\n" +
 21878  			"         │   │   │   │   │                       ├─ name: complete_cast\n" +
 21879  			"         │   │   │   │   │                       └─ columns: [movie_id subject_id status_id]\n" +
 21880  			"         │   │   │   │   └─ Filter\n" +
 21881  			"         │   │   │   │       ├─ HashIn\n" +
 21882  			"         │   │   │   │       │   ├─ kt.kind:1!null\n" +
 21883  			"         │   │   │   │       │   └─ TUPLE(movie (longtext), episode (longtext))\n" +
 21884  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 21885  			"         │   │   │   │           └─ ProcessTable\n" +
 21886  			"         │   │   │   │               └─ Table\n" +
 21887  			"         │   │   │   │                   ├─ name: kind_type\n" +
 21888  			"         │   │   │   │                   └─ columns: [id kind]\n" +
 21889  			"         │   │   │   └─ InnerJoin\n" +
 21890  			"         │   │   │       ├─ Eq\n" +
 21891  			"         │   │   │       │   ├─ it1.id:16!null\n" +
 21892  			"         │   │   │       │   └─ mi.info_type_id:14!null\n" +
 21893  			"         │   │   │       ├─ Filter\n" +
 21894  			"         │   │   │       │   ├─ HashIn\n" +
 21895  			"         │   │   │       │   │   ├─ mi.info:2!null\n" +
 21896  			"         │   │   │       │   │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Danish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 21897  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 21898  			"         │   │   │       │       └─ ProcessTable\n" +
 21899  			"         │   │   │       │           └─ Table\n" +
 21900  			"         │   │   │       │               ├─ name: movie_info\n" +
 21901  			"         │   │   │       │               └─ columns: [movie_id info_type_id info]\n" +
 21902  			"         │   │   │       └─ Filter\n" +
 21903  			"         │   │   │           ├─ Eq\n" +
 21904  			"         │   │   │           │   ├─ it1.info:1!null\n" +
 21905  			"         │   │   │           │   └─ countries (longtext)\n" +
 21906  			"         │   │   │           └─ TableAlias(it1)\n" +
 21907  			"         │   │   │               └─ ProcessTable\n" +
 21908  			"         │   │   │                   └─ Table\n" +
 21909  			"         │   │   │                       ├─ name: info_type\n" +
 21910  			"         │   │   │                       └─ columns: [id info]\n" +
 21911  			"         │   │   └─ InnerJoin\n" +
 21912  			"         │   │       ├─ Eq\n" +
 21913  			"         │   │       │   ├─ ct.id:25!null\n" +
 21914  			"         │   │       │   └─ mc.company_type_id:20!null\n" +
 21915  			"         │   │       ├─ InnerJoin\n" +
 21916  			"         │   │       │   ├─ Eq\n" +
 21917  			"         │   │       │   │   ├─ cn.id:22!null\n" +
 21918  			"         │   │       │   │   └─ mc.company_id:19!null\n" +
 21919  			"         │   │       │   ├─ Filter\n" +
 21920  			"         │   │       │   │   ├─ AND\n" +
 21921  			"         │   │       │   │   │   ├─ NOT\n" +
 21922  			"         │   │       │   │   │   │   └─ mc.note LIKE '%(USA)%'\n" +
 21923  			"         │   │       │   │   │   └─ mc.note LIKE '%(200%)%'\n" +
 21924  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 21925  			"         │   │       │   │       └─ ProcessTable\n" +
 21926  			"         │   │       │   │           └─ Table\n" +
 21927  			"         │   │       │   │               ├─ name: movie_companies\n" +
 21928  			"         │   │       │   │               └─ columns: [movie_id company_id company_type_id note]\n" +
 21929  			"         │   │       │   └─ Filter\n" +
 21930  			"         │   │       │       ├─ NOT\n" +
 21931  			"         │   │       │       │   └─ Eq\n" +
 21932  			"         │   │       │       │       ├─ cn.country_code:2\n" +
 21933  			"         │   │       │       │       └─ [us] (longtext)\n" +
 21934  			"         │   │       │       └─ TableAlias(cn)\n" +
 21935  			"         │   │       │           └─ ProcessTable\n" +
 21936  			"         │   │       │               └─ Table\n" +
 21937  			"         │   │       │                   ├─ name: company_name\n" +
 21938  			"         │   │       │                   └─ columns: [id name country_code]\n" +
 21939  			"         │   │       └─ TableAlias(ct)\n" +
 21940  			"         │   │           └─ ProcessTable\n" +
 21941  			"         │   │               └─ Table\n" +
 21942  			"         │   │                   ├─ name: company_type\n" +
 21943  			"         │   │                   └─ columns: [id]\n" +
 21944  			"         │   └─ InnerJoin\n" +
 21945  			"         │       ├─ Eq\n" +
 21946  			"         │       │   ├─ k.id:28!null\n" +
 21947  			"         │       │   └─ mk.keyword_id:27!null\n" +
 21948  			"         │       ├─ TableAlias(mk)\n" +
 21949  			"         │       │   └─ ProcessTable\n" +
 21950  			"         │       │       └─ Table\n" +
 21951  			"         │       │           ├─ name: movie_keyword\n" +
 21952  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 21953  			"         │       └─ Filter\n" +
 21954  			"         │           ├─ HashIn\n" +
 21955  			"         │           │   ├─ k.keyword:1!null\n" +
 21956  			"         │           │   └─ TUPLE(murder (longtext), murder-in-title (longtext), blood (longtext), violence (longtext))\n" +
 21957  			"         │           └─ TableAlias(k)\n" +
 21958  			"         │               └─ ProcessTable\n" +
 21959  			"         │                   └─ Table\n" +
 21960  			"         │                       ├─ name: keyword\n" +
 21961  			"         │                       └─ columns: [id keyword]\n" +
 21962  			"         └─ InnerJoin\n" +
 21963  			"             ├─ Eq\n" +
 21964  			"             │   ├─ it2.id:33!null\n" +
 21965  			"             │   └─ mi_idx.info_type_id:31!null\n" +
 21966  			"             ├─ Filter\n" +
 21967  			"             │   ├─ LessThan\n" +
 21968  			"             │   │   ├─ mi_idx.info:2!null\n" +
 21969  			"             │   │   └─ 8.5 (longtext)\n" +
 21970  			"             │   └─ TableAlias(mi_idx)\n" +
 21971  			"             │       └─ ProcessTable\n" +
 21972  			"             │           └─ Table\n" +
 21973  			"             │               ├─ name: movie_info_idx\n" +
 21974  			"             │               └─ columns: [movie_id info_type_id info]\n" +
 21975  			"             └─ Filter\n" +
 21976  			"                 ├─ Eq\n" +
 21977  			"                 │   ├─ it2.info:1!null\n" +
 21978  			"                 │   └─ rating (longtext)\n" +
 21979  			"                 └─ TableAlias(it2)\n" +
 21980  			"                     └─ Table\n" +
 21981  			"                         ├─ name: info_type\n" +
 21982  			"                         ├─ columns: [id info]\n" +
 21983  			"                         ├─ colSet: (20,21)\n" +
 21984  			"                         └─ tableId: 7\n" +
 21985  			"",
 21986  		ExpectedEstimates: "Project\n" +
 21987  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as complete_euro_dark_movie]\n" +
 21988  			" └─ GroupBy\n" +
 21989  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 21990  			"     ├─ Grouping()\n" +
 21991  			"     └─ InnerJoin\n" +
 21992  			"         ├─ (((((mi.movie_id = mi_idx.movie_id) AND (mc.movie_id = mi_idx.movie_id)) AND (mi_idx.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 21993  			"         ├─ InnerJoin\n" +
 21994  			"         │   ├─ (((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 21995  			"         │   ├─ InnerJoin\n" +
 21996  			"         │   │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 21997  			"         │   │   ├─ InnerJoin\n" +
 21998  			"         │   │   │   ├─ (t.id = mi.movie_id)\n" +
 21999  			"         │   │   │   ├─ InnerJoin\n" +
 22000  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 22001  			"         │   │   │   │   ├─ InnerJoin\n" +
 22002  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 22003  			"         │   │   │   │   │   ├─ Filter\n" +
 22004  			"         │   │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 22005  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 22006  			"         │   │   │   │   │   │       └─ Table\n" +
 22007  			"         │   │   │   │   │   │           ├─ name: title\n" +
 22008  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 22009  			"         │   │   │   │   │   └─ InnerJoin\n" +
 22010  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 22011  			"         │   │   │   │   │       ├─ Filter\n" +
 22012  			"         │   │   │   │   │       │   ├─ (cct2.kind = 'complete')\n" +
 22013  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 22014  			"         │   │   │   │   │       │       └─ Table\n" +
 22015  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 22016  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 22017  			"         │   │   │   │   │       └─ InnerJoin\n" +
 22018  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 22019  			"         │   │   │   │   │           ├─ Filter\n" +
 22020  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 22021  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 22022  			"         │   │   │   │   │           │       └─ Table\n" +
 22023  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 22024  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 22025  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 22026  			"         │   │   │   │   │               └─ Table\n" +
 22027  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 22028  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 22029  			"         │   │   │   │   └─ Filter\n" +
 22030  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 22031  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 22032  			"         │   │   │   │           └─ Table\n" +
 22033  			"         │   │   │   │               ├─ name: kind_type\n" +
 22034  			"         │   │   │   │               └─ columns: [id kind]\n" +
 22035  			"         │   │   │   └─ InnerJoin\n" +
 22036  			"         │   │   │       ├─ (it1.id = mi.info_type_id)\n" +
 22037  			"         │   │   │       ├─ Filter\n" +
 22038  			"         │   │   │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 22039  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 22040  			"         │   │   │       │       └─ Table\n" +
 22041  			"         │   │   │       │           ├─ name: movie_info\n" +
 22042  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 22043  			"         │   │   │       └─ Filter\n" +
 22044  			"         │   │   │           ├─ (it1.info = 'countries')\n" +
 22045  			"         │   │   │           └─ TableAlias(it1)\n" +
 22046  			"         │   │   │               └─ Table\n" +
 22047  			"         │   │   │                   ├─ name: info_type\n" +
 22048  			"         │   │   │                   └─ columns: [id info]\n" +
 22049  			"         │   │   └─ InnerJoin\n" +
 22050  			"         │   │       ├─ (ct.id = mc.company_type_id)\n" +
 22051  			"         │   │       ├─ InnerJoin\n" +
 22052  			"         │   │       │   ├─ (cn.id = mc.company_id)\n" +
 22053  			"         │   │       │   ├─ Filter\n" +
 22054  			"         │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 22055  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 22056  			"         │   │       │   │       └─ Table\n" +
 22057  			"         │   │       │   │           ├─ name: movie_companies\n" +
 22058  			"         │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 22059  			"         │   │       │   └─ Filter\n" +
 22060  			"         │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 22061  			"         │   │       │       └─ TableAlias(cn)\n" +
 22062  			"         │   │       │           └─ Table\n" +
 22063  			"         │   │       │               ├─ name: company_name\n" +
 22064  			"         │   │       │               └─ columns: [id name country_code]\n" +
 22065  			"         │   │       └─ TableAlias(ct)\n" +
 22066  			"         │   │           └─ Table\n" +
 22067  			"         │   │               ├─ name: company_type\n" +
 22068  			"         │   │               └─ columns: [id]\n" +
 22069  			"         │   └─ InnerJoin\n" +
 22070  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 22071  			"         │       ├─ TableAlias(mk)\n" +
 22072  			"         │       │   └─ Table\n" +
 22073  			"         │       │       ├─ name: movie_keyword\n" +
 22074  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 22075  			"         │       └─ Filter\n" +
 22076  			"         │           ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 22077  			"         │           └─ TableAlias(k)\n" +
 22078  			"         │               └─ Table\n" +
 22079  			"         │                   ├─ name: keyword\n" +
 22080  			"         │                   └─ columns: [id keyword]\n" +
 22081  			"         └─ InnerJoin\n" +
 22082  			"             ├─ (it2.id = mi_idx.info_type_id)\n" +
 22083  			"             ├─ Filter\n" +
 22084  			"             │   ├─ (mi_idx.info < '8.5')\n" +
 22085  			"             │   └─ TableAlias(mi_idx)\n" +
 22086  			"             │       └─ Table\n" +
 22087  			"             │           ├─ name: movie_info_idx\n" +
 22088  			"             │           └─ columns: [movie_id info_type_id info]\n" +
 22089  			"             └─ Filter\n" +
 22090  			"                 ├─ (it2.info = 'rating')\n" +
 22091  			"                 └─ TableAlias(it2)\n" +
 22092  			"                     └─ Table\n" +
 22093  			"                         ├─ name: info_type\n" +
 22094  			"                         └─ columns: [id info]\n" +
 22095  			"",
 22096  		ExpectedAnalysis: "Project\n" +
 22097  			" ├─ columns: [min(cn.name) as movie_company, min(mi_idx.info) as rating, min(t.title) as complete_euro_dark_movie]\n" +
 22098  			" └─ GroupBy\n" +
 22099  			"     ├─ SelectedExprs(MIN(cn.name), MIN(mi_idx.info), MIN(t.title))\n" +
 22100  			"     ├─ Grouping()\n" +
 22101  			"     └─ InnerJoin\n" +
 22102  			"         ├─ (((((mi.movie_id = mi_idx.movie_id) AND (mc.movie_id = mi_idx.movie_id)) AND (mi_idx.movie_id = cc.movie_id)) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mi_idx.movie_id))\n" +
 22103  			"         ├─ InnerJoin\n" +
 22104  			"         │   ├─ (((mk.movie_id = mi.movie_id) AND (mk.movie_id = mc.movie_id)) AND (t.id = mk.movie_id))\n" +
 22105  			"         │   ├─ InnerJoin\n" +
 22106  			"         │   │   ├─ ((mi.movie_id = mc.movie_id) AND (t.id = mc.movie_id))\n" +
 22107  			"         │   │   ├─ InnerJoin\n" +
 22108  			"         │   │   │   ├─ (t.id = mi.movie_id)\n" +
 22109  			"         │   │   │   ├─ InnerJoin\n" +
 22110  			"         │   │   │   │   ├─ (kt.id = t.kind_id)\n" +
 22111  			"         │   │   │   │   ├─ InnerJoin\n" +
 22112  			"         │   │   │   │   │   ├─ (t.id = cc.movie_id)\n" +
 22113  			"         │   │   │   │   │   ├─ Filter\n" +
 22114  			"         │   │   │   │   │   │   ├─ (t.production_year > 2005)\n" +
 22115  			"         │   │   │   │   │   │   └─ TableAlias(t)\n" +
 22116  			"         │   │   │   │   │   │       └─ Table\n" +
 22117  			"         │   │   │   │   │   │           ├─ name: title\n" +
 22118  			"         │   │   │   │   │   │           └─ columns: [id title kind_id production_year]\n" +
 22119  			"         │   │   │   │   │   └─ InnerJoin\n" +
 22120  			"         │   │   │   │   │       ├─ (cct2.id = cc.status_id)\n" +
 22121  			"         │   │   │   │   │       ├─ Filter\n" +
 22122  			"         │   │   │   │   │       │   ├─ (cct2.kind = 'complete')\n" +
 22123  			"         │   │   │   │   │       │   └─ TableAlias(cct2)\n" +
 22124  			"         │   │   │   │   │       │       └─ Table\n" +
 22125  			"         │   │   │   │   │       │           ├─ name: comp_cast_type\n" +
 22126  			"         │   │   │   │   │       │           └─ columns: [id kind]\n" +
 22127  			"         │   │   │   │   │       └─ InnerJoin\n" +
 22128  			"         │   │   │   │   │           ├─ (cct1.id = cc.subject_id)\n" +
 22129  			"         │   │   │   │   │           ├─ Filter\n" +
 22130  			"         │   │   │   │   │           │   ├─ (cct1.kind = 'cast')\n" +
 22131  			"         │   │   │   │   │           │   └─ TableAlias(cct1)\n" +
 22132  			"         │   │   │   │   │           │       └─ Table\n" +
 22133  			"         │   │   │   │   │           │           ├─ name: comp_cast_type\n" +
 22134  			"         │   │   │   │   │           │           └─ columns: [id kind]\n" +
 22135  			"         │   │   │   │   │           └─ TableAlias(cc)\n" +
 22136  			"         │   │   │   │   │               └─ Table\n" +
 22137  			"         │   │   │   │   │                   ├─ name: complete_cast\n" +
 22138  			"         │   │   │   │   │                   └─ columns: [movie_id subject_id status_id]\n" +
 22139  			"         │   │   │   │   └─ Filter\n" +
 22140  			"         │   │   │   │       ├─ (kt.kind HASH IN ('movie', 'episode'))\n" +
 22141  			"         │   │   │   │       └─ TableAlias(kt)\n" +
 22142  			"         │   │   │   │           └─ Table\n" +
 22143  			"         │   │   │   │               ├─ name: kind_type\n" +
 22144  			"         │   │   │   │               └─ columns: [id kind]\n" +
 22145  			"         │   │   │   └─ InnerJoin\n" +
 22146  			"         │   │   │       ├─ (it1.id = mi.info_type_id)\n" +
 22147  			"         │   │   │       ├─ Filter\n" +
 22148  			"         │   │   │       │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 22149  			"         │   │   │       │   └─ TableAlias(mi)\n" +
 22150  			"         │   │   │       │       └─ Table\n" +
 22151  			"         │   │   │       │           ├─ name: movie_info\n" +
 22152  			"         │   │   │       │           └─ columns: [movie_id info_type_id info]\n" +
 22153  			"         │   │   │       └─ Filter\n" +
 22154  			"         │   │   │           ├─ (it1.info = 'countries')\n" +
 22155  			"         │   │   │           └─ TableAlias(it1)\n" +
 22156  			"         │   │   │               └─ Table\n" +
 22157  			"         │   │   │                   ├─ name: info_type\n" +
 22158  			"         │   │   │                   └─ columns: [id info]\n" +
 22159  			"         │   │   └─ InnerJoin\n" +
 22160  			"         │   │       ├─ (ct.id = mc.company_type_id)\n" +
 22161  			"         │   │       ├─ InnerJoin\n" +
 22162  			"         │   │       │   ├─ (cn.id = mc.company_id)\n" +
 22163  			"         │   │       │   ├─ Filter\n" +
 22164  			"         │   │       │   │   ├─ ((NOT(mc.note LIKE '%(USA)%')) AND mc.note LIKE '%(200%)%')\n" +
 22165  			"         │   │       │   │   └─ TableAlias(mc)\n" +
 22166  			"         │   │       │   │       └─ Table\n" +
 22167  			"         │   │       │   │           ├─ name: movie_companies\n" +
 22168  			"         │   │       │   │           └─ columns: [movie_id company_id company_type_id note]\n" +
 22169  			"         │   │       │   └─ Filter\n" +
 22170  			"         │   │       │       ├─ (NOT((cn.country_code = '[us]')))\n" +
 22171  			"         │   │       │       └─ TableAlias(cn)\n" +
 22172  			"         │   │       │           └─ Table\n" +
 22173  			"         │   │       │               ├─ name: company_name\n" +
 22174  			"         │   │       │               └─ columns: [id name country_code]\n" +
 22175  			"         │   │       └─ TableAlias(ct)\n" +
 22176  			"         │   │           └─ Table\n" +
 22177  			"         │   │               ├─ name: company_type\n" +
 22178  			"         │   │               └─ columns: [id]\n" +
 22179  			"         │   └─ InnerJoin\n" +
 22180  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 22181  			"         │       ├─ TableAlias(mk)\n" +
 22182  			"         │       │   └─ Table\n" +
 22183  			"         │       │       ├─ name: movie_keyword\n" +
 22184  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 22185  			"         │       └─ Filter\n" +
 22186  			"         │           ├─ (k.keyword HASH IN ('murder', 'murder-in-title', 'blood', 'violence'))\n" +
 22187  			"         │           └─ TableAlias(k)\n" +
 22188  			"         │               └─ Table\n" +
 22189  			"         │                   ├─ name: keyword\n" +
 22190  			"         │                   └─ columns: [id keyword]\n" +
 22191  			"         └─ InnerJoin\n" +
 22192  			"             ├─ (it2.id = mi_idx.info_type_id)\n" +
 22193  			"             ├─ Filter\n" +
 22194  			"             │   ├─ (mi_idx.info < '8.5')\n" +
 22195  			"             │   └─ TableAlias(mi_idx)\n" +
 22196  			"             │       └─ Table\n" +
 22197  			"             │           ├─ name: movie_info_idx\n" +
 22198  			"             │           └─ columns: [movie_id info_type_id info]\n" +
 22199  			"             └─ Filter\n" +
 22200  			"                 ├─ (it2.info = 'rating')\n" +
 22201  			"                 └─ TableAlias(it2)\n" +
 22202  			"                     └─ Table\n" +
 22203  			"                         ├─ name: info_type\n" +
 22204  			"                         └─ columns: [id info]\n" +
 22205  			"",
 22206  	},
 22207  	{
 22208  		Query: `
 22209  SELECT MIN(chn.name) AS voiced_char,
 22210         MIN(n.name) AS voicing_actress,
 22211         MIN(t.title) AS voiced_animation
 22212  FROM aka_name AS an,
 22213       complete_cast AS cc,
 22214       comp_cast_type AS cct1,
 22215       comp_cast_type AS cct2,
 22216       char_name AS chn,
 22217       cast_info AS ci,
 22218       company_name AS cn,
 22219       info_type AS it,
 22220       info_type AS it3,
 22221       keyword AS k,
 22222       movie_companies AS mc,
 22223       movie_info AS mi,
 22224       movie_keyword AS mk,
 22225       name AS n,
 22226       person_info AS pi,
 22227       role_type AS rt,
 22228       title AS t
 22229  WHERE cct1.kind ='cast'
 22230    AND cct2.kind ='complete+verified'
 22231    AND chn.name = 'Queen'
 22232    AND ci.note IN ('(voice)',
 22233                    '(voice) (uncredited)',
 22234                    '(voice: English version)')
 22235    AND cn.country_code ='[us]'
 22236    AND it.info = 'release dates'
 22237    AND it3.info = 'trivia'
 22238    AND k.keyword = 'computer-animation'
 22239    AND mi.info IS NOT NULL
 22240    AND (mi.info LIKE 'Japan:%200%'
 22241         OR mi.info LIKE 'USA:%200%')
 22242    AND n.gender ='f'
 22243    AND n.name LIKE '%An%'
 22244    AND rt.role ='actress'
 22245    AND t.title = 'Shrek 2'
 22246    AND t.production_year BETWEEN 2000 AND 2010
 22247    AND t.id = mi.movie_id
 22248    AND t.id = mc.movie_id
 22249    AND t.id = ci.movie_id
 22250    AND t.id = mk.movie_id
 22251    AND t.id = cc.movie_id
 22252    AND mc.movie_id = ci.movie_id
 22253    AND mc.movie_id = mi.movie_id
 22254    AND mc.movie_id = mk.movie_id
 22255    AND mc.movie_id = cc.movie_id
 22256    AND mi.movie_id = ci.movie_id
 22257    AND mi.movie_id = mk.movie_id
 22258    AND mi.movie_id = cc.movie_id
 22259    AND ci.movie_id = mk.movie_id
 22260    AND ci.movie_id = cc.movie_id
 22261    AND mk.movie_id = cc.movie_id
 22262    AND cn.id = mc.company_id
 22263    AND it.id = mi.info_type_id
 22264    AND n.id = ci.person_id
 22265    AND rt.id = ci.role_id
 22266    AND n.id = an.person_id
 22267    AND ci.person_id = an.person_id
 22268    AND chn.id = ci.person_role_id
 22269    AND n.id = pi.person_id
 22270    AND ci.person_id = pi.person_id
 22271    AND it3.id = pi.info_type_id
 22272    AND k.id = mk.keyword_id
 22273    AND cct1.id = cc.subject_id
 22274    AND cct2.id = cc.status_id;
 22275  
 22276  `,
 22277  		ExpectedPlan: "Project\n" +
 22278  			" ├─ columns: [min(chn.name):0!null as voiced_char, min(n.name):1!null as voicing_actress, min(t.title):2!null as voiced_animation]\n" +
 22279  			" └─ GroupBy\n" +
 22280  			"     ├─ select: MIN(chn.name:9!null), MIN(n.name:31!null), MIN(t.title:38!null)\n" +
 22281  			"     ├─ group: \n" +
 22282  			"     └─ HashJoin\n" +
 22283  			"         ├─ AND\n" +
 22284  			"         │   ├─ AND\n" +
 22285  			"         │   │   ├─ AND\n" +
 22286  			"         │   │   │   ├─ AND\n" +
 22287  			"         │   │   │   │   ├─ Eq\n" +
 22288  			"         │   │   │   │   │   ├─ t.id:37!null\n" +
 22289  			"         │   │   │   │   │   └─ mi.movie_id:25!null\n" +
 22290  			"         │   │   │   │   └─ Eq\n" +
 22291  			"         │   │   │   │       ├─ t.id:37!null\n" +
 22292  			"         │   │   │   │       └─ mc.movie_id:23!null\n" +
 22293  			"         │   │   │   └─ Eq\n" +
 22294  			"         │   │   │       ├─ t.id:37!null\n" +
 22295  			"         │   │   │       └─ ci.movie_id:11!null\n" +
 22296  			"         │   │   └─ Eq\n" +
 22297  			"         │   │       ├─ t.id:37!null\n" +
 22298  			"         │   │       └─ mk.movie_id:28!null\n" +
 22299  			"         │   └─ Eq\n" +
 22300  			"         │       ├─ t.id:37!null\n" +
 22301  			"         │       └─ cc.movie_id:1\n" +
 22302  			"         ├─ HashJoin\n" +
 22303  			"         │   ├─ Eq\n" +
 22304  			"         │   │   ├─ rt.id:35!null\n" +
 22305  			"         │   │   └─ ci.role_id:14!null\n" +
 22306  			"         │   ├─ LookupJoin\n" +
 22307  			"         │   │   ├─ AND\n" +
 22308  			"         │   │   │   ├─ Eq\n" +
 22309  			"         │   │   │   │   ├─ ci.person_id:10!null\n" +
 22310  			"         │   │   │   │   └─ pi.person_id:33!null\n" +
 22311  			"         │   │   │   └─ Eq\n" +
 22312  			"         │   │   │       ├─ it3.id:19!null\n" +
 22313  			"         │   │   │       └─ pi.info_type_id:34!null\n" +
 22314  			"         │   │   ├─ InnerJoin\n" +
 22315  			"         │   │   │   ├─ AND\n" +
 22316  			"         │   │   │   │   ├─ Eq\n" +
 22317  			"         │   │   │   │   │   ├─ n.id:30!null\n" +
 22318  			"         │   │   │   │   │   └─ ci.person_id:10!null\n" +
 22319  			"         │   │   │   │   └─ Eq\n" +
 22320  			"         │   │   │   │       ├─ n.id:30!null\n" +
 22321  			"         │   │   │   │       └─ an.person_id:0!null\n" +
 22322  			"         │   │   │   ├─ InnerJoin\n" +
 22323  			"         │   │   │   │   ├─ AND\n" +
 22324  			"         │   │   │   │   │   ├─ AND\n" +
 22325  			"         │   │   │   │   │   │   ├─ AND\n" +
 22326  			"         │   │   │   │   │   │   │   ├─ AND\n" +
 22327  			"         │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22328  			"         │   │   │   │   │   │   │   │   │   ├─ mc.movie_id:23!null\n" +
 22329  			"         │   │   │   │   │   │   │   │   │   └─ mk.movie_id:28!null\n" +
 22330  			"         │   │   │   │   │   │   │   │   └─ Eq\n" +
 22331  			"         │   │   │   │   │   │   │   │       ├─ mi.movie_id:25!null\n" +
 22332  			"         │   │   │   │   │   │   │   │       └─ mk.movie_id:28!null\n" +
 22333  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 22334  			"         │   │   │   │   │   │   │       ├─ ci.movie_id:11!null\n" +
 22335  			"         │   │   │   │   │   │   │       └─ mk.movie_id:28!null\n" +
 22336  			"         │   │   │   │   │   │   └─ Eq\n" +
 22337  			"         │   │   │   │   │   │       ├─ mk.movie_id:28!null\n" +
 22338  			"         │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 22339  			"         │   │   │   │   │   └─ Eq\n" +
 22340  			"         │   │   │   │   │       ├─ k.id:21!null\n" +
 22341  			"         │   │   │   │   │       └─ mk.keyword_id:29!null\n" +
 22342  			"         │   │   │   │   ├─ LookupJoin\n" +
 22343  			"         │   │   │   │   │   ├─ AND\n" +
 22344  			"         │   │   │   │   │   │   ├─ AND\n" +
 22345  			"         │   │   │   │   │   │   │   ├─ Eq\n" +
 22346  			"         │   │   │   │   │   │   │   │   ├─ mi.movie_id:25!null\n" +
 22347  			"         │   │   │   │   │   │   │   │   └─ ci.movie_id:11!null\n" +
 22348  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 22349  			"         │   │   │   │   │   │   │       ├─ mi.movie_id:25!null\n" +
 22350  			"         │   │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 22351  			"         │   │   │   │   │   │   └─ Eq\n" +
 22352  			"         │   │   │   │   │   │       ├─ it.id:17!null\n" +
 22353  			"         │   │   │   │   │   │       └─ mi.info_type_id:26!null\n" +
 22354  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 22355  			"         │   │   │   │   │   │   ├─ AND\n" +
 22356  			"         │   │   │   │   │   │   │   ├─ AND\n" +
 22357  			"         │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22358  			"         │   │   │   │   │   │   │   │   │   ├─ mc.movie_id:23!null\n" +
 22359  			"         │   │   │   │   │   │   │   │   │   └─ ci.movie_id:11!null\n" +
 22360  			"         │   │   │   │   │   │   │   │   └─ Eq\n" +
 22361  			"         │   │   │   │   │   │   │   │       ├─ mc.movie_id:23!null\n" +
 22362  			"         │   │   │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 22363  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 22364  			"         │   │   │   │   │   │   │       ├─ cn.id:15!null\n" +
 22365  			"         │   │   │   │   │   │   │       └─ mc.company_id:24!null\n" +
 22366  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 22367  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22368  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22369  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22370  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 22371  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ AND\n" +
 22372  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22373  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ ci.movie_id:11!null\n" +
 22374  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.movie_id:1\n" +
 22375  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Eq\n" +
 22376  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ ci.person_id:10!null\n" +
 22377  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ an.person_id:0!null\n" +
 22378  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22379  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22380  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22381  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ cct2.id:6!null\n" +
 22382  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.status_id:3!null\n" +
 22383  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22384  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22385  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ cct1.id:4!null\n" +
 22386  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.subject_id:2!null\n" +
 22387  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22388  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 22389  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ ProcessTable\n" +
 22390  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 22391  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: aka_name\n" +
 22392  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [person_id]\n" +
 22393  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 22394  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ ProcessTable\n" +
 22395  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22396  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: complete_cast\n" +
 22397  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [movie_id subject_id status_id]\n" +
 22398  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22399  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 22400  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ cct1.kind:1!null\n" +
 22401  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       │   └─ cast (longtext)\n" +
 22402  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 22403  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 22404  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 22405  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │                   ├─ name: comp_cast_type\n" +
 22406  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [id kind]\n" +
 22407  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22408  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 22409  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ cct2.kind:1!null\n" +
 22410  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       │   └─ complete+verified (longtext)\n" +
 22411  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 22412  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22413  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 22414  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [id kind]\n" +
 22415  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ colSet: (15,16)\n" +
 22416  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ tableId: 4\n" +
 22417  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22418  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 22419  			"         │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ chn.name:1!null\n" +
 22420  			"         │   │   │   │   │   │   │   │   │   │   │   │       │   └─ Queen (longtext)\n" +
 22421  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(chn)\n" +
 22422  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 22423  			"         │   │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 22424  			"         │   │   │   │   │   │   │   │   │   │   │   │                   ├─ name: char_name\n" +
 22425  			"         │   │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [id name]\n" +
 22426  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22427  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ HashIn\n" +
 22428  			"         │   │   │   │   │   │   │   │   │   │   │       │   ├─ ci.note:3\n" +
 22429  			"         │   │   │   │   │   │   │   │   │   │   │       │   └─ TUPLE((voice) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 22430  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 22431  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 22432  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 22433  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ keys: [chn.id:8!null]\n" +
 22434  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ colSet: (24-30)\n" +
 22435  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ tableId: 6\n" +
 22436  			"         │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 22437  			"         │   │   │   │   │   │   │   │   │   │   │                   ├─ name: cast_info\n" +
 22438  			"         │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 22439  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22440  			"         │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 22441  			"         │   │   │   │   │   │   │   │   │   │       │   ├─ cn.country_code:1\n" +
 22442  			"         │   │   │   │   │   │   │   │   │   │       │   └─ [us] (longtext)\n" +
 22443  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 22444  			"         │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 22445  			"         │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 22446  			"         │   │   │   │   │   │   │   │   │   │                   ├─ name: company_name\n" +
 22447  			"         │   │   │   │   │   │   │   │   │   │                   └─ columns: [id country_code]\n" +
 22448  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22449  			"         │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 22450  			"         │   │   │   │   │   │   │   │   │       │   ├─ it.info:1!null\n" +
 22451  			"         │   │   │   │   │   │   │   │   │       │   └─ release dates (longtext)\n" +
 22452  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 22453  			"         │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 22454  			"         │   │   │   │   │   │   │   │   │               └─ Table\n" +
 22455  			"         │   │   │   │   │   │   │   │   │                   ├─ name: info_type\n" +
 22456  			"         │   │   │   │   │   │   │   │   │                   └─ columns: [id info]\n" +
 22457  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 22458  			"         │   │   │   │   │   │   │   │       ├─ Eq\n" +
 22459  			"         │   │   │   │   │   │   │   │       │   ├─ it3.info:1!null\n" +
 22460  			"         │   │   │   │   │   │   │   │       │   └─ trivia (longtext)\n" +
 22461  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 22462  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 22463  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 22464  			"         │   │   │   │   │   │   │   │               ├─ columns: [id info]\n" +
 22465  			"         │   │   │   │   │   │   │   │               ├─ colSet: (40,41)\n" +
 22466  			"         │   │   │   │   │   │   │   │               └─ tableId: 9\n" +
 22467  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 22468  			"         │   │   │   │   │   │   │       ├─ Eq\n" +
 22469  			"         │   │   │   │   │   │   │       │   ├─ k.keyword:1!null\n" +
 22470  			"         │   │   │   │   │   │   │       │   └─ computer-animation (longtext)\n" +
 22471  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 22472  			"         │   │   │   │   │   │   │           └─ ProcessTable\n" +
 22473  			"         │   │   │   │   │   │   │               └─ Table\n" +
 22474  			"         │   │   │   │   │   │   │                   ├─ name: keyword\n" +
 22475  			"         │   │   │   │   │   │   │                   └─ columns: [id keyword]\n" +
 22476  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 22477  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 22478  			"         │   │   │   │   │   │           └─ Table\n" +
 22479  			"         │   │   │   │   │   │               ├─ name: movie_companies\n" +
 22480  			"         │   │   │   │   │   │               └─ columns: [movie_id company_id]\n" +
 22481  			"         │   │   │   │   │   └─ Filter\n" +
 22482  			"         │   │   │   │   │       ├─ AND\n" +
 22483  			"         │   │   │   │   │       │   ├─ NOT\n" +
 22484  			"         │   │   │   │   │       │   │   └─ mi.info:2!null IS NULL\n" +
 22485  			"         │   │   │   │   │       │   └─ Or\n" +
 22486  			"         │   │   │   │   │       │       ├─ mi.info LIKE 'Japan:%200%'\n" +
 22487  			"         │   │   │   │   │       │       └─ mi.info LIKE 'USA:%200%'\n" +
 22488  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 22489  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 22490  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 22491  			"         │   │   │   │   │               ├─ keys: [mc.movie_id:23!null]\n" +
 22492  			"         │   │   │   │   │               ├─ colSet: (50-54)\n" +
 22493  			"         │   │   │   │   │               ├─ tableId: 12\n" +
 22494  			"         │   │   │   │   │               └─ Table\n" +
 22495  			"         │   │   │   │   │                   ├─ name: movie_info\n" +
 22496  			"         │   │   │   │   │                   └─ columns: [movie_id info_type_id info]\n" +
 22497  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 22498  			"         │   │   │   │       └─ ProcessTable\n" +
 22499  			"         │   │   │   │           └─ Table\n" +
 22500  			"         │   │   │   │               ├─ name: movie_keyword\n" +
 22501  			"         │   │   │   │               └─ columns: [movie_id keyword_id]\n" +
 22502  			"         │   │   │   └─ Filter\n" +
 22503  			"         │   │   │       ├─ AND\n" +
 22504  			"         │   │   │       │   ├─ Eq\n" +
 22505  			"         │   │   │       │   │   ├─ n.gender:2\n" +
 22506  			"         │   │   │       │   │   └─ f (longtext)\n" +
 22507  			"         │   │   │       │   └─ n.name LIKE '%An%'\n" +
 22508  			"         │   │   │       └─ TableAlias(n)\n" +
 22509  			"         │   │   │           └─ ProcessTable\n" +
 22510  			"         │   │   │               └─ Table\n" +
 22511  			"         │   │   │                   ├─ name: name\n" +
 22512  			"         │   │   │                   └─ columns: [id name gender]\n" +
 22513  			"         │   │   └─ TableAlias(pi)\n" +
 22514  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 22515  			"         │   │           ├─ index: [person_info.person_id]\n" +
 22516  			"         │   │           ├─ keys: [n.id:30!null]\n" +
 22517  			"         │   │           ├─ colSet: (67-71)\n" +
 22518  			"         │   │           ├─ tableId: 15\n" +
 22519  			"         │   │           └─ Table\n" +
 22520  			"         │   │               ├─ name: person_info\n" +
 22521  			"         │   │               └─ columns: [person_id info_type_id]\n" +
 22522  			"         │   └─ HashLookup\n" +
 22523  			"         │       ├─ left-key: TUPLE(ci.role_id:14!null)\n" +
 22524  			"         │       ├─ right-key: TUPLE(rt.id:0!null)\n" +
 22525  			"         │       └─ Filter\n" +
 22526  			"         │           ├─ Eq\n" +
 22527  			"         │           │   ├─ rt.role:1!null\n" +
 22528  			"         │           │   └─ actress (longtext)\n" +
 22529  			"         │           └─ TableAlias(rt)\n" +
 22530  			"         │               └─ ProcessTable\n" +
 22531  			"         │                   └─ Table\n" +
 22532  			"         │                       ├─ name: role_type\n" +
 22533  			"         │                       └─ columns: [id role]\n" +
 22534  			"         └─ HashLookup\n" +
 22535  			"             ├─ left-key: TUPLE(mi.movie_id:25!null, mc.movie_id:23!null, ci.movie_id:11!null, mk.movie_id:28!null, cc.movie_id:1)\n" +
 22536  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 22537  			"             └─ Filter\n" +
 22538  			"                 ├─ AND\n" +
 22539  			"                 │   ├─ AND\n" +
 22540  			"                 │   │   ├─ Eq\n" +
 22541  			"                 │   │   │   ├─ t.title:1!null\n" +
 22542  			"                 │   │   │   └─ Shrek 2 (longtext)\n" +
 22543  			"                 │   │   └─ GreaterThanOrEqual\n" +
 22544  			"                 │   │       ├─ t.production_year:2\n" +
 22545  			"                 │   │       └─ 2000 (smallint)\n" +
 22546  			"                 │   └─ LessThanOrEqual\n" +
 22547  			"                 │       ├─ t.production_year:2\n" +
 22548  			"                 │       └─ 2010 (smallint)\n" +
 22549  			"                 └─ TableAlias(t)\n" +
 22550  			"                     └─ ProcessTable\n" +
 22551  			"                         └─ Table\n" +
 22552  			"                             ├─ name: title\n" +
 22553  			"                             └─ columns: [id title production_year]\n" +
 22554  			"",
 22555  		ExpectedEstimates: "Project\n" +
 22556  			" ├─ columns: [min(chn.name) as voiced_char, min(n.name) as voicing_actress, min(t.title) as voiced_animation]\n" +
 22557  			" └─ GroupBy\n" +
 22558  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 22559  			"     ├─ Grouping()\n" +
 22560  			"     └─ HashJoin\n" +
 22561  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = cc.movie_id))\n" +
 22562  			"         ├─ HashJoin\n" +
 22563  			"         │   ├─ (rt.id = ci.role_id)\n" +
 22564  			"         │   ├─ LookupJoin\n" +
 22565  			"         │   │   ├─ ((ci.person_id = pi.person_id) AND (it3.id = pi.info_type_id))\n" +
 22566  			"         │   │   ├─ InnerJoin\n" +
 22567  			"         │   │   │   ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 22568  			"         │   │   │   ├─ InnerJoin\n" +
 22569  			"         │   │   │   │   ├─ (((((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (k.id = mk.keyword_id))\n" +
 22570  			"         │   │   │   │   ├─ LookupJoin\n" +
 22571  			"         │   │   │   │   │   ├─ (((mi.movie_id = ci.movie_id) AND (mi.movie_id = cc.movie_id)) AND (it.id = mi.info_type_id))\n" +
 22572  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 22573  			"         │   │   │   │   │   │   ├─ (((mc.movie_id = ci.movie_id) AND (mc.movie_id = cc.movie_id)) AND (cn.id = mc.company_id))\n" +
 22574  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 22575  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22576  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22577  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22578  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 22579  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ ((ci.movie_id = cc.movie_id) AND (ci.person_id = an.person_id))\n" +
 22580  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22581  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22582  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct2.id = cc.status_id)\n" +
 22583  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22584  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct1.id = cc.subject_id)\n" +
 22585  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22586  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 22587  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Table\n" +
 22588  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ name: aka_name\n" +
 22589  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ columns: [person_id]\n" +
 22590  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 22591  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 22592  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: complete_cast\n" +
 22593  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [movie_id subject_id status_id]\n" +
 22594  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22595  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct1.kind = 'cast')\n" +
 22596  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 22597  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22598  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 22599  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 22600  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22601  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct2.kind = 'complete+verified')\n" +
 22602  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 22603  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22604  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 22605  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 22606  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22607  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ (chn.name = 'Queen')\n" +
 22608  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(chn)\n" +
 22609  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22610  			"         │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: char_name\n" +
 22611  			"         │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id name]\n" +
 22612  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22613  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ (ci.note HASH IN ('(voice)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 22614  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 22615  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 22616  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 22617  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [person_id movie_id person_role_id note role_id]\n" +
 22618  			"         │   │   │   │   │   │   │   │   │   │   │               └─ keys: chn.id\n" +
 22619  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22620  			"         │   │   │   │   │   │   │   │   │   │       ├─ (cn.country_code = '[us]')\n" +
 22621  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 22622  			"         │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22623  			"         │   │   │   │   │   │   │   │   │   │               ├─ name: company_name\n" +
 22624  			"         │   │   │   │   │   │   │   │   │   │               └─ columns: [id country_code]\n" +
 22625  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22626  			"         │   │   │   │   │   │   │   │   │       ├─ (it.info = 'release dates')\n" +
 22627  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 22628  			"         │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22629  			"         │   │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 22630  			"         │   │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 22631  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 22632  			"         │   │   │   │   │   │   │   │       ├─ (it3.info = 'trivia')\n" +
 22633  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 22634  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 22635  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 22636  			"         │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 22637  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 22638  			"         │   │   │   │   │   │   │       ├─ (k.keyword = 'computer-animation')\n" +
 22639  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 22640  			"         │   │   │   │   │   │   │           └─ Table\n" +
 22641  			"         │   │   │   │   │   │   │               ├─ name: keyword\n" +
 22642  			"         │   │   │   │   │   │   │               └─ columns: [id keyword]\n" +
 22643  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 22644  			"         │   │   │   │   │   │       └─ Table\n" +
 22645  			"         │   │   │   │   │   │           ├─ name: movie_companies\n" +
 22646  			"         │   │   │   │   │   │           └─ columns: [movie_id company_id]\n" +
 22647  			"         │   │   │   │   │   └─ Filter\n" +
 22648  			"         │   │   │   │   │       ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
 22649  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 22650  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 22651  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 22652  			"         │   │   │   │   │               ├─ columns: [movie_id info_type_id info]\n" +
 22653  			"         │   │   │   │   │               └─ keys: mc.movie_id\n" +
 22654  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 22655  			"         │   │   │   │       └─ Table\n" +
 22656  			"         │   │   │   │           ├─ name: movie_keyword\n" +
 22657  			"         │   │   │   │           └─ columns: [movie_id keyword_id]\n" +
 22658  			"         │   │   │   └─ Filter\n" +
 22659  			"         │   │   │       ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 22660  			"         │   │   │       └─ TableAlias(n)\n" +
 22661  			"         │   │   │           └─ Table\n" +
 22662  			"         │   │   │               ├─ name: name\n" +
 22663  			"         │   │   │               └─ columns: [id name gender]\n" +
 22664  			"         │   │   └─ TableAlias(pi)\n" +
 22665  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 22666  			"         │   │           ├─ index: [person_info.person_id]\n" +
 22667  			"         │   │           ├─ columns: [person_id info_type_id]\n" +
 22668  			"         │   │           └─ keys: n.id\n" +
 22669  			"         │   └─ HashLookup\n" +
 22670  			"         │       ├─ left-key: (ci.role_id)\n" +
 22671  			"         │       ├─ right-key: (rt.id)\n" +
 22672  			"         │       └─ Filter\n" +
 22673  			"         │           ├─ (rt.role = 'actress')\n" +
 22674  			"         │           └─ TableAlias(rt)\n" +
 22675  			"         │               └─ Table\n" +
 22676  			"         │                   ├─ name: role_type\n" +
 22677  			"         │                   └─ columns: [id role]\n" +
 22678  			"         └─ HashLookup\n" +
 22679  			"             ├─ left-key: (mi.movie_id, mc.movie_id, ci.movie_id, mk.movie_id, cc.movie_id)\n" +
 22680  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 22681  			"             └─ Filter\n" +
 22682  			"                 ├─ (((t.title = 'Shrek 2') AND (t.production_year >= 2000)) AND (t.production_year <= 2010))\n" +
 22683  			"                 └─ TableAlias(t)\n" +
 22684  			"                     └─ Table\n" +
 22685  			"                         ├─ name: title\n" +
 22686  			"                         └─ columns: [id title production_year]\n" +
 22687  			"",
 22688  		ExpectedAnalysis: "Project\n" +
 22689  			" ├─ columns: [min(chn.name) as voiced_char, min(n.name) as voicing_actress, min(t.title) as voiced_animation]\n" +
 22690  			" └─ GroupBy\n" +
 22691  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 22692  			"     ├─ Grouping()\n" +
 22693  			"     └─ HashJoin\n" +
 22694  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = cc.movie_id))\n" +
 22695  			"         ├─ HashJoin\n" +
 22696  			"         │   ├─ (rt.id = ci.role_id)\n" +
 22697  			"         │   ├─ LookupJoin\n" +
 22698  			"         │   │   ├─ ((ci.person_id = pi.person_id) AND (it3.id = pi.info_type_id))\n" +
 22699  			"         │   │   ├─ InnerJoin\n" +
 22700  			"         │   │   │   ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 22701  			"         │   │   │   ├─ InnerJoin\n" +
 22702  			"         │   │   │   │   ├─ (((((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (k.id = mk.keyword_id))\n" +
 22703  			"         │   │   │   │   ├─ LookupJoin\n" +
 22704  			"         │   │   │   │   │   ├─ (((mi.movie_id = ci.movie_id) AND (mi.movie_id = cc.movie_id)) AND (it.id = mi.info_type_id))\n" +
 22705  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 22706  			"         │   │   │   │   │   │   ├─ (((mc.movie_id = ci.movie_id) AND (mc.movie_id = cc.movie_id)) AND (cn.id = mc.company_id))\n" +
 22707  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 22708  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22709  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22710  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22711  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 22712  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ ((ci.movie_id = cc.movie_id) AND (ci.person_id = an.person_id))\n" +
 22713  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22714  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22715  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct2.id = cc.status_id)\n" +
 22716  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22717  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct1.id = cc.subject_id)\n" +
 22718  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22719  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 22720  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Table\n" +
 22721  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ name: aka_name\n" +
 22722  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ columns: [person_id]\n" +
 22723  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 22724  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 22725  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: complete_cast\n" +
 22726  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [movie_id subject_id status_id]\n" +
 22727  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22728  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct1.kind = 'cast')\n" +
 22729  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 22730  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22731  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 22732  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 22733  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22734  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct2.kind = 'complete+verified')\n" +
 22735  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 22736  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22737  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 22738  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 22739  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22740  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ (chn.name = 'Queen')\n" +
 22741  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(chn)\n" +
 22742  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22743  			"         │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: char_name\n" +
 22744  			"         │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id name]\n" +
 22745  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22746  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ (ci.note HASH IN ('(voice)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 22747  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 22748  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 22749  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 22750  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [person_id movie_id person_role_id note role_id]\n" +
 22751  			"         │   │   │   │   │   │   │   │   │   │   │               └─ keys: chn.id\n" +
 22752  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22753  			"         │   │   │   │   │   │   │   │   │   │       ├─ (cn.country_code = '[us]')\n" +
 22754  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 22755  			"         │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22756  			"         │   │   │   │   │   │   │   │   │   │               ├─ name: company_name\n" +
 22757  			"         │   │   │   │   │   │   │   │   │   │               └─ columns: [id country_code]\n" +
 22758  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 22759  			"         │   │   │   │   │   │   │   │   │       ├─ (it.info = 'release dates')\n" +
 22760  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 22761  			"         │   │   │   │   │   │   │   │   │           └─ Table\n" +
 22762  			"         │   │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 22763  			"         │   │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 22764  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 22765  			"         │   │   │   │   │   │   │   │       ├─ (it3.info = 'trivia')\n" +
 22766  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 22767  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 22768  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 22769  			"         │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 22770  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 22771  			"         │   │   │   │   │   │   │       ├─ (k.keyword = 'computer-animation')\n" +
 22772  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 22773  			"         │   │   │   │   │   │   │           └─ Table\n" +
 22774  			"         │   │   │   │   │   │   │               ├─ name: keyword\n" +
 22775  			"         │   │   │   │   │   │   │               └─ columns: [id keyword]\n" +
 22776  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 22777  			"         │   │   │   │   │   │       └─ Table\n" +
 22778  			"         │   │   │   │   │   │           ├─ name: movie_companies\n" +
 22779  			"         │   │   │   │   │   │           └─ columns: [movie_id company_id]\n" +
 22780  			"         │   │   │   │   │   └─ Filter\n" +
 22781  			"         │   │   │   │   │       ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
 22782  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 22783  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 22784  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 22785  			"         │   │   │   │   │               ├─ columns: [movie_id info_type_id info]\n" +
 22786  			"         │   │   │   │   │               └─ keys: mc.movie_id\n" +
 22787  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 22788  			"         │   │   │   │       └─ Table\n" +
 22789  			"         │   │   │   │           ├─ name: movie_keyword\n" +
 22790  			"         │   │   │   │           └─ columns: [movie_id keyword_id]\n" +
 22791  			"         │   │   │   └─ Filter\n" +
 22792  			"         │   │   │       ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 22793  			"         │   │   │       └─ TableAlias(n)\n" +
 22794  			"         │   │   │           └─ Table\n" +
 22795  			"         │   │   │               ├─ name: name\n" +
 22796  			"         │   │   │               └─ columns: [id name gender]\n" +
 22797  			"         │   │   └─ TableAlias(pi)\n" +
 22798  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 22799  			"         │   │           ├─ index: [person_info.person_id]\n" +
 22800  			"         │   │           ├─ columns: [person_id info_type_id]\n" +
 22801  			"         │   │           └─ keys: n.id\n" +
 22802  			"         │   └─ HashLookup\n" +
 22803  			"         │       ├─ left-key: (ci.role_id)\n" +
 22804  			"         │       ├─ right-key: (rt.id)\n" +
 22805  			"         │       └─ Filter\n" +
 22806  			"         │           ├─ (rt.role = 'actress')\n" +
 22807  			"         │           └─ TableAlias(rt)\n" +
 22808  			"         │               └─ Table\n" +
 22809  			"         │                   ├─ name: role_type\n" +
 22810  			"         │                   └─ columns: [id role]\n" +
 22811  			"         └─ HashLookup\n" +
 22812  			"             ├─ left-key: (mi.movie_id, mc.movie_id, ci.movie_id, mk.movie_id, cc.movie_id)\n" +
 22813  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 22814  			"             └─ Filter\n" +
 22815  			"                 ├─ (((t.title = 'Shrek 2') AND (t.production_year >= 2000)) AND (t.production_year <= 2010))\n" +
 22816  			"                 └─ TableAlias(t)\n" +
 22817  			"                     └─ Table\n" +
 22818  			"                         ├─ name: title\n" +
 22819  			"                         └─ columns: [id title production_year]\n" +
 22820  			"",
 22821  	},
 22822  	{
 22823  		Query: `
 22824  SELECT MIN(chn.name) AS voiced_char,
 22825         MIN(n.name) AS voicing_actress,
 22826         MIN(t.title) AS voiced_animation
 22827  FROM aka_name AS an,
 22828       complete_cast AS cc,
 22829       comp_cast_type AS cct1,
 22830       comp_cast_type AS cct2,
 22831       char_name AS chn,
 22832       cast_info AS ci,
 22833       company_name AS cn,
 22834       info_type AS it,
 22835       info_type AS it3,
 22836       keyword AS k,
 22837       movie_companies AS mc,
 22838       movie_info AS mi,
 22839       movie_keyword AS mk,
 22840       name AS n,
 22841       person_info AS pi,
 22842       role_type AS rt,
 22843       title AS t
 22844  WHERE cct1.kind ='cast'
 22845    AND cct2.kind ='complete+verified'
 22846    AND chn.name = 'Queen'
 22847    AND ci.note IN ('(voice)',
 22848                    '(voice) (uncredited)',
 22849                    '(voice: English version)')
 22850    AND cn.country_code ='[us]'
 22851    AND it.info = 'release dates'
 22852    AND it3.info = 'height'
 22853    AND k.keyword = 'computer-animation'
 22854    AND mi.info LIKE 'USA:%200%'
 22855    AND n.gender ='f'
 22856    AND n.name LIKE '%An%'
 22857    AND rt.role ='actress'
 22858    AND t.title = 'Shrek 2'
 22859    AND t.production_year BETWEEN 2000 AND 2005
 22860    AND t.id = mi.movie_id
 22861    AND t.id = mc.movie_id
 22862    AND t.id = ci.movie_id
 22863    AND t.id = mk.movie_id
 22864    AND t.id = cc.movie_id
 22865    AND mc.movie_id = ci.movie_id
 22866    AND mc.movie_id = mi.movie_id
 22867    AND mc.movie_id = mk.movie_id
 22868    AND mc.movie_id = cc.movie_id
 22869    AND mi.movie_id = ci.movie_id
 22870    AND mi.movie_id = mk.movie_id
 22871    AND mi.movie_id = cc.movie_id
 22872    AND ci.movie_id = mk.movie_id
 22873    AND ci.movie_id = cc.movie_id
 22874    AND mk.movie_id = cc.movie_id
 22875    AND cn.id = mc.company_id
 22876    AND it.id = mi.info_type_id
 22877    AND n.id = ci.person_id
 22878    AND rt.id = ci.role_id
 22879    AND n.id = an.person_id
 22880    AND ci.person_id = an.person_id
 22881    AND chn.id = ci.person_role_id
 22882    AND n.id = pi.person_id
 22883    AND ci.person_id = pi.person_id
 22884    AND it3.id = pi.info_type_id
 22885    AND k.id = mk.keyword_id
 22886    AND cct1.id = cc.subject_id
 22887    AND cct2.id = cc.status_id;
 22888  
 22889  `,
 22890  		ExpectedPlan: "Project\n" +
 22891  			" ├─ columns: [min(chn.name):0!null as voiced_char, min(n.name):1!null as voicing_actress, min(t.title):2!null as voiced_animation]\n" +
 22892  			" └─ GroupBy\n" +
 22893  			"     ├─ select: MIN(chn.name:9!null), MIN(n.name:31!null), MIN(t.title:38!null)\n" +
 22894  			"     ├─ group: \n" +
 22895  			"     └─ HashJoin\n" +
 22896  			"         ├─ AND\n" +
 22897  			"         │   ├─ AND\n" +
 22898  			"         │   │   ├─ AND\n" +
 22899  			"         │   │   │   ├─ AND\n" +
 22900  			"         │   │   │   │   ├─ Eq\n" +
 22901  			"         │   │   │   │   │   ├─ t.id:37!null\n" +
 22902  			"         │   │   │   │   │   └─ mi.movie_id:25!null\n" +
 22903  			"         │   │   │   │   └─ Eq\n" +
 22904  			"         │   │   │   │       ├─ t.id:37!null\n" +
 22905  			"         │   │   │   │       └─ mc.movie_id:23!null\n" +
 22906  			"         │   │   │   └─ Eq\n" +
 22907  			"         │   │   │       ├─ t.id:37!null\n" +
 22908  			"         │   │   │       └─ ci.movie_id:11!null\n" +
 22909  			"         │   │   └─ Eq\n" +
 22910  			"         │   │       ├─ t.id:37!null\n" +
 22911  			"         │   │       └─ mk.movie_id:28!null\n" +
 22912  			"         │   └─ Eq\n" +
 22913  			"         │       ├─ t.id:37!null\n" +
 22914  			"         │       └─ cc.movie_id:1\n" +
 22915  			"         ├─ HashJoin\n" +
 22916  			"         │   ├─ Eq\n" +
 22917  			"         │   │   ├─ rt.id:35!null\n" +
 22918  			"         │   │   └─ ci.role_id:14!null\n" +
 22919  			"         │   ├─ LookupJoin\n" +
 22920  			"         │   │   ├─ AND\n" +
 22921  			"         │   │   │   ├─ Eq\n" +
 22922  			"         │   │   │   │   ├─ ci.person_id:10!null\n" +
 22923  			"         │   │   │   │   └─ pi.person_id:33!null\n" +
 22924  			"         │   │   │   └─ Eq\n" +
 22925  			"         │   │   │       ├─ it3.id:19!null\n" +
 22926  			"         │   │   │       └─ pi.info_type_id:34!null\n" +
 22927  			"         │   │   ├─ InnerJoin\n" +
 22928  			"         │   │   │   ├─ AND\n" +
 22929  			"         │   │   │   │   ├─ Eq\n" +
 22930  			"         │   │   │   │   │   ├─ n.id:30!null\n" +
 22931  			"         │   │   │   │   │   └─ ci.person_id:10!null\n" +
 22932  			"         │   │   │   │   └─ Eq\n" +
 22933  			"         │   │   │   │       ├─ n.id:30!null\n" +
 22934  			"         │   │   │   │       └─ an.person_id:0!null\n" +
 22935  			"         │   │   │   ├─ InnerJoin\n" +
 22936  			"         │   │   │   │   ├─ AND\n" +
 22937  			"         │   │   │   │   │   ├─ AND\n" +
 22938  			"         │   │   │   │   │   │   ├─ AND\n" +
 22939  			"         │   │   │   │   │   │   │   ├─ AND\n" +
 22940  			"         │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22941  			"         │   │   │   │   │   │   │   │   │   ├─ mc.movie_id:23!null\n" +
 22942  			"         │   │   │   │   │   │   │   │   │   └─ mk.movie_id:28!null\n" +
 22943  			"         │   │   │   │   │   │   │   │   └─ Eq\n" +
 22944  			"         │   │   │   │   │   │   │   │       ├─ mi.movie_id:25!null\n" +
 22945  			"         │   │   │   │   │   │   │   │       └─ mk.movie_id:28!null\n" +
 22946  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 22947  			"         │   │   │   │   │   │   │       ├─ ci.movie_id:11!null\n" +
 22948  			"         │   │   │   │   │   │   │       └─ mk.movie_id:28!null\n" +
 22949  			"         │   │   │   │   │   │   └─ Eq\n" +
 22950  			"         │   │   │   │   │   │       ├─ mk.movie_id:28!null\n" +
 22951  			"         │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 22952  			"         │   │   │   │   │   └─ Eq\n" +
 22953  			"         │   │   │   │   │       ├─ k.id:21!null\n" +
 22954  			"         │   │   │   │   │       └─ mk.keyword_id:29!null\n" +
 22955  			"         │   │   │   │   ├─ LookupJoin\n" +
 22956  			"         │   │   │   │   │   ├─ AND\n" +
 22957  			"         │   │   │   │   │   │   ├─ AND\n" +
 22958  			"         │   │   │   │   │   │   │   ├─ Eq\n" +
 22959  			"         │   │   │   │   │   │   │   │   ├─ mi.movie_id:25!null\n" +
 22960  			"         │   │   │   │   │   │   │   │   └─ ci.movie_id:11!null\n" +
 22961  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 22962  			"         │   │   │   │   │   │   │       ├─ mi.movie_id:25!null\n" +
 22963  			"         │   │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 22964  			"         │   │   │   │   │   │   └─ Eq\n" +
 22965  			"         │   │   │   │   │   │       ├─ it.id:17!null\n" +
 22966  			"         │   │   │   │   │   │       └─ mi.info_type_id:26!null\n" +
 22967  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 22968  			"         │   │   │   │   │   │   ├─ AND\n" +
 22969  			"         │   │   │   │   │   │   │   ├─ AND\n" +
 22970  			"         │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22971  			"         │   │   │   │   │   │   │   │   │   ├─ mc.movie_id:23!null\n" +
 22972  			"         │   │   │   │   │   │   │   │   │   └─ ci.movie_id:11!null\n" +
 22973  			"         │   │   │   │   │   │   │   │   └─ Eq\n" +
 22974  			"         │   │   │   │   │   │   │   │       ├─ mc.movie_id:23!null\n" +
 22975  			"         │   │   │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 22976  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 22977  			"         │   │   │   │   │   │   │       ├─ cn.id:15!null\n" +
 22978  			"         │   │   │   │   │   │   │       └─ mc.company_id:24!null\n" +
 22979  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 22980  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22981  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22982  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22983  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 22984  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ AND\n" +
 22985  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22986  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ ci.movie_id:11!null\n" +
 22987  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.movie_id:1\n" +
 22988  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Eq\n" +
 22989  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ ci.person_id:10!null\n" +
 22990  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ an.person_id:0!null\n" +
 22991  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 22992  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22993  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22994  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ cct2.id:6!null\n" +
 22995  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.status_id:3!null\n" +
 22996  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 22997  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 22998  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ cct1.id:4!null\n" +
 22999  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.subject_id:2!null\n" +
 23000  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23001  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 23002  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ ProcessTable\n" +
 23003  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23004  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: aka_name\n" +
 23005  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [person_id]\n" +
 23006  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 23007  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ ProcessTable\n" +
 23008  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23009  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: complete_cast\n" +
 23010  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [movie_id subject_id status_id]\n" +
 23011  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23012  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23013  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ cct1.kind:1!null\n" +
 23014  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       │   └─ cast (longtext)\n" +
 23015  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 23016  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23017  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23018  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │                   ├─ name: comp_cast_type\n" +
 23019  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [id kind]\n" +
 23020  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23021  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23022  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ cct2.kind:1!null\n" +
 23023  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       │   └─ complete+verified (longtext)\n" +
 23024  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 23025  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23026  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23027  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [id kind]\n" +
 23028  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ colSet: (15,16)\n" +
 23029  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ tableId: 4\n" +
 23030  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23031  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23032  			"         │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ chn.name:1!null\n" +
 23033  			"         │   │   │   │   │   │   │   │   │   │   │   │       │   └─ Queen (longtext)\n" +
 23034  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(chn)\n" +
 23035  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23036  			"         │   │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23037  			"         │   │   │   │   │   │   │   │   │   │   │   │                   ├─ name: char_name\n" +
 23038  			"         │   │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [id name]\n" +
 23039  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23040  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ HashIn\n" +
 23041  			"         │   │   │   │   │   │   │   │   │   │   │       │   ├─ ci.note:3\n" +
 23042  			"         │   │   │   │   │   │   │   │   │   │   │       │   └─ TUPLE((voice) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 23043  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 23044  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 23045  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 23046  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ keys: [chn.id:8!null]\n" +
 23047  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ colSet: (24-30)\n" +
 23048  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ tableId: 6\n" +
 23049  			"         │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23050  			"         │   │   │   │   │   │   │   │   │   │   │                   ├─ name: cast_info\n" +
 23051  			"         │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 23052  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23053  			"         │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23054  			"         │   │   │   │   │   │   │   │   │   │       │   ├─ cn.country_code:1\n" +
 23055  			"         │   │   │   │   │   │   │   │   │   │       │   └─ [us] (longtext)\n" +
 23056  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 23057  			"         │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23058  			"         │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23059  			"         │   │   │   │   │   │   │   │   │   │                   ├─ name: company_name\n" +
 23060  			"         │   │   │   │   │   │   │   │   │   │                   └─ columns: [id country_code]\n" +
 23061  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23062  			"         │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23063  			"         │   │   │   │   │   │   │   │   │       │   ├─ it.info:1!null\n" +
 23064  			"         │   │   │   │   │   │   │   │   │       │   └─ release dates (longtext)\n" +
 23065  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 23066  			"         │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23067  			"         │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23068  			"         │   │   │   │   │   │   │   │   │                   ├─ name: info_type\n" +
 23069  			"         │   │   │   │   │   │   │   │   │                   └─ columns: [id info]\n" +
 23070  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 23071  			"         │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23072  			"         │   │   │   │   │   │   │   │       │   ├─ it3.info:1!null\n" +
 23073  			"         │   │   │   │   │   │   │   │       │   └─ height (longtext)\n" +
 23074  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 23075  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 23076  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23077  			"         │   │   │   │   │   │   │   │               ├─ columns: [id info]\n" +
 23078  			"         │   │   │   │   │   │   │   │               ├─ colSet: (40,41)\n" +
 23079  			"         │   │   │   │   │   │   │   │               └─ tableId: 9\n" +
 23080  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 23081  			"         │   │   │   │   │   │   │       ├─ Eq\n" +
 23082  			"         │   │   │   │   │   │   │       │   ├─ k.keyword:1!null\n" +
 23083  			"         │   │   │   │   │   │   │       │   └─ computer-animation (longtext)\n" +
 23084  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 23085  			"         │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23086  			"         │   │   │   │   │   │   │               └─ Table\n" +
 23087  			"         │   │   │   │   │   │   │                   ├─ name: keyword\n" +
 23088  			"         │   │   │   │   │   │   │                   └─ columns: [id keyword]\n" +
 23089  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 23090  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 23091  			"         │   │   │   │   │   │           └─ Table\n" +
 23092  			"         │   │   │   │   │   │               ├─ name: movie_companies\n" +
 23093  			"         │   │   │   │   │   │               └─ columns: [movie_id company_id]\n" +
 23094  			"         │   │   │   │   │   └─ Filter\n" +
 23095  			"         │   │   │   │   │       ├─ mi.info LIKE 'USA:%200%'\n" +
 23096  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 23097  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 23098  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 23099  			"         │   │   │   │   │               ├─ keys: [mc.movie_id:23!null]\n" +
 23100  			"         │   │   │   │   │               ├─ colSet: (50-54)\n" +
 23101  			"         │   │   │   │   │               ├─ tableId: 12\n" +
 23102  			"         │   │   │   │   │               └─ Table\n" +
 23103  			"         │   │   │   │   │                   ├─ name: movie_info\n" +
 23104  			"         │   │   │   │   │                   └─ columns: [movie_id info_type_id info]\n" +
 23105  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 23106  			"         │   │   │   │       └─ ProcessTable\n" +
 23107  			"         │   │   │   │           └─ Table\n" +
 23108  			"         │   │   │   │               ├─ name: movie_keyword\n" +
 23109  			"         │   │   │   │               └─ columns: [movie_id keyword_id]\n" +
 23110  			"         │   │   │   └─ Filter\n" +
 23111  			"         │   │   │       ├─ AND\n" +
 23112  			"         │   │   │       │   ├─ Eq\n" +
 23113  			"         │   │   │       │   │   ├─ n.gender:2\n" +
 23114  			"         │   │   │       │   │   └─ f (longtext)\n" +
 23115  			"         │   │   │       │   └─ n.name LIKE '%An%'\n" +
 23116  			"         │   │   │       └─ TableAlias(n)\n" +
 23117  			"         │   │   │           └─ ProcessTable\n" +
 23118  			"         │   │   │               └─ Table\n" +
 23119  			"         │   │   │                   ├─ name: name\n" +
 23120  			"         │   │   │                   └─ columns: [id name gender]\n" +
 23121  			"         │   │   └─ TableAlias(pi)\n" +
 23122  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 23123  			"         │   │           ├─ index: [person_info.person_id]\n" +
 23124  			"         │   │           ├─ keys: [n.id:30!null]\n" +
 23125  			"         │   │           ├─ colSet: (67-71)\n" +
 23126  			"         │   │           ├─ tableId: 15\n" +
 23127  			"         │   │           └─ Table\n" +
 23128  			"         │   │               ├─ name: person_info\n" +
 23129  			"         │   │               └─ columns: [person_id info_type_id]\n" +
 23130  			"         │   └─ HashLookup\n" +
 23131  			"         │       ├─ left-key: TUPLE(ci.role_id:14!null)\n" +
 23132  			"         │       ├─ right-key: TUPLE(rt.id:0!null)\n" +
 23133  			"         │       └─ Filter\n" +
 23134  			"         │           ├─ Eq\n" +
 23135  			"         │           │   ├─ rt.role:1!null\n" +
 23136  			"         │           │   └─ actress (longtext)\n" +
 23137  			"         │           └─ TableAlias(rt)\n" +
 23138  			"         │               └─ ProcessTable\n" +
 23139  			"         │                   └─ Table\n" +
 23140  			"         │                       ├─ name: role_type\n" +
 23141  			"         │                       └─ columns: [id role]\n" +
 23142  			"         └─ HashLookup\n" +
 23143  			"             ├─ left-key: TUPLE(mi.movie_id:25!null, mc.movie_id:23!null, ci.movie_id:11!null, mk.movie_id:28!null, cc.movie_id:1)\n" +
 23144  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 23145  			"             └─ Filter\n" +
 23146  			"                 ├─ AND\n" +
 23147  			"                 │   ├─ AND\n" +
 23148  			"                 │   │   ├─ Eq\n" +
 23149  			"                 │   │   │   ├─ t.title:1!null\n" +
 23150  			"                 │   │   │   └─ Shrek 2 (longtext)\n" +
 23151  			"                 │   │   └─ GreaterThanOrEqual\n" +
 23152  			"                 │   │       ├─ t.production_year:2\n" +
 23153  			"                 │   │       └─ 2000 (smallint)\n" +
 23154  			"                 │   └─ LessThanOrEqual\n" +
 23155  			"                 │       ├─ t.production_year:2\n" +
 23156  			"                 │       └─ 2005 (smallint)\n" +
 23157  			"                 └─ TableAlias(t)\n" +
 23158  			"                     └─ ProcessTable\n" +
 23159  			"                         └─ Table\n" +
 23160  			"                             ├─ name: title\n" +
 23161  			"                             └─ columns: [id title production_year]\n" +
 23162  			"",
 23163  		ExpectedEstimates: "Project\n" +
 23164  			" ├─ columns: [min(chn.name) as voiced_char, min(n.name) as voicing_actress, min(t.title) as voiced_animation]\n" +
 23165  			" └─ GroupBy\n" +
 23166  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 23167  			"     ├─ Grouping()\n" +
 23168  			"     └─ HashJoin\n" +
 23169  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = cc.movie_id))\n" +
 23170  			"         ├─ HashJoin\n" +
 23171  			"         │   ├─ (rt.id = ci.role_id)\n" +
 23172  			"         │   ├─ LookupJoin\n" +
 23173  			"         │   │   ├─ ((ci.person_id = pi.person_id) AND (it3.id = pi.info_type_id))\n" +
 23174  			"         │   │   ├─ InnerJoin\n" +
 23175  			"         │   │   │   ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 23176  			"         │   │   │   ├─ InnerJoin\n" +
 23177  			"         │   │   │   │   ├─ (((((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (k.id = mk.keyword_id))\n" +
 23178  			"         │   │   │   │   ├─ LookupJoin\n" +
 23179  			"         │   │   │   │   │   ├─ (((mi.movie_id = ci.movie_id) AND (mi.movie_id = cc.movie_id)) AND (it.id = mi.info_type_id))\n" +
 23180  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 23181  			"         │   │   │   │   │   │   ├─ (((mc.movie_id = ci.movie_id) AND (mc.movie_id = cc.movie_id)) AND (cn.id = mc.company_id))\n" +
 23182  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 23183  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23184  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23185  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23186  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 23187  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ ((ci.movie_id = cc.movie_id) AND (ci.person_id = an.person_id))\n" +
 23188  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23189  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23190  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct2.id = cc.status_id)\n" +
 23191  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23192  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct1.id = cc.subject_id)\n" +
 23193  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23194  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 23195  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Table\n" +
 23196  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ name: aka_name\n" +
 23197  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ columns: [person_id]\n" +
 23198  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 23199  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23200  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: complete_cast\n" +
 23201  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [movie_id subject_id status_id]\n" +
 23202  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23203  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct1.kind = 'cast')\n" +
 23204  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 23205  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23206  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23207  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23208  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23209  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct2.kind = 'complete+verified')\n" +
 23210  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 23211  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23212  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23213  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23214  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23215  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ (chn.name = 'Queen')\n" +
 23216  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(chn)\n" +
 23217  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23218  			"         │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: char_name\n" +
 23219  			"         │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id name]\n" +
 23220  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23221  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ (ci.note HASH IN ('(voice)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 23222  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 23223  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 23224  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 23225  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [person_id movie_id person_role_id note role_id]\n" +
 23226  			"         │   │   │   │   │   │   │   │   │   │   │               └─ keys: chn.id\n" +
 23227  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23228  			"         │   │   │   │   │   │   │   │   │   │       ├─ (cn.country_code = '[us]')\n" +
 23229  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 23230  			"         │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23231  			"         │   │   │   │   │   │   │   │   │   │               ├─ name: company_name\n" +
 23232  			"         │   │   │   │   │   │   │   │   │   │               └─ columns: [id country_code]\n" +
 23233  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23234  			"         │   │   │   │   │   │   │   │   │       ├─ (it.info = 'release dates')\n" +
 23235  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 23236  			"         │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23237  			"         │   │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23238  			"         │   │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23239  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 23240  			"         │   │   │   │   │   │   │   │       ├─ (it3.info = 'height')\n" +
 23241  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 23242  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 23243  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23244  			"         │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23245  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 23246  			"         │   │   │   │   │   │   │       ├─ (k.keyword = 'computer-animation')\n" +
 23247  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 23248  			"         │   │   │   │   │   │   │           └─ Table\n" +
 23249  			"         │   │   │   │   │   │   │               ├─ name: keyword\n" +
 23250  			"         │   │   │   │   │   │   │               └─ columns: [id keyword]\n" +
 23251  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 23252  			"         │   │   │   │   │   │       └─ Table\n" +
 23253  			"         │   │   │   │   │   │           ├─ name: movie_companies\n" +
 23254  			"         │   │   │   │   │   │           └─ columns: [movie_id company_id]\n" +
 23255  			"         │   │   │   │   │   └─ Filter\n" +
 23256  			"         │   │   │   │   │       ├─ mi.info LIKE 'USA:%200%'\n" +
 23257  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 23258  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 23259  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 23260  			"         │   │   │   │   │               ├─ columns: [movie_id info_type_id info]\n" +
 23261  			"         │   │   │   │   │               └─ keys: mc.movie_id\n" +
 23262  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 23263  			"         │   │   │   │       └─ Table\n" +
 23264  			"         │   │   │   │           ├─ name: movie_keyword\n" +
 23265  			"         │   │   │   │           └─ columns: [movie_id keyword_id]\n" +
 23266  			"         │   │   │   └─ Filter\n" +
 23267  			"         │   │   │       ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 23268  			"         │   │   │       └─ TableAlias(n)\n" +
 23269  			"         │   │   │           └─ Table\n" +
 23270  			"         │   │   │               ├─ name: name\n" +
 23271  			"         │   │   │               └─ columns: [id name gender]\n" +
 23272  			"         │   │   └─ TableAlias(pi)\n" +
 23273  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 23274  			"         │   │           ├─ index: [person_info.person_id]\n" +
 23275  			"         │   │           ├─ columns: [person_id info_type_id]\n" +
 23276  			"         │   │           └─ keys: n.id\n" +
 23277  			"         │   └─ HashLookup\n" +
 23278  			"         │       ├─ left-key: (ci.role_id)\n" +
 23279  			"         │       ├─ right-key: (rt.id)\n" +
 23280  			"         │       └─ Filter\n" +
 23281  			"         │           ├─ (rt.role = 'actress')\n" +
 23282  			"         │           └─ TableAlias(rt)\n" +
 23283  			"         │               └─ Table\n" +
 23284  			"         │                   ├─ name: role_type\n" +
 23285  			"         │                   └─ columns: [id role]\n" +
 23286  			"         └─ HashLookup\n" +
 23287  			"             ├─ left-key: (mi.movie_id, mc.movie_id, ci.movie_id, mk.movie_id, cc.movie_id)\n" +
 23288  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 23289  			"             └─ Filter\n" +
 23290  			"                 ├─ (((t.title = 'Shrek 2') AND (t.production_year >= 2000)) AND (t.production_year <= 2005))\n" +
 23291  			"                 └─ TableAlias(t)\n" +
 23292  			"                     └─ Table\n" +
 23293  			"                         ├─ name: title\n" +
 23294  			"                         └─ columns: [id title production_year]\n" +
 23295  			"",
 23296  		ExpectedAnalysis: "Project\n" +
 23297  			" ├─ columns: [min(chn.name) as voiced_char, min(n.name) as voicing_actress, min(t.title) as voiced_animation]\n" +
 23298  			" └─ GroupBy\n" +
 23299  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 23300  			"     ├─ Grouping()\n" +
 23301  			"     └─ HashJoin\n" +
 23302  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = cc.movie_id))\n" +
 23303  			"         ├─ HashJoin\n" +
 23304  			"         │   ├─ (rt.id = ci.role_id)\n" +
 23305  			"         │   ├─ LookupJoin\n" +
 23306  			"         │   │   ├─ ((ci.person_id = pi.person_id) AND (it3.id = pi.info_type_id))\n" +
 23307  			"         │   │   ├─ InnerJoin\n" +
 23308  			"         │   │   │   ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 23309  			"         │   │   │   ├─ InnerJoin\n" +
 23310  			"         │   │   │   │   ├─ (((((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (k.id = mk.keyword_id))\n" +
 23311  			"         │   │   │   │   ├─ LookupJoin\n" +
 23312  			"         │   │   │   │   │   ├─ (((mi.movie_id = ci.movie_id) AND (mi.movie_id = cc.movie_id)) AND (it.id = mi.info_type_id))\n" +
 23313  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 23314  			"         │   │   │   │   │   │   ├─ (((mc.movie_id = ci.movie_id) AND (mc.movie_id = cc.movie_id)) AND (cn.id = mc.company_id))\n" +
 23315  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 23316  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23317  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23318  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23319  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 23320  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ ((ci.movie_id = cc.movie_id) AND (ci.person_id = an.person_id))\n" +
 23321  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23322  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23323  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct2.id = cc.status_id)\n" +
 23324  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23325  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct1.id = cc.subject_id)\n" +
 23326  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23327  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 23328  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Table\n" +
 23329  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ name: aka_name\n" +
 23330  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ columns: [person_id]\n" +
 23331  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 23332  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23333  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: complete_cast\n" +
 23334  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [movie_id subject_id status_id]\n" +
 23335  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23336  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct1.kind = 'cast')\n" +
 23337  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 23338  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23339  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23340  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23341  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23342  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct2.kind = 'complete+verified')\n" +
 23343  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 23344  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23345  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23346  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23347  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23348  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ (chn.name = 'Queen')\n" +
 23349  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(chn)\n" +
 23350  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23351  			"         │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: char_name\n" +
 23352  			"         │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id name]\n" +
 23353  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23354  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ (ci.note HASH IN ('(voice)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 23355  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 23356  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 23357  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 23358  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [person_id movie_id person_role_id note role_id]\n" +
 23359  			"         │   │   │   │   │   │   │   │   │   │   │               └─ keys: chn.id\n" +
 23360  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23361  			"         │   │   │   │   │   │   │   │   │   │       ├─ (cn.country_code = '[us]')\n" +
 23362  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 23363  			"         │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23364  			"         │   │   │   │   │   │   │   │   │   │               ├─ name: company_name\n" +
 23365  			"         │   │   │   │   │   │   │   │   │   │               └─ columns: [id country_code]\n" +
 23366  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23367  			"         │   │   │   │   │   │   │   │   │       ├─ (it.info = 'release dates')\n" +
 23368  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 23369  			"         │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23370  			"         │   │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23371  			"         │   │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23372  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 23373  			"         │   │   │   │   │   │   │   │       ├─ (it3.info = 'height')\n" +
 23374  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 23375  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 23376  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23377  			"         │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23378  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 23379  			"         │   │   │   │   │   │   │       ├─ (k.keyword = 'computer-animation')\n" +
 23380  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 23381  			"         │   │   │   │   │   │   │           └─ Table\n" +
 23382  			"         │   │   │   │   │   │   │               ├─ name: keyword\n" +
 23383  			"         │   │   │   │   │   │   │               └─ columns: [id keyword]\n" +
 23384  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 23385  			"         │   │   │   │   │   │       └─ Table\n" +
 23386  			"         │   │   │   │   │   │           ├─ name: movie_companies\n" +
 23387  			"         │   │   │   │   │   │           └─ columns: [movie_id company_id]\n" +
 23388  			"         │   │   │   │   │   └─ Filter\n" +
 23389  			"         │   │   │   │   │       ├─ mi.info LIKE 'USA:%200%'\n" +
 23390  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 23391  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 23392  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 23393  			"         │   │   │   │   │               ├─ columns: [movie_id info_type_id info]\n" +
 23394  			"         │   │   │   │   │               └─ keys: mc.movie_id\n" +
 23395  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 23396  			"         │   │   │   │       └─ Table\n" +
 23397  			"         │   │   │   │           ├─ name: movie_keyword\n" +
 23398  			"         │   │   │   │           └─ columns: [movie_id keyword_id]\n" +
 23399  			"         │   │   │   └─ Filter\n" +
 23400  			"         │   │   │       ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 23401  			"         │   │   │       └─ TableAlias(n)\n" +
 23402  			"         │   │   │           └─ Table\n" +
 23403  			"         │   │   │               ├─ name: name\n" +
 23404  			"         │   │   │               └─ columns: [id name gender]\n" +
 23405  			"         │   │   └─ TableAlias(pi)\n" +
 23406  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 23407  			"         │   │           ├─ index: [person_info.person_id]\n" +
 23408  			"         │   │           ├─ columns: [person_id info_type_id]\n" +
 23409  			"         │   │           └─ keys: n.id\n" +
 23410  			"         │   └─ HashLookup\n" +
 23411  			"         │       ├─ left-key: (ci.role_id)\n" +
 23412  			"         │       ├─ right-key: (rt.id)\n" +
 23413  			"         │       └─ Filter\n" +
 23414  			"         │           ├─ (rt.role = 'actress')\n" +
 23415  			"         │           └─ TableAlias(rt)\n" +
 23416  			"         │               └─ Table\n" +
 23417  			"         │                   ├─ name: role_type\n" +
 23418  			"         │                   └─ columns: [id role]\n" +
 23419  			"         └─ HashLookup\n" +
 23420  			"             ├─ left-key: (mi.movie_id, mc.movie_id, ci.movie_id, mk.movie_id, cc.movie_id)\n" +
 23421  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 23422  			"             └─ Filter\n" +
 23423  			"                 ├─ (((t.title = 'Shrek 2') AND (t.production_year >= 2000)) AND (t.production_year <= 2005))\n" +
 23424  			"                 └─ TableAlias(t)\n" +
 23425  			"                     └─ Table\n" +
 23426  			"                         ├─ name: title\n" +
 23427  			"                         └─ columns: [id title production_year]\n" +
 23428  			"",
 23429  	},
 23430  	{
 23431  		Query: `
 23432  SELECT MIN(chn.name) AS voiced_char,
 23433         MIN(n.name) AS voicing_actress,
 23434         MIN(t.title) AS voiced_animation
 23435  FROM aka_name AS an,
 23436       complete_cast AS cc,
 23437       comp_cast_type AS cct1,
 23438       comp_cast_type AS cct2,
 23439       char_name AS chn,
 23440       cast_info AS ci,
 23441       company_name AS cn,
 23442       info_type AS it,
 23443       info_type AS it3,
 23444       keyword AS k,
 23445       movie_companies AS mc,
 23446       movie_info AS mi,
 23447       movie_keyword AS mk,
 23448       name AS n,
 23449       person_info AS pi,
 23450       role_type AS rt,
 23451       title AS t
 23452  WHERE cct1.kind ='cast'
 23453    AND cct2.kind ='complete+verified'
 23454    AND ci.note IN ('(voice)',
 23455                    '(voice: Japanese version)',
 23456                    '(voice) (uncredited)',
 23457                    '(voice: English version)')
 23458    AND cn.country_code ='[us]'
 23459    AND it.info = 'release dates'
 23460    AND it3.info = 'trivia'
 23461    AND k.keyword = 'computer-animation'
 23462    AND mi.info IS NOT NULL
 23463    AND (mi.info LIKE 'Japan:%200%'
 23464         OR mi.info LIKE 'USA:%200%')
 23465    AND n.gender ='f'
 23466    AND n.name LIKE '%An%'
 23467    AND rt.role ='actress'
 23468    AND t.production_year BETWEEN 2000 AND 2010
 23469    AND t.id = mi.movie_id
 23470    AND t.id = mc.movie_id
 23471    AND t.id = ci.movie_id
 23472    AND t.id = mk.movie_id
 23473    AND t.id = cc.movie_id
 23474    AND mc.movie_id = ci.movie_id
 23475    AND mc.movie_id = mi.movie_id
 23476    AND mc.movie_id = mk.movie_id
 23477    AND mc.movie_id = cc.movie_id
 23478    AND mi.movie_id = ci.movie_id
 23479    AND mi.movie_id = mk.movie_id
 23480    AND mi.movie_id = cc.movie_id
 23481    AND ci.movie_id = mk.movie_id
 23482    AND ci.movie_id = cc.movie_id
 23483    AND mk.movie_id = cc.movie_id
 23484    AND cn.id = mc.company_id
 23485    AND it.id = mi.info_type_id
 23486    AND n.id = ci.person_id
 23487    AND rt.id = ci.role_id
 23488    AND n.id = an.person_id
 23489    AND ci.person_id = an.person_id
 23490    AND chn.id = ci.person_role_id
 23491    AND n.id = pi.person_id
 23492    AND ci.person_id = pi.person_id
 23493    AND it3.id = pi.info_type_id
 23494    AND k.id = mk.keyword_id
 23495    AND cct1.id = cc.subject_id
 23496    AND cct2.id = cc.status_id;
 23497  
 23498  `,
 23499  		ExpectedPlan: "Project\n" +
 23500  			" ├─ columns: [min(chn.name):0!null as voiced_char, min(n.name):1!null as voicing_actress, min(t.title):2!null as voiced_animation]\n" +
 23501  			" └─ GroupBy\n" +
 23502  			"     ├─ select: MIN(chn.name:9!null), MIN(n.name:31!null), MIN(t.title:38!null)\n" +
 23503  			"     ├─ group: \n" +
 23504  			"     └─ HashJoin\n" +
 23505  			"         ├─ AND\n" +
 23506  			"         │   ├─ AND\n" +
 23507  			"         │   │   ├─ AND\n" +
 23508  			"         │   │   │   ├─ AND\n" +
 23509  			"         │   │   │   │   ├─ Eq\n" +
 23510  			"         │   │   │   │   │   ├─ t.id:37!null\n" +
 23511  			"         │   │   │   │   │   └─ mi.movie_id:25!null\n" +
 23512  			"         │   │   │   │   └─ Eq\n" +
 23513  			"         │   │   │   │       ├─ t.id:37!null\n" +
 23514  			"         │   │   │   │       └─ mc.movie_id:23!null\n" +
 23515  			"         │   │   │   └─ Eq\n" +
 23516  			"         │   │   │       ├─ t.id:37!null\n" +
 23517  			"         │   │   │       └─ ci.movie_id:11!null\n" +
 23518  			"         │   │   └─ Eq\n" +
 23519  			"         │   │       ├─ t.id:37!null\n" +
 23520  			"         │   │       └─ mk.movie_id:28!null\n" +
 23521  			"         │   └─ Eq\n" +
 23522  			"         │       ├─ t.id:37!null\n" +
 23523  			"         │       └─ cc.movie_id:1\n" +
 23524  			"         ├─ HashJoin\n" +
 23525  			"         │   ├─ Eq\n" +
 23526  			"         │   │   ├─ rt.id:35!null\n" +
 23527  			"         │   │   └─ ci.role_id:14!null\n" +
 23528  			"         │   ├─ LookupJoin\n" +
 23529  			"         │   │   ├─ AND\n" +
 23530  			"         │   │   │   ├─ Eq\n" +
 23531  			"         │   │   │   │   ├─ ci.person_id:10!null\n" +
 23532  			"         │   │   │   │   └─ pi.person_id:33!null\n" +
 23533  			"         │   │   │   └─ Eq\n" +
 23534  			"         │   │   │       ├─ it3.id:19!null\n" +
 23535  			"         │   │   │       └─ pi.info_type_id:34!null\n" +
 23536  			"         │   │   ├─ InnerJoin\n" +
 23537  			"         │   │   │   ├─ AND\n" +
 23538  			"         │   │   │   │   ├─ Eq\n" +
 23539  			"         │   │   │   │   │   ├─ n.id:30!null\n" +
 23540  			"         │   │   │   │   │   └─ ci.person_id:10!null\n" +
 23541  			"         │   │   │   │   └─ Eq\n" +
 23542  			"         │   │   │   │       ├─ n.id:30!null\n" +
 23543  			"         │   │   │   │       └─ an.person_id:0!null\n" +
 23544  			"         │   │   │   ├─ InnerJoin\n" +
 23545  			"         │   │   │   │   ├─ AND\n" +
 23546  			"         │   │   │   │   │   ├─ AND\n" +
 23547  			"         │   │   │   │   │   │   ├─ AND\n" +
 23548  			"         │   │   │   │   │   │   │   ├─ AND\n" +
 23549  			"         │   │   │   │   │   │   │   │   ├─ Eq\n" +
 23550  			"         │   │   │   │   │   │   │   │   │   ├─ mc.movie_id:23!null\n" +
 23551  			"         │   │   │   │   │   │   │   │   │   └─ mk.movie_id:28!null\n" +
 23552  			"         │   │   │   │   │   │   │   │   └─ Eq\n" +
 23553  			"         │   │   │   │   │   │   │   │       ├─ mi.movie_id:25!null\n" +
 23554  			"         │   │   │   │   │   │   │   │       └─ mk.movie_id:28!null\n" +
 23555  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 23556  			"         │   │   │   │   │   │   │       ├─ ci.movie_id:11!null\n" +
 23557  			"         │   │   │   │   │   │   │       └─ mk.movie_id:28!null\n" +
 23558  			"         │   │   │   │   │   │   └─ Eq\n" +
 23559  			"         │   │   │   │   │   │       ├─ mk.movie_id:28!null\n" +
 23560  			"         │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 23561  			"         │   │   │   │   │   └─ Eq\n" +
 23562  			"         │   │   │   │   │       ├─ k.id:21!null\n" +
 23563  			"         │   │   │   │   │       └─ mk.keyword_id:29!null\n" +
 23564  			"         │   │   │   │   ├─ LookupJoin\n" +
 23565  			"         │   │   │   │   │   ├─ AND\n" +
 23566  			"         │   │   │   │   │   │   ├─ AND\n" +
 23567  			"         │   │   │   │   │   │   │   ├─ Eq\n" +
 23568  			"         │   │   │   │   │   │   │   │   ├─ mi.movie_id:25!null\n" +
 23569  			"         │   │   │   │   │   │   │   │   └─ ci.movie_id:11!null\n" +
 23570  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 23571  			"         │   │   │   │   │   │   │       ├─ mi.movie_id:25!null\n" +
 23572  			"         │   │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 23573  			"         │   │   │   │   │   │   └─ Eq\n" +
 23574  			"         │   │   │   │   │   │       ├─ it.id:17!null\n" +
 23575  			"         │   │   │   │   │   │       └─ mi.info_type_id:26!null\n" +
 23576  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 23577  			"         │   │   │   │   │   │   ├─ AND\n" +
 23578  			"         │   │   │   │   │   │   │   ├─ AND\n" +
 23579  			"         │   │   │   │   │   │   │   │   ├─ Eq\n" +
 23580  			"         │   │   │   │   │   │   │   │   │   ├─ mc.movie_id:23!null\n" +
 23581  			"         │   │   │   │   │   │   │   │   │   └─ ci.movie_id:11!null\n" +
 23582  			"         │   │   │   │   │   │   │   │   └─ Eq\n" +
 23583  			"         │   │   │   │   │   │   │   │       ├─ mc.movie_id:23!null\n" +
 23584  			"         │   │   │   │   │   │   │   │       └─ cc.movie_id:1\n" +
 23585  			"         │   │   │   │   │   │   │   └─ Eq\n" +
 23586  			"         │   │   │   │   │   │   │       ├─ cn.id:15!null\n" +
 23587  			"         │   │   │   │   │   │   │       └─ mc.company_id:24!null\n" +
 23588  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 23589  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23590  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23591  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23592  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 23593  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ AND\n" +
 23594  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 23595  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ ci.movie_id:11!null\n" +
 23596  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.movie_id:1\n" +
 23597  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ Eq\n" +
 23598  			"         │   │   │   │   │   │   │   │   │   │   │   │       ├─ ci.person_id:10!null\n" +
 23599  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ an.person_id:0!null\n" +
 23600  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23601  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23602  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 23603  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ cct2.id:6!null\n" +
 23604  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.status_id:3!null\n" +
 23605  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23606  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ Eq\n" +
 23607  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ cct1.id:4!null\n" +
 23608  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ cc.subject_id:2!null\n" +
 23609  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23610  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 23611  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ ProcessTable\n" +
 23612  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23613  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: aka_name\n" +
 23614  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [person_id]\n" +
 23615  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 23616  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ ProcessTable\n" +
 23617  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23618  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: complete_cast\n" +
 23619  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [movie_id subject_id status_id]\n" +
 23620  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23621  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23622  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ cct1.kind:1!null\n" +
 23623  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       │   └─ cast (longtext)\n" +
 23624  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 23625  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23626  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23627  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │                   ├─ name: comp_cast_type\n" +
 23628  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [id kind]\n" +
 23629  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23630  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23631  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       │   ├─ cct2.kind:1!null\n" +
 23632  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       │   └─ complete+verified (longtext)\n" +
 23633  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 23634  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23635  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23636  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [id kind]\n" +
 23637  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ colSet: (15,16)\n" +
 23638  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ tableId: 4\n" +
 23639  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(chn)\n" +
 23640  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ ProcessTable\n" +
 23641  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23642  			"         │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: char_name\n" +
 23643  			"         │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id name]\n" +
 23644  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23645  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ HashIn\n" +
 23646  			"         │   │   │   │   │   │   │   │   │   │   │       │   ├─ ci.note:3\n" +
 23647  			"         │   │   │   │   │   │   │   │   │   │   │       │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 23648  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 23649  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 23650  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 23651  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ keys: [chn.id:8!null]\n" +
 23652  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ colSet: (24-30)\n" +
 23653  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ tableId: 6\n" +
 23654  			"         │   │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23655  			"         │   │   │   │   │   │   │   │   │   │   │                   ├─ name: cast_info\n" +
 23656  			"         │   │   │   │   │   │   │   │   │   │   │                   └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 23657  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23658  			"         │   │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23659  			"         │   │   │   │   │   │   │   │   │   │       │   ├─ cn.country_code:1\n" +
 23660  			"         │   │   │   │   │   │   │   │   │   │       │   └─ [us] (longtext)\n" +
 23661  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 23662  			"         │   │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23663  			"         │   │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23664  			"         │   │   │   │   │   │   │   │   │   │                   ├─ name: company_name\n" +
 23665  			"         │   │   │   │   │   │   │   │   │   │                   └─ columns: [id country_code]\n" +
 23666  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23667  			"         │   │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23668  			"         │   │   │   │   │   │   │   │   │       │   ├─ it.info:1!null\n" +
 23669  			"         │   │   │   │   │   │   │   │   │       │   └─ release dates (longtext)\n" +
 23670  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 23671  			"         │   │   │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23672  			"         │   │   │   │   │   │   │   │   │               └─ Table\n" +
 23673  			"         │   │   │   │   │   │   │   │   │                   ├─ name: info_type\n" +
 23674  			"         │   │   │   │   │   │   │   │   │                   └─ columns: [id info]\n" +
 23675  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 23676  			"         │   │   │   │   │   │   │   │       ├─ Eq\n" +
 23677  			"         │   │   │   │   │   │   │   │       │   ├─ it3.info:1!null\n" +
 23678  			"         │   │   │   │   │   │   │   │       │   └─ trivia (longtext)\n" +
 23679  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 23680  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 23681  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23682  			"         │   │   │   │   │   │   │   │               ├─ columns: [id info]\n" +
 23683  			"         │   │   │   │   │   │   │   │               ├─ colSet: (40,41)\n" +
 23684  			"         │   │   │   │   │   │   │   │               └─ tableId: 9\n" +
 23685  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 23686  			"         │   │   │   │   │   │   │       ├─ Eq\n" +
 23687  			"         │   │   │   │   │   │   │       │   ├─ k.keyword:1!null\n" +
 23688  			"         │   │   │   │   │   │   │       │   └─ computer-animation (longtext)\n" +
 23689  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 23690  			"         │   │   │   │   │   │   │           └─ ProcessTable\n" +
 23691  			"         │   │   │   │   │   │   │               └─ Table\n" +
 23692  			"         │   │   │   │   │   │   │                   ├─ name: keyword\n" +
 23693  			"         │   │   │   │   │   │   │                   └─ columns: [id keyword]\n" +
 23694  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 23695  			"         │   │   │   │   │   │       └─ ProcessTable\n" +
 23696  			"         │   │   │   │   │   │           └─ Table\n" +
 23697  			"         │   │   │   │   │   │               ├─ name: movie_companies\n" +
 23698  			"         │   │   │   │   │   │               └─ columns: [movie_id company_id]\n" +
 23699  			"         │   │   │   │   │   └─ Filter\n" +
 23700  			"         │   │   │   │   │       ├─ AND\n" +
 23701  			"         │   │   │   │   │       │   ├─ NOT\n" +
 23702  			"         │   │   │   │   │       │   │   └─ mi.info:2!null IS NULL\n" +
 23703  			"         │   │   │   │   │       │   └─ Or\n" +
 23704  			"         │   │   │   │   │       │       ├─ mi.info LIKE 'Japan:%200%'\n" +
 23705  			"         │   │   │   │   │       │       └─ mi.info LIKE 'USA:%200%'\n" +
 23706  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 23707  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 23708  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 23709  			"         │   │   │   │   │               ├─ keys: [mc.movie_id:23!null]\n" +
 23710  			"         │   │   │   │   │               ├─ colSet: (50-54)\n" +
 23711  			"         │   │   │   │   │               ├─ tableId: 12\n" +
 23712  			"         │   │   │   │   │               └─ Table\n" +
 23713  			"         │   │   │   │   │                   ├─ name: movie_info\n" +
 23714  			"         │   │   │   │   │                   └─ columns: [movie_id info_type_id info]\n" +
 23715  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 23716  			"         │   │   │   │       └─ ProcessTable\n" +
 23717  			"         │   │   │   │           └─ Table\n" +
 23718  			"         │   │   │   │               ├─ name: movie_keyword\n" +
 23719  			"         │   │   │   │               └─ columns: [movie_id keyword_id]\n" +
 23720  			"         │   │   │   └─ Filter\n" +
 23721  			"         │   │   │       ├─ AND\n" +
 23722  			"         │   │   │       │   ├─ Eq\n" +
 23723  			"         │   │   │       │   │   ├─ n.gender:2\n" +
 23724  			"         │   │   │       │   │   └─ f (longtext)\n" +
 23725  			"         │   │   │       │   └─ n.name LIKE '%An%'\n" +
 23726  			"         │   │   │       └─ TableAlias(n)\n" +
 23727  			"         │   │   │           └─ ProcessTable\n" +
 23728  			"         │   │   │               └─ Table\n" +
 23729  			"         │   │   │                   ├─ name: name\n" +
 23730  			"         │   │   │                   └─ columns: [id name gender]\n" +
 23731  			"         │   │   └─ TableAlias(pi)\n" +
 23732  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 23733  			"         │   │           ├─ index: [person_info.person_id]\n" +
 23734  			"         │   │           ├─ keys: [n.id:30!null]\n" +
 23735  			"         │   │           ├─ colSet: (67-71)\n" +
 23736  			"         │   │           ├─ tableId: 15\n" +
 23737  			"         │   │           └─ Table\n" +
 23738  			"         │   │               ├─ name: person_info\n" +
 23739  			"         │   │               └─ columns: [person_id info_type_id]\n" +
 23740  			"         │   └─ HashLookup\n" +
 23741  			"         │       ├─ left-key: TUPLE(ci.role_id:14!null)\n" +
 23742  			"         │       ├─ right-key: TUPLE(rt.id:0!null)\n" +
 23743  			"         │       └─ Filter\n" +
 23744  			"         │           ├─ Eq\n" +
 23745  			"         │           │   ├─ rt.role:1!null\n" +
 23746  			"         │           │   └─ actress (longtext)\n" +
 23747  			"         │           └─ TableAlias(rt)\n" +
 23748  			"         │               └─ ProcessTable\n" +
 23749  			"         │                   └─ Table\n" +
 23750  			"         │                       ├─ name: role_type\n" +
 23751  			"         │                       └─ columns: [id role]\n" +
 23752  			"         └─ HashLookup\n" +
 23753  			"             ├─ left-key: TUPLE(mi.movie_id:25!null, mc.movie_id:23!null, ci.movie_id:11!null, mk.movie_id:28!null, cc.movie_id:1)\n" +
 23754  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 23755  			"             └─ Filter\n" +
 23756  			"                 ├─ AND\n" +
 23757  			"                 │   ├─ GreaterThanOrEqual\n" +
 23758  			"                 │   │   ├─ t.production_year:2\n" +
 23759  			"                 │   │   └─ 2000 (smallint)\n" +
 23760  			"                 │   └─ LessThanOrEqual\n" +
 23761  			"                 │       ├─ t.production_year:2\n" +
 23762  			"                 │       └─ 2010 (smallint)\n" +
 23763  			"                 └─ TableAlias(t)\n" +
 23764  			"                     └─ ProcessTable\n" +
 23765  			"                         └─ Table\n" +
 23766  			"                             ├─ name: title\n" +
 23767  			"                             └─ columns: [id title production_year]\n" +
 23768  			"",
 23769  		ExpectedEstimates: "Project\n" +
 23770  			" ├─ columns: [min(chn.name) as voiced_char, min(n.name) as voicing_actress, min(t.title) as voiced_animation]\n" +
 23771  			" └─ GroupBy\n" +
 23772  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 23773  			"     ├─ Grouping()\n" +
 23774  			"     └─ HashJoin\n" +
 23775  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = cc.movie_id))\n" +
 23776  			"         ├─ HashJoin\n" +
 23777  			"         │   ├─ (rt.id = ci.role_id)\n" +
 23778  			"         │   ├─ LookupJoin\n" +
 23779  			"         │   │   ├─ ((ci.person_id = pi.person_id) AND (it3.id = pi.info_type_id))\n" +
 23780  			"         │   │   ├─ InnerJoin\n" +
 23781  			"         │   │   │   ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 23782  			"         │   │   │   ├─ InnerJoin\n" +
 23783  			"         │   │   │   │   ├─ (((((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (k.id = mk.keyword_id))\n" +
 23784  			"         │   │   │   │   ├─ LookupJoin\n" +
 23785  			"         │   │   │   │   │   ├─ (((mi.movie_id = ci.movie_id) AND (mi.movie_id = cc.movie_id)) AND (it.id = mi.info_type_id))\n" +
 23786  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 23787  			"         │   │   │   │   │   │   ├─ (((mc.movie_id = ci.movie_id) AND (mc.movie_id = cc.movie_id)) AND (cn.id = mc.company_id))\n" +
 23788  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 23789  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23790  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23791  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23792  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 23793  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ ((ci.movie_id = cc.movie_id) AND (ci.person_id = an.person_id))\n" +
 23794  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23795  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23796  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct2.id = cc.status_id)\n" +
 23797  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23798  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct1.id = cc.subject_id)\n" +
 23799  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23800  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 23801  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Table\n" +
 23802  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ name: aka_name\n" +
 23803  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ columns: [person_id]\n" +
 23804  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 23805  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23806  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: complete_cast\n" +
 23807  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [movie_id subject_id status_id]\n" +
 23808  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23809  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct1.kind = 'cast')\n" +
 23810  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 23811  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23812  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23813  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23814  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23815  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct2.kind = 'complete+verified')\n" +
 23816  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 23817  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23818  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23819  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23820  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(chn)\n" +
 23821  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23822  			"         │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: char_name\n" +
 23823  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [id name]\n" +
 23824  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23825  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 23826  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 23827  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 23828  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 23829  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [person_id movie_id person_role_id note role_id]\n" +
 23830  			"         │   │   │   │   │   │   │   │   │   │   │               └─ keys: chn.id\n" +
 23831  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23832  			"         │   │   │   │   │   │   │   │   │   │       ├─ (cn.country_code = '[us]')\n" +
 23833  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 23834  			"         │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23835  			"         │   │   │   │   │   │   │   │   │   │               ├─ name: company_name\n" +
 23836  			"         │   │   │   │   │   │   │   │   │   │               └─ columns: [id country_code]\n" +
 23837  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23838  			"         │   │   │   │   │   │   │   │   │       ├─ (it.info = 'release dates')\n" +
 23839  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 23840  			"         │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23841  			"         │   │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23842  			"         │   │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23843  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 23844  			"         │   │   │   │   │   │   │   │       ├─ (it3.info = 'trivia')\n" +
 23845  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 23846  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 23847  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23848  			"         │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23849  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 23850  			"         │   │   │   │   │   │   │       ├─ (k.keyword = 'computer-animation')\n" +
 23851  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 23852  			"         │   │   │   │   │   │   │           └─ Table\n" +
 23853  			"         │   │   │   │   │   │   │               ├─ name: keyword\n" +
 23854  			"         │   │   │   │   │   │   │               └─ columns: [id keyword]\n" +
 23855  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 23856  			"         │   │   │   │   │   │       └─ Table\n" +
 23857  			"         │   │   │   │   │   │           ├─ name: movie_companies\n" +
 23858  			"         │   │   │   │   │   │           └─ columns: [movie_id company_id]\n" +
 23859  			"         │   │   │   │   │   └─ Filter\n" +
 23860  			"         │   │   │   │   │       ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
 23861  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 23862  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 23863  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 23864  			"         │   │   │   │   │               ├─ columns: [movie_id info_type_id info]\n" +
 23865  			"         │   │   │   │   │               └─ keys: mc.movie_id\n" +
 23866  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 23867  			"         │   │   │   │       └─ Table\n" +
 23868  			"         │   │   │   │           ├─ name: movie_keyword\n" +
 23869  			"         │   │   │   │           └─ columns: [movie_id keyword_id]\n" +
 23870  			"         │   │   │   └─ Filter\n" +
 23871  			"         │   │   │       ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 23872  			"         │   │   │       └─ TableAlias(n)\n" +
 23873  			"         │   │   │           └─ Table\n" +
 23874  			"         │   │   │               ├─ name: name\n" +
 23875  			"         │   │   │               └─ columns: [id name gender]\n" +
 23876  			"         │   │   └─ TableAlias(pi)\n" +
 23877  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 23878  			"         │   │           ├─ index: [person_info.person_id]\n" +
 23879  			"         │   │           ├─ columns: [person_id info_type_id]\n" +
 23880  			"         │   │           └─ keys: n.id\n" +
 23881  			"         │   └─ HashLookup\n" +
 23882  			"         │       ├─ left-key: (ci.role_id)\n" +
 23883  			"         │       ├─ right-key: (rt.id)\n" +
 23884  			"         │       └─ Filter\n" +
 23885  			"         │           ├─ (rt.role = 'actress')\n" +
 23886  			"         │           └─ TableAlias(rt)\n" +
 23887  			"         │               └─ Table\n" +
 23888  			"         │                   ├─ name: role_type\n" +
 23889  			"         │                   └─ columns: [id role]\n" +
 23890  			"         └─ HashLookup\n" +
 23891  			"             ├─ left-key: (mi.movie_id, mc.movie_id, ci.movie_id, mk.movie_id, cc.movie_id)\n" +
 23892  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 23893  			"             └─ Filter\n" +
 23894  			"                 ├─ ((t.production_year >= 2000) AND (t.production_year <= 2010))\n" +
 23895  			"                 └─ TableAlias(t)\n" +
 23896  			"                     └─ Table\n" +
 23897  			"                         ├─ name: title\n" +
 23898  			"                         └─ columns: [id title production_year]\n" +
 23899  			"",
 23900  		ExpectedAnalysis: "Project\n" +
 23901  			" ├─ columns: [min(chn.name) as voiced_char, min(n.name) as voicing_actress, min(t.title) as voiced_animation]\n" +
 23902  			" └─ GroupBy\n" +
 23903  			"     ├─ SelectedExprs(MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 23904  			"     ├─ Grouping()\n" +
 23905  			"     └─ HashJoin\n" +
 23906  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mc.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = cc.movie_id))\n" +
 23907  			"         ├─ HashJoin\n" +
 23908  			"         │   ├─ (rt.id = ci.role_id)\n" +
 23909  			"         │   ├─ LookupJoin\n" +
 23910  			"         │   │   ├─ ((ci.person_id = pi.person_id) AND (it3.id = pi.info_type_id))\n" +
 23911  			"         │   │   ├─ InnerJoin\n" +
 23912  			"         │   │   │   ├─ ((n.id = ci.person_id) AND (n.id = an.person_id))\n" +
 23913  			"         │   │   │   ├─ InnerJoin\n" +
 23914  			"         │   │   │   │   ├─ (((((mc.movie_id = mk.movie_id) AND (mi.movie_id = mk.movie_id)) AND (ci.movie_id = mk.movie_id)) AND (mk.movie_id = cc.movie_id)) AND (k.id = mk.keyword_id))\n" +
 23915  			"         │   │   │   │   ├─ LookupJoin\n" +
 23916  			"         │   │   │   │   │   ├─ (((mi.movie_id = ci.movie_id) AND (mi.movie_id = cc.movie_id)) AND (it.id = mi.info_type_id))\n" +
 23917  			"         │   │   │   │   │   ├─ InnerJoin\n" +
 23918  			"         │   │   │   │   │   │   ├─ (((mc.movie_id = ci.movie_id) AND (mc.movie_id = cc.movie_id)) AND (cn.id = mc.company_id))\n" +
 23919  			"         │   │   │   │   │   │   ├─ CrossJoin\n" +
 23920  			"         │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23921  			"         │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23922  			"         │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23923  			"         │   │   │   │   │   │   │   │   │   │   ├─ LookupJoin\n" +
 23924  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ ((ci.movie_id = cc.movie_id) AND (ci.person_id = an.person_id))\n" +
 23925  			"         │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23926  			"         │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23927  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct2.id = cc.status_id)\n" +
 23928  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ InnerJoin\n" +
 23929  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ (cct1.id = cc.subject_id)\n" +
 23930  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ CrossJoin\n" +
 23931  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   ├─ TableAlias(an)\n" +
 23932  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Table\n" +
 23933  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ name: aka_name\n" +
 23934  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ columns: [person_id]\n" +
 23935  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(cc)\n" +
 23936  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23937  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: complete_cast\n" +
 23938  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [movie_id subject_id status_id]\n" +
 23939  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23940  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct1.kind = 'cast')\n" +
 23941  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct1)\n" +
 23942  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23943  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23944  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23945  			"         │   │   │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23946  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       ├─ (cct2.kind = 'complete+verified')\n" +
 23947  			"         │   │   │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cct2)\n" +
 23948  			"         │   │   │   │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23949  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               ├─ name: comp_cast_type\n" +
 23950  			"         │   │   │   │   │   │   │   │   │   │   │   │   │               └─ columns: [id kind]\n" +
 23951  			"         │   │   │   │   │   │   │   │   │   │   │   │   └─ TableAlias(chn)\n" +
 23952  			"         │   │   │   │   │   │   │   │   │   │   │   │       └─ Table\n" +
 23953  			"         │   │   │   │   │   │   │   │   │   │   │   │           ├─ name: char_name\n" +
 23954  			"         │   │   │   │   │   │   │   │   │   │   │   │           └─ columns: [id name]\n" +
 23955  			"         │   │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23956  			"         │   │   │   │   │   │   │   │   │   │   │       ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 23957  			"         │   │   │   │   │   │   │   │   │   │   │       └─ TableAlias(ci)\n" +
 23958  			"         │   │   │   │   │   │   │   │   │   │   │           └─ IndexedTableAccess(cast_info)\n" +
 23959  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ index: [cast_info.person_role_id]\n" +
 23960  			"         │   │   │   │   │   │   │   │   │   │   │               ├─ columns: [person_id movie_id person_role_id note role_id]\n" +
 23961  			"         │   │   │   │   │   │   │   │   │   │   │               └─ keys: chn.id\n" +
 23962  			"         │   │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23963  			"         │   │   │   │   │   │   │   │   │   │       ├─ (cn.country_code = '[us]')\n" +
 23964  			"         │   │   │   │   │   │   │   │   │   │       └─ TableAlias(cn)\n" +
 23965  			"         │   │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23966  			"         │   │   │   │   │   │   │   │   │   │               ├─ name: company_name\n" +
 23967  			"         │   │   │   │   │   │   │   │   │   │               └─ columns: [id country_code]\n" +
 23968  			"         │   │   │   │   │   │   │   │   │   └─ Filter\n" +
 23969  			"         │   │   │   │   │   │   │   │   │       ├─ (it.info = 'release dates')\n" +
 23970  			"         │   │   │   │   │   │   │   │   │       └─ TableAlias(it)\n" +
 23971  			"         │   │   │   │   │   │   │   │   │           └─ Table\n" +
 23972  			"         │   │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23973  			"         │   │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23974  			"         │   │   │   │   │   │   │   │   └─ Filter\n" +
 23975  			"         │   │   │   │   │   │   │   │       ├─ (it3.info = 'trivia')\n" +
 23976  			"         │   │   │   │   │   │   │   │       └─ TableAlias(it3)\n" +
 23977  			"         │   │   │   │   │   │   │   │           └─ Table\n" +
 23978  			"         │   │   │   │   │   │   │   │               ├─ name: info_type\n" +
 23979  			"         │   │   │   │   │   │   │   │               └─ columns: [id info]\n" +
 23980  			"         │   │   │   │   │   │   │   └─ Filter\n" +
 23981  			"         │   │   │   │   │   │   │       ├─ (k.keyword = 'computer-animation')\n" +
 23982  			"         │   │   │   │   │   │   │       └─ TableAlias(k)\n" +
 23983  			"         │   │   │   │   │   │   │           └─ Table\n" +
 23984  			"         │   │   │   │   │   │   │               ├─ name: keyword\n" +
 23985  			"         │   │   │   │   │   │   │               └─ columns: [id keyword]\n" +
 23986  			"         │   │   │   │   │   │   └─ TableAlias(mc)\n" +
 23987  			"         │   │   │   │   │   │       └─ Table\n" +
 23988  			"         │   │   │   │   │   │           ├─ name: movie_companies\n" +
 23989  			"         │   │   │   │   │   │           └─ columns: [movie_id company_id]\n" +
 23990  			"         │   │   │   │   │   └─ Filter\n" +
 23991  			"         │   │   │   │   │       ├─ ((NOT(mi.info IS NULL)) AND (mi.info LIKE 'Japan:%200%' OR mi.info LIKE 'USA:%200%'))\n" +
 23992  			"         │   │   │   │   │       └─ TableAlias(mi)\n" +
 23993  			"         │   │   │   │   │           └─ IndexedTableAccess(movie_info)\n" +
 23994  			"         │   │   │   │   │               ├─ index: [movie_info.movie_id]\n" +
 23995  			"         │   │   │   │   │               ├─ columns: [movie_id info_type_id info]\n" +
 23996  			"         │   │   │   │   │               └─ keys: mc.movie_id\n" +
 23997  			"         │   │   │   │   └─ TableAlias(mk)\n" +
 23998  			"         │   │   │   │       └─ Table\n" +
 23999  			"         │   │   │   │           ├─ name: movie_keyword\n" +
 24000  			"         │   │   │   │           └─ columns: [movie_id keyword_id]\n" +
 24001  			"         │   │   │   └─ Filter\n" +
 24002  			"         │   │   │       ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 24003  			"         │   │   │       └─ TableAlias(n)\n" +
 24004  			"         │   │   │           └─ Table\n" +
 24005  			"         │   │   │               ├─ name: name\n" +
 24006  			"         │   │   │               └─ columns: [id name gender]\n" +
 24007  			"         │   │   └─ TableAlias(pi)\n" +
 24008  			"         │   │       └─ IndexedTableAccess(person_info)\n" +
 24009  			"         │   │           ├─ index: [person_info.person_id]\n" +
 24010  			"         │   │           ├─ columns: [person_id info_type_id]\n" +
 24011  			"         │   │           └─ keys: n.id\n" +
 24012  			"         │   └─ HashLookup\n" +
 24013  			"         │       ├─ left-key: (ci.role_id)\n" +
 24014  			"         │       ├─ right-key: (rt.id)\n" +
 24015  			"         │       └─ Filter\n" +
 24016  			"         │           ├─ (rt.role = 'actress')\n" +
 24017  			"         │           └─ TableAlias(rt)\n" +
 24018  			"         │               └─ Table\n" +
 24019  			"         │                   ├─ name: role_type\n" +
 24020  			"         │                   └─ columns: [id role]\n" +
 24021  			"         └─ HashLookup\n" +
 24022  			"             ├─ left-key: (mi.movie_id, mc.movie_id, ci.movie_id, mk.movie_id, cc.movie_id)\n" +
 24023  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 24024  			"             └─ Filter\n" +
 24025  			"                 ├─ ((t.production_year >= 2000) AND (t.production_year <= 2010))\n" +
 24026  			"                 └─ TableAlias(t)\n" +
 24027  			"                     └─ Table\n" +
 24028  			"                         ├─ name: title\n" +
 24029  			"                         └─ columns: [id title production_year]\n" +
 24030  			"",
 24031  	},
 24032  	{
 24033  		Query: `
 24034  SELECT MIN(t.title) AS movie_title
 24035  FROM company_name AS cn,
 24036       keyword AS k,
 24037       movie_companies AS mc,
 24038       movie_keyword AS mk,
 24039       title AS t
 24040  WHERE cn.country_code ='[de]'
 24041    AND k.keyword ='character-name-in-title'
 24042    AND cn.id = mc.company_id
 24043    AND mc.movie_id = t.id
 24044    AND t.id = mk.movie_id
 24045    AND mk.keyword_id = k.id
 24046    AND mc.movie_id = mk.movie_id;
 24047  
 24048  `,
 24049  		ExpectedPlan: "Project\n" +
 24050  			" ├─ columns: [min(t.title):0!null as movie_title]\n" +
 24051  			" └─ GroupBy\n" +
 24052  			"     ├─ select: MIN(t.title:1!null)\n" +
 24053  			"     ├─ group: \n" +
 24054  			"     └─ InnerJoin\n" +
 24055  			"         ├─ AND\n" +
 24056  			"         │   ├─ AND\n" +
 24057  			"         │   │   ├─ Eq\n" +
 24058  			"         │   │   │   ├─ cn.id:8!null\n" +
 24059  			"         │   │   │   └─ mc.company_id:3!null\n" +
 24060  			"         │   │   └─ Eq\n" +
 24061  			"         │   │       ├─ mc.movie_id:2!null\n" +
 24062  			"         │   │       └─ mk.movie_id:4!null\n" +
 24063  			"         │   └─ Eq\n" +
 24064  			"         │       ├─ t.id:0!null\n" +
 24065  			"         │       └─ mk.movie_id:4!null\n" +
 24066  			"         ├─ InnerJoin\n" +
 24067  			"         │   ├─ Eq\n" +
 24068  			"         │   │   ├─ mc.movie_id:2!null\n" +
 24069  			"         │   │   └─ t.id:0!null\n" +
 24070  			"         │   ├─ TableAlias(t)\n" +
 24071  			"         │   │   └─ ProcessTable\n" +
 24072  			"         │   │       └─ Table\n" +
 24073  			"         │   │           ├─ name: title\n" +
 24074  			"         │   │           └─ columns: [id title]\n" +
 24075  			"         │   └─ TableAlias(mc)\n" +
 24076  			"         │       └─ ProcessTable\n" +
 24077  			"         │           └─ Table\n" +
 24078  			"         │               ├─ name: movie_companies\n" +
 24079  			"         │               └─ columns: [movie_id company_id]\n" +
 24080  			"         └─ CrossJoin\n" +
 24081  			"             ├─ InnerJoin\n" +
 24082  			"             │   ├─ Eq\n" +
 24083  			"             │   │   ├─ mk.keyword_id:5!null\n" +
 24084  			"             │   │   └─ k.id:6!null\n" +
 24085  			"             │   ├─ TableAlias(mk)\n" +
 24086  			"             │   │   └─ ProcessTable\n" +
 24087  			"             │   │       └─ Table\n" +
 24088  			"             │   │           ├─ name: movie_keyword\n" +
 24089  			"             │   │           └─ columns: [movie_id keyword_id]\n" +
 24090  			"             │   └─ Filter\n" +
 24091  			"             │       ├─ Eq\n" +
 24092  			"             │       │   ├─ k.keyword:1!null\n" +
 24093  			"             │       │   └─ character-name-in-title (longtext)\n" +
 24094  			"             │       └─ TableAlias(k)\n" +
 24095  			"             │           └─ ProcessTable\n" +
 24096  			"             │               └─ Table\n" +
 24097  			"             │                   ├─ name: keyword\n" +
 24098  			"             │                   └─ columns: [id keyword]\n" +
 24099  			"             └─ Filter\n" +
 24100  			"                 ├─ Eq\n" +
 24101  			"                 │   ├─ cn.country_code:1\n" +
 24102  			"                 │   └─ [de] (longtext)\n" +
 24103  			"                 └─ TableAlias(cn)\n" +
 24104  			"                     └─ ProcessTable\n" +
 24105  			"                         └─ Table\n" +
 24106  			"                             ├─ name: company_name\n" +
 24107  			"                             └─ columns: [id country_code]\n" +
 24108  			"",
 24109  		ExpectedEstimates: "Project\n" +
 24110  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24111  			" └─ GroupBy\n" +
 24112  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24113  			"     ├─ Grouping()\n" +
 24114  			"     └─ InnerJoin\n" +
 24115  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24116  			"         ├─ InnerJoin\n" +
 24117  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24118  			"         │   ├─ TableAlias(t)\n" +
 24119  			"         │   │   └─ Table\n" +
 24120  			"         │   │       ├─ name: title\n" +
 24121  			"         │   │       └─ columns: [id title]\n" +
 24122  			"         │   └─ TableAlias(mc)\n" +
 24123  			"         │       └─ Table\n" +
 24124  			"         │           ├─ name: movie_companies\n" +
 24125  			"         │           └─ columns: [movie_id company_id]\n" +
 24126  			"         └─ CrossJoin\n" +
 24127  			"             ├─ InnerJoin\n" +
 24128  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24129  			"             │   ├─ TableAlias(mk)\n" +
 24130  			"             │   │   └─ Table\n" +
 24131  			"             │   │       ├─ name: movie_keyword\n" +
 24132  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24133  			"             │   └─ Filter\n" +
 24134  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24135  			"             │       └─ TableAlias(k)\n" +
 24136  			"             │           └─ Table\n" +
 24137  			"             │               ├─ name: keyword\n" +
 24138  			"             │               └─ columns: [id keyword]\n" +
 24139  			"             └─ Filter\n" +
 24140  			"                 ├─ (cn.country_code = '[de]')\n" +
 24141  			"                 └─ TableAlias(cn)\n" +
 24142  			"                     └─ Table\n" +
 24143  			"                         ├─ name: company_name\n" +
 24144  			"                         └─ columns: [id country_code]\n" +
 24145  			"",
 24146  		ExpectedAnalysis: "Project\n" +
 24147  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24148  			" └─ GroupBy\n" +
 24149  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24150  			"     ├─ Grouping()\n" +
 24151  			"     └─ InnerJoin\n" +
 24152  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24153  			"         ├─ InnerJoin\n" +
 24154  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24155  			"         │   ├─ TableAlias(t)\n" +
 24156  			"         │   │   └─ Table\n" +
 24157  			"         │   │       ├─ name: title\n" +
 24158  			"         │   │       └─ columns: [id title]\n" +
 24159  			"         │   └─ TableAlias(mc)\n" +
 24160  			"         │       └─ Table\n" +
 24161  			"         │           ├─ name: movie_companies\n" +
 24162  			"         │           └─ columns: [movie_id company_id]\n" +
 24163  			"         └─ CrossJoin\n" +
 24164  			"             ├─ InnerJoin\n" +
 24165  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24166  			"             │   ├─ TableAlias(mk)\n" +
 24167  			"             │   │   └─ Table\n" +
 24168  			"             │   │       ├─ name: movie_keyword\n" +
 24169  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24170  			"             │   └─ Filter\n" +
 24171  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24172  			"             │       └─ TableAlias(k)\n" +
 24173  			"             │           └─ Table\n" +
 24174  			"             │               ├─ name: keyword\n" +
 24175  			"             │               └─ columns: [id keyword]\n" +
 24176  			"             └─ Filter\n" +
 24177  			"                 ├─ (cn.country_code = '[de]')\n" +
 24178  			"                 └─ TableAlias(cn)\n" +
 24179  			"                     └─ Table\n" +
 24180  			"                         ├─ name: company_name\n" +
 24181  			"                         └─ columns: [id country_code]\n" +
 24182  			"",
 24183  	},
 24184  	{
 24185  		Query: `
 24186  SELECT MIN(t.title) AS movie_title
 24187  FROM company_name AS cn,
 24188       keyword AS k,
 24189       movie_companies AS mc,
 24190       movie_keyword AS mk,
 24191       title AS t
 24192  WHERE cn.country_code ='[nl]'
 24193    AND k.keyword ='character-name-in-title'
 24194    AND cn.id = mc.company_id
 24195    AND mc.movie_id = t.id
 24196    AND t.id = mk.movie_id
 24197    AND mk.keyword_id = k.id
 24198    AND mc.movie_id = mk.movie_id;
 24199  
 24200  `,
 24201  		ExpectedPlan: "Project\n" +
 24202  			" ├─ columns: [min(t.title):0!null as movie_title]\n" +
 24203  			" └─ GroupBy\n" +
 24204  			"     ├─ select: MIN(t.title:1!null)\n" +
 24205  			"     ├─ group: \n" +
 24206  			"     └─ InnerJoin\n" +
 24207  			"         ├─ AND\n" +
 24208  			"         │   ├─ AND\n" +
 24209  			"         │   │   ├─ Eq\n" +
 24210  			"         │   │   │   ├─ cn.id:8!null\n" +
 24211  			"         │   │   │   └─ mc.company_id:3!null\n" +
 24212  			"         │   │   └─ Eq\n" +
 24213  			"         │   │       ├─ mc.movie_id:2!null\n" +
 24214  			"         │   │       └─ mk.movie_id:4!null\n" +
 24215  			"         │   └─ Eq\n" +
 24216  			"         │       ├─ t.id:0!null\n" +
 24217  			"         │       └─ mk.movie_id:4!null\n" +
 24218  			"         ├─ InnerJoin\n" +
 24219  			"         │   ├─ Eq\n" +
 24220  			"         │   │   ├─ mc.movie_id:2!null\n" +
 24221  			"         │   │   └─ t.id:0!null\n" +
 24222  			"         │   ├─ TableAlias(t)\n" +
 24223  			"         │   │   └─ ProcessTable\n" +
 24224  			"         │   │       └─ Table\n" +
 24225  			"         │   │           ├─ name: title\n" +
 24226  			"         │   │           └─ columns: [id title]\n" +
 24227  			"         │   └─ TableAlias(mc)\n" +
 24228  			"         │       └─ ProcessTable\n" +
 24229  			"         │           └─ Table\n" +
 24230  			"         │               ├─ name: movie_companies\n" +
 24231  			"         │               └─ columns: [movie_id company_id]\n" +
 24232  			"         └─ CrossJoin\n" +
 24233  			"             ├─ InnerJoin\n" +
 24234  			"             │   ├─ Eq\n" +
 24235  			"             │   │   ├─ mk.keyword_id:5!null\n" +
 24236  			"             │   │   └─ k.id:6!null\n" +
 24237  			"             │   ├─ TableAlias(mk)\n" +
 24238  			"             │   │   └─ ProcessTable\n" +
 24239  			"             │   │       └─ Table\n" +
 24240  			"             │   │           ├─ name: movie_keyword\n" +
 24241  			"             │   │           └─ columns: [movie_id keyword_id]\n" +
 24242  			"             │   └─ Filter\n" +
 24243  			"             │       ├─ Eq\n" +
 24244  			"             │       │   ├─ k.keyword:1!null\n" +
 24245  			"             │       │   └─ character-name-in-title (longtext)\n" +
 24246  			"             │       └─ TableAlias(k)\n" +
 24247  			"             │           └─ ProcessTable\n" +
 24248  			"             │               └─ Table\n" +
 24249  			"             │                   ├─ name: keyword\n" +
 24250  			"             │                   └─ columns: [id keyword]\n" +
 24251  			"             └─ Filter\n" +
 24252  			"                 ├─ Eq\n" +
 24253  			"                 │   ├─ cn.country_code:1\n" +
 24254  			"                 │   └─ [nl] (longtext)\n" +
 24255  			"                 └─ TableAlias(cn)\n" +
 24256  			"                     └─ ProcessTable\n" +
 24257  			"                         └─ Table\n" +
 24258  			"                             ├─ name: company_name\n" +
 24259  			"                             └─ columns: [id country_code]\n" +
 24260  			"",
 24261  		ExpectedEstimates: "Project\n" +
 24262  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24263  			" └─ GroupBy\n" +
 24264  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24265  			"     ├─ Grouping()\n" +
 24266  			"     └─ InnerJoin\n" +
 24267  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24268  			"         ├─ InnerJoin\n" +
 24269  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24270  			"         │   ├─ TableAlias(t)\n" +
 24271  			"         │   │   └─ Table\n" +
 24272  			"         │   │       ├─ name: title\n" +
 24273  			"         │   │       └─ columns: [id title]\n" +
 24274  			"         │   └─ TableAlias(mc)\n" +
 24275  			"         │       └─ Table\n" +
 24276  			"         │           ├─ name: movie_companies\n" +
 24277  			"         │           └─ columns: [movie_id company_id]\n" +
 24278  			"         └─ CrossJoin\n" +
 24279  			"             ├─ InnerJoin\n" +
 24280  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24281  			"             │   ├─ TableAlias(mk)\n" +
 24282  			"             │   │   └─ Table\n" +
 24283  			"             │   │       ├─ name: movie_keyword\n" +
 24284  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24285  			"             │   └─ Filter\n" +
 24286  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24287  			"             │       └─ TableAlias(k)\n" +
 24288  			"             │           └─ Table\n" +
 24289  			"             │               ├─ name: keyword\n" +
 24290  			"             │               └─ columns: [id keyword]\n" +
 24291  			"             └─ Filter\n" +
 24292  			"                 ├─ (cn.country_code = '[nl]')\n" +
 24293  			"                 └─ TableAlias(cn)\n" +
 24294  			"                     └─ Table\n" +
 24295  			"                         ├─ name: company_name\n" +
 24296  			"                         └─ columns: [id country_code]\n" +
 24297  			"",
 24298  		ExpectedAnalysis: "Project\n" +
 24299  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24300  			" └─ GroupBy\n" +
 24301  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24302  			"     ├─ Grouping()\n" +
 24303  			"     └─ InnerJoin\n" +
 24304  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24305  			"         ├─ InnerJoin\n" +
 24306  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24307  			"         │   ├─ TableAlias(t)\n" +
 24308  			"         │   │   └─ Table\n" +
 24309  			"         │   │       ├─ name: title\n" +
 24310  			"         │   │       └─ columns: [id title]\n" +
 24311  			"         │   └─ TableAlias(mc)\n" +
 24312  			"         │       └─ Table\n" +
 24313  			"         │           ├─ name: movie_companies\n" +
 24314  			"         │           └─ columns: [movie_id company_id]\n" +
 24315  			"         └─ CrossJoin\n" +
 24316  			"             ├─ InnerJoin\n" +
 24317  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24318  			"             │   ├─ TableAlias(mk)\n" +
 24319  			"             │   │   └─ Table\n" +
 24320  			"             │   │       ├─ name: movie_keyword\n" +
 24321  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24322  			"             │   └─ Filter\n" +
 24323  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24324  			"             │       └─ TableAlias(k)\n" +
 24325  			"             │           └─ Table\n" +
 24326  			"             │               ├─ name: keyword\n" +
 24327  			"             │               └─ columns: [id keyword]\n" +
 24328  			"             └─ Filter\n" +
 24329  			"                 ├─ (cn.country_code = '[nl]')\n" +
 24330  			"                 └─ TableAlias(cn)\n" +
 24331  			"                     └─ Table\n" +
 24332  			"                         ├─ name: company_name\n" +
 24333  			"                         └─ columns: [id country_code]\n" +
 24334  			"",
 24335  	},
 24336  	{
 24337  		Query: `
 24338  SELECT MIN(t.title) AS movie_title
 24339  FROM company_name AS cn,
 24340       keyword AS k,
 24341       movie_companies AS mc,
 24342       movie_keyword AS mk,
 24343       title AS t
 24344  WHERE cn.country_code ='[sm]'
 24345    AND k.keyword ='character-name-in-title'
 24346    AND cn.id = mc.company_id
 24347    AND mc.movie_id = t.id
 24348    AND t.id = mk.movie_id
 24349    AND mk.keyword_id = k.id
 24350    AND mc.movie_id = mk.movie_id;
 24351  
 24352  `,
 24353  		ExpectedPlan: "Project\n" +
 24354  			" ├─ columns: [min(t.title):0!null as movie_title]\n" +
 24355  			" └─ GroupBy\n" +
 24356  			"     ├─ select: MIN(t.title:1!null)\n" +
 24357  			"     ├─ group: \n" +
 24358  			"     └─ InnerJoin\n" +
 24359  			"         ├─ AND\n" +
 24360  			"         │   ├─ AND\n" +
 24361  			"         │   │   ├─ Eq\n" +
 24362  			"         │   │   │   ├─ cn.id:8!null\n" +
 24363  			"         │   │   │   └─ mc.company_id:3!null\n" +
 24364  			"         │   │   └─ Eq\n" +
 24365  			"         │   │       ├─ mc.movie_id:2!null\n" +
 24366  			"         │   │       └─ mk.movie_id:4!null\n" +
 24367  			"         │   └─ Eq\n" +
 24368  			"         │       ├─ t.id:0!null\n" +
 24369  			"         │       └─ mk.movie_id:4!null\n" +
 24370  			"         ├─ InnerJoin\n" +
 24371  			"         │   ├─ Eq\n" +
 24372  			"         │   │   ├─ mc.movie_id:2!null\n" +
 24373  			"         │   │   └─ t.id:0!null\n" +
 24374  			"         │   ├─ TableAlias(t)\n" +
 24375  			"         │   │   └─ ProcessTable\n" +
 24376  			"         │   │       └─ Table\n" +
 24377  			"         │   │           ├─ name: title\n" +
 24378  			"         │   │           └─ columns: [id title]\n" +
 24379  			"         │   └─ TableAlias(mc)\n" +
 24380  			"         │       └─ ProcessTable\n" +
 24381  			"         │           └─ Table\n" +
 24382  			"         │               ├─ name: movie_companies\n" +
 24383  			"         │               └─ columns: [movie_id company_id]\n" +
 24384  			"         └─ CrossJoin\n" +
 24385  			"             ├─ InnerJoin\n" +
 24386  			"             │   ├─ Eq\n" +
 24387  			"             │   │   ├─ mk.keyword_id:5!null\n" +
 24388  			"             │   │   └─ k.id:6!null\n" +
 24389  			"             │   ├─ TableAlias(mk)\n" +
 24390  			"             │   │   └─ ProcessTable\n" +
 24391  			"             │   │       └─ Table\n" +
 24392  			"             │   │           ├─ name: movie_keyword\n" +
 24393  			"             │   │           └─ columns: [movie_id keyword_id]\n" +
 24394  			"             │   └─ Filter\n" +
 24395  			"             │       ├─ Eq\n" +
 24396  			"             │       │   ├─ k.keyword:1!null\n" +
 24397  			"             │       │   └─ character-name-in-title (longtext)\n" +
 24398  			"             │       └─ TableAlias(k)\n" +
 24399  			"             │           └─ ProcessTable\n" +
 24400  			"             │               └─ Table\n" +
 24401  			"             │                   ├─ name: keyword\n" +
 24402  			"             │                   └─ columns: [id keyword]\n" +
 24403  			"             └─ Filter\n" +
 24404  			"                 ├─ Eq\n" +
 24405  			"                 │   ├─ cn.country_code:1\n" +
 24406  			"                 │   └─ [sm] (longtext)\n" +
 24407  			"                 └─ TableAlias(cn)\n" +
 24408  			"                     └─ ProcessTable\n" +
 24409  			"                         └─ Table\n" +
 24410  			"                             ├─ name: company_name\n" +
 24411  			"                             └─ columns: [id country_code]\n" +
 24412  			"",
 24413  		ExpectedEstimates: "Project\n" +
 24414  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24415  			" └─ GroupBy\n" +
 24416  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24417  			"     ├─ Grouping()\n" +
 24418  			"     └─ InnerJoin\n" +
 24419  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24420  			"         ├─ InnerJoin\n" +
 24421  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24422  			"         │   ├─ TableAlias(t)\n" +
 24423  			"         │   │   └─ Table\n" +
 24424  			"         │   │       ├─ name: title\n" +
 24425  			"         │   │       └─ columns: [id title]\n" +
 24426  			"         │   └─ TableAlias(mc)\n" +
 24427  			"         │       └─ Table\n" +
 24428  			"         │           ├─ name: movie_companies\n" +
 24429  			"         │           └─ columns: [movie_id company_id]\n" +
 24430  			"         └─ CrossJoin\n" +
 24431  			"             ├─ InnerJoin\n" +
 24432  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24433  			"             │   ├─ TableAlias(mk)\n" +
 24434  			"             │   │   └─ Table\n" +
 24435  			"             │   │       ├─ name: movie_keyword\n" +
 24436  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24437  			"             │   └─ Filter\n" +
 24438  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24439  			"             │       └─ TableAlias(k)\n" +
 24440  			"             │           └─ Table\n" +
 24441  			"             │               ├─ name: keyword\n" +
 24442  			"             │               └─ columns: [id keyword]\n" +
 24443  			"             └─ Filter\n" +
 24444  			"                 ├─ (cn.country_code = '[sm]')\n" +
 24445  			"                 └─ TableAlias(cn)\n" +
 24446  			"                     └─ Table\n" +
 24447  			"                         ├─ name: company_name\n" +
 24448  			"                         └─ columns: [id country_code]\n" +
 24449  			"",
 24450  		ExpectedAnalysis: "Project\n" +
 24451  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24452  			" └─ GroupBy\n" +
 24453  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24454  			"     ├─ Grouping()\n" +
 24455  			"     └─ InnerJoin\n" +
 24456  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24457  			"         ├─ InnerJoin\n" +
 24458  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24459  			"         │   ├─ TableAlias(t)\n" +
 24460  			"         │   │   └─ Table\n" +
 24461  			"         │   │       ├─ name: title\n" +
 24462  			"         │   │       └─ columns: [id title]\n" +
 24463  			"         │   └─ TableAlias(mc)\n" +
 24464  			"         │       └─ Table\n" +
 24465  			"         │           ├─ name: movie_companies\n" +
 24466  			"         │           └─ columns: [movie_id company_id]\n" +
 24467  			"         └─ CrossJoin\n" +
 24468  			"             ├─ InnerJoin\n" +
 24469  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24470  			"             │   ├─ TableAlias(mk)\n" +
 24471  			"             │   │   └─ Table\n" +
 24472  			"             │   │       ├─ name: movie_keyword\n" +
 24473  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24474  			"             │   └─ Filter\n" +
 24475  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24476  			"             │       └─ TableAlias(k)\n" +
 24477  			"             │           └─ Table\n" +
 24478  			"             │               ├─ name: keyword\n" +
 24479  			"             │               └─ columns: [id keyword]\n" +
 24480  			"             └─ Filter\n" +
 24481  			"                 ├─ (cn.country_code = '[sm]')\n" +
 24482  			"                 └─ TableAlias(cn)\n" +
 24483  			"                     └─ Table\n" +
 24484  			"                         ├─ name: company_name\n" +
 24485  			"                         └─ columns: [id country_code]\n" +
 24486  			"",
 24487  	},
 24488  	{
 24489  		Query: `
 24490  SELECT MIN(t.title) AS movie_title
 24491  FROM company_name AS cn,
 24492       keyword AS k,
 24493       movie_companies AS mc,
 24494       movie_keyword AS mk,
 24495       title AS t
 24496  WHERE cn.country_code ='[us]'
 24497    AND k.keyword ='character-name-in-title'
 24498    AND cn.id = mc.company_id
 24499    AND mc.movie_id = t.id
 24500    AND t.id = mk.movie_id
 24501    AND mk.keyword_id = k.id
 24502    AND mc.movie_id = mk.movie_id;
 24503  
 24504  `,
 24505  		ExpectedPlan: "Project\n" +
 24506  			" ├─ columns: [min(t.title):0!null as movie_title]\n" +
 24507  			" └─ GroupBy\n" +
 24508  			"     ├─ select: MIN(t.title:1!null)\n" +
 24509  			"     ├─ group: \n" +
 24510  			"     └─ InnerJoin\n" +
 24511  			"         ├─ AND\n" +
 24512  			"         │   ├─ AND\n" +
 24513  			"         │   │   ├─ Eq\n" +
 24514  			"         │   │   │   ├─ cn.id:8!null\n" +
 24515  			"         │   │   │   └─ mc.company_id:3!null\n" +
 24516  			"         │   │   └─ Eq\n" +
 24517  			"         │   │       ├─ mc.movie_id:2!null\n" +
 24518  			"         │   │       └─ mk.movie_id:4!null\n" +
 24519  			"         │   └─ Eq\n" +
 24520  			"         │       ├─ t.id:0!null\n" +
 24521  			"         │       └─ mk.movie_id:4!null\n" +
 24522  			"         ├─ InnerJoin\n" +
 24523  			"         │   ├─ Eq\n" +
 24524  			"         │   │   ├─ mc.movie_id:2!null\n" +
 24525  			"         │   │   └─ t.id:0!null\n" +
 24526  			"         │   ├─ TableAlias(t)\n" +
 24527  			"         │   │   └─ ProcessTable\n" +
 24528  			"         │   │       └─ Table\n" +
 24529  			"         │   │           ├─ name: title\n" +
 24530  			"         │   │           └─ columns: [id title]\n" +
 24531  			"         │   └─ TableAlias(mc)\n" +
 24532  			"         │       └─ ProcessTable\n" +
 24533  			"         │           └─ Table\n" +
 24534  			"         │               ├─ name: movie_companies\n" +
 24535  			"         │               └─ columns: [movie_id company_id]\n" +
 24536  			"         └─ CrossJoin\n" +
 24537  			"             ├─ InnerJoin\n" +
 24538  			"             │   ├─ Eq\n" +
 24539  			"             │   │   ├─ mk.keyword_id:5!null\n" +
 24540  			"             │   │   └─ k.id:6!null\n" +
 24541  			"             │   ├─ TableAlias(mk)\n" +
 24542  			"             │   │   └─ ProcessTable\n" +
 24543  			"             │   │       └─ Table\n" +
 24544  			"             │   │           ├─ name: movie_keyword\n" +
 24545  			"             │   │           └─ columns: [movie_id keyword_id]\n" +
 24546  			"             │   └─ Filter\n" +
 24547  			"             │       ├─ Eq\n" +
 24548  			"             │       │   ├─ k.keyword:1!null\n" +
 24549  			"             │       │   └─ character-name-in-title (longtext)\n" +
 24550  			"             │       └─ TableAlias(k)\n" +
 24551  			"             │           └─ ProcessTable\n" +
 24552  			"             │               └─ Table\n" +
 24553  			"             │                   ├─ name: keyword\n" +
 24554  			"             │                   └─ columns: [id keyword]\n" +
 24555  			"             └─ Filter\n" +
 24556  			"                 ├─ Eq\n" +
 24557  			"                 │   ├─ cn.country_code:1\n" +
 24558  			"                 │   └─ [us] (longtext)\n" +
 24559  			"                 └─ TableAlias(cn)\n" +
 24560  			"                     └─ ProcessTable\n" +
 24561  			"                         └─ Table\n" +
 24562  			"                             ├─ name: company_name\n" +
 24563  			"                             └─ columns: [id country_code]\n" +
 24564  			"",
 24565  		ExpectedEstimates: "Project\n" +
 24566  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24567  			" └─ GroupBy\n" +
 24568  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24569  			"     ├─ Grouping()\n" +
 24570  			"     └─ InnerJoin\n" +
 24571  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24572  			"         ├─ InnerJoin\n" +
 24573  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24574  			"         │   ├─ TableAlias(t)\n" +
 24575  			"         │   │   └─ Table\n" +
 24576  			"         │   │       ├─ name: title\n" +
 24577  			"         │   │       └─ columns: [id title]\n" +
 24578  			"         │   └─ TableAlias(mc)\n" +
 24579  			"         │       └─ Table\n" +
 24580  			"         │           ├─ name: movie_companies\n" +
 24581  			"         │           └─ columns: [movie_id company_id]\n" +
 24582  			"         └─ CrossJoin\n" +
 24583  			"             ├─ InnerJoin\n" +
 24584  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24585  			"             │   ├─ TableAlias(mk)\n" +
 24586  			"             │   │   └─ Table\n" +
 24587  			"             │   │       ├─ name: movie_keyword\n" +
 24588  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24589  			"             │   └─ Filter\n" +
 24590  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24591  			"             │       └─ TableAlias(k)\n" +
 24592  			"             │           └─ Table\n" +
 24593  			"             │               ├─ name: keyword\n" +
 24594  			"             │               └─ columns: [id keyword]\n" +
 24595  			"             └─ Filter\n" +
 24596  			"                 ├─ (cn.country_code = '[us]')\n" +
 24597  			"                 └─ TableAlias(cn)\n" +
 24598  			"                     └─ Table\n" +
 24599  			"                         ├─ name: company_name\n" +
 24600  			"                         └─ columns: [id country_code]\n" +
 24601  			"",
 24602  		ExpectedAnalysis: "Project\n" +
 24603  			" ├─ columns: [min(t.title) as movie_title]\n" +
 24604  			" └─ GroupBy\n" +
 24605  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 24606  			"     ├─ Grouping()\n" +
 24607  			"     └─ InnerJoin\n" +
 24608  			"         ├─ (((cn.id = mc.company_id) AND (mc.movie_id = mk.movie_id)) AND (t.id = mk.movie_id))\n" +
 24609  			"         ├─ InnerJoin\n" +
 24610  			"         │   ├─ (mc.movie_id = t.id)\n" +
 24611  			"         │   ├─ TableAlias(t)\n" +
 24612  			"         │   │   └─ Table\n" +
 24613  			"         │   │       ├─ name: title\n" +
 24614  			"         │   │       └─ columns: [id title]\n" +
 24615  			"         │   └─ TableAlias(mc)\n" +
 24616  			"         │       └─ Table\n" +
 24617  			"         │           ├─ name: movie_companies\n" +
 24618  			"         │           └─ columns: [movie_id company_id]\n" +
 24619  			"         └─ CrossJoin\n" +
 24620  			"             ├─ InnerJoin\n" +
 24621  			"             │   ├─ (mk.keyword_id = k.id)\n" +
 24622  			"             │   ├─ TableAlias(mk)\n" +
 24623  			"             │   │   └─ Table\n" +
 24624  			"             │   │       ├─ name: movie_keyword\n" +
 24625  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 24626  			"             │   └─ Filter\n" +
 24627  			"             │       ├─ (k.keyword = 'character-name-in-title')\n" +
 24628  			"             │       └─ TableAlias(k)\n" +
 24629  			"             │           └─ Table\n" +
 24630  			"             │               ├─ name: keyword\n" +
 24631  			"             │               └─ columns: [id keyword]\n" +
 24632  			"             └─ Filter\n" +
 24633  			"                 ├─ (cn.country_code = '[us]')\n" +
 24634  			"                 └─ TableAlias(cn)\n" +
 24635  			"                     └─ Table\n" +
 24636  			"                         ├─ name: company_name\n" +
 24637  			"                         └─ columns: [id country_code]\n" +
 24638  			"",
 24639  	},
 24640  	{
 24641  		Query: `
 24642  SELECT MIN(mi.info) AS movie_budget,
 24643         MIN(mi_idx.info) AS movie_votes,
 24644         MIN(n.name) AS writer,
 24645         MIN(t.title) AS complete_violent_movie
 24646  FROM complete_cast AS cc,
 24647       comp_cast_type AS cct1,
 24648       comp_cast_type AS cct2,
 24649       cast_info AS ci,
 24650       info_type AS it1,
 24651       info_type AS it2,
 24652       keyword AS k,
 24653       movie_info AS mi,
 24654       movie_info_idx AS mi_idx,
 24655       movie_keyword AS mk,
 24656       name AS n,
 24657       title AS t
 24658  WHERE cct1.kind IN ('cast',
 24659                      'crew')
 24660    AND cct2.kind ='complete+verified'
 24661    AND ci.note IN ('(writer)',
 24662                    '(head writer)',
 24663                    '(written by)',
 24664                    '(story)',
 24665                    '(story editor)')
 24666    AND it1.info = 'genres'
 24667    AND it2.info = 'votes'
 24668    AND k.keyword IN ('murder',
 24669                      'violence',
 24670                      'blood',
 24671                      'gore',
 24672                      'death',
 24673                      'female-nudity',
 24674                      'hospital')
 24675    AND mi.info IN ('Horror',
 24676                    'Thriller')
 24677    AND n.gender = 'm'
 24678    AND t.production_year > 2000
 24679    AND t.id = mi.movie_id
 24680    AND t.id = mi_idx.movie_id
 24681    AND t.id = ci.movie_id
 24682    AND t.id = mk.movie_id
 24683    AND t.id = cc.movie_id
 24684    AND ci.movie_id = mi.movie_id
 24685    AND ci.movie_id = mi_idx.movie_id
 24686    AND ci.movie_id = mk.movie_id
 24687    AND ci.movie_id = cc.movie_id
 24688    AND mi.movie_id = mi_idx.movie_id
 24689    AND mi.movie_id = mk.movie_id
 24690    AND mi.movie_id = cc.movie_id
 24691    AND mi_idx.movie_id = mk.movie_id
 24692    AND mi_idx.movie_id = cc.movie_id
 24693    AND mk.movie_id = cc.movie_id
 24694    AND n.id = ci.person_id
 24695    AND it1.id = mi.info_type_id
 24696    AND it2.id = mi_idx.info_type_id
 24697    AND k.id = mk.keyword_id
 24698    AND cct1.id = cc.subject_id
 24699    AND cct2.id = cc.status_id;
 24700  
 24701  `,
 24702  		ExpectedPlan: "Project\n" +
 24703  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as writer, min(t.title):3!null as complete_violent_movie]\n" +
 24704  			" └─ GroupBy\n" +
 24705  			"     ├─ select: MIN(mi.info:9!null), MIN(mi_idx.info:27!null), MIN(n.name:16!null), MIN(t.title:13!null)\n" +
 24706  			"     ├─ group: \n" +
 24707  			"     └─ HashJoin\n" +
 24708  			"         ├─ Eq\n" +
 24709  			"         │   ├─ cct1.id:0!null\n" +
 24710  			"         │   └─ cc.subject_id:5!null\n" +
 24711  			"         ├─ Filter\n" +
 24712  			"         │   ├─ HashIn\n" +
 24713  			"         │   │   ├─ cct1.kind:1!null\n" +
 24714  			"         │   │   └─ TUPLE(cast (longtext), crew (longtext))\n" +
 24715  			"         │   └─ TableAlias(cct1)\n" +
 24716  			"         │       └─ ProcessTable\n" +
 24717  			"         │           └─ Table\n" +
 24718  			"         │               ├─ name: comp_cast_type\n" +
 24719  			"         │               └─ columns: [id kind]\n" +
 24720  			"         └─ HashLookup\n" +
 24721  			"             ├─ left-key: TUPLE(cct1.id:0!null)\n" +
 24722  			"             ├─ right-key: TUPLE(cc.subject_id:3!null)\n" +
 24723  			"             └─ HashJoin\n" +
 24724  			"                 ├─ Eq\n" +
 24725  			"                 │   ├─ cct2.id:2!null\n" +
 24726  			"                 │   └─ cc.status_id:6!null\n" +
 24727  			"                 ├─ Filter\n" +
 24728  			"                 │   ├─ Eq\n" +
 24729  			"                 │   │   ├─ cct2.kind:1!null\n" +
 24730  			"                 │   │   └─ complete+verified (longtext)\n" +
 24731  			"                 │   └─ TableAlias(cct2)\n" +
 24732  			"                 │       └─ Table\n" +
 24733  			"                 │           ├─ name: comp_cast_type\n" +
 24734  			"                 │           ├─ columns: [id kind]\n" +
 24735  			"                 │           ├─ colSet: (7,8)\n" +
 24736  			"                 │           └─ tableId: 3\n" +
 24737  			"                 └─ HashLookup\n" +
 24738  			"                     ├─ left-key: TUPLE(cct2.id:2!null)\n" +
 24739  			"                     ├─ right-key: TUPLE(cc.status_id:2!null)\n" +
 24740  			"                     └─ HashJoin\n" +
 24741  			"                         ├─ Eq\n" +
 24742  			"                         │   ├─ ci.movie_id:19!null\n" +
 24743  			"                         │   └─ cc.movie_id:4\n" +
 24744  			"                         ├─ TableAlias(cc)\n" +
 24745  			"                         │   └─ ProcessTable\n" +
 24746  			"                         │       └─ Table\n" +
 24747  			"                         │           ├─ name: complete_cast\n" +
 24748  			"                         │           └─ columns: [movie_id subject_id status_id]\n" +
 24749  			"                         └─ HashLookup\n" +
 24750  			"                             ├─ left-key: TUPLE(cc.movie_id:4)\n" +
 24751  			"                             ├─ right-key: TUPLE(ci.movie_id:12!null)\n" +
 24752  			"                             └─ HashJoin\n" +
 24753  			"                                 ├─ Eq\n" +
 24754  			"                                 │   ├─ mi.movie_id:7!null\n" +
 24755  			"                                 │   └─ mi_idx.movie_id:25!null\n" +
 24756  			"                                 ├─ InnerJoin\n" +
 24757  			"                                 │   ├─ Eq\n" +
 24758  			"                                 │   │   ├─ it1.id:10!null\n" +
 24759  			"                                 │   │   └─ mi.info_type_id:8!null\n" +
 24760  			"                                 │   ├─ Filter\n" +
 24761  			"                                 │   │   ├─ HashIn\n" +
 24762  			"                                 │   │   │   ├─ mi.info:2!null\n" +
 24763  			"                                 │   │   │   └─ TUPLE(Horror (longtext), Thriller (longtext))\n" +
 24764  			"                                 │   │   └─ TableAlias(mi)\n" +
 24765  			"                                 │   │       └─ ProcessTable\n" +
 24766  			"                                 │   │           └─ Table\n" +
 24767  			"                                 │   │               ├─ name: movie_info\n" +
 24768  			"                                 │   │               └─ columns: [movie_id info_type_id info]\n" +
 24769  			"                                 │   └─ Filter\n" +
 24770  			"                                 │       ├─ Eq\n" +
 24771  			"                                 │       │   ├─ it1.info:1!null\n" +
 24772  			"                                 │       │   └─ genres (longtext)\n" +
 24773  			"                                 │       └─ TableAlias(it1)\n" +
 24774  			"                                 │           └─ ProcessTable\n" +
 24775  			"                                 │               └─ Table\n" +
 24776  			"                                 │                   ├─ name: info_type\n" +
 24777  			"                                 │                   └─ columns: [id info]\n" +
 24778  			"                                 └─ HashLookup\n" +
 24779  			"                                     ├─ left-key: TUPLE(mi.movie_id:7!null)\n" +
 24780  			"                                     ├─ right-key: TUPLE(mi_idx.movie_id:13!null)\n" +
 24781  			"                                     └─ HashJoin\n" +
 24782  			"                                         ├─ Eq\n" +
 24783  			"                                         │   ├─ mi_idx.movie_id:25!null\n" +
 24784  			"                                         │   └─ mk.movie_id:21!null\n" +
 24785  			"                                         ├─ InnerJoin\n" +
 24786  			"                                         │   ├─ Eq\n" +
 24787  			"                                         │   │   ├─ t.id:12!null\n" +
 24788  			"                                         │   │   └─ mk.movie_id:21!null\n" +
 24789  			"                                         │   ├─ InnerJoin\n" +
 24790  			"                                         │   │   ├─ Eq\n" +
 24791  			"                                         │   │   │   ├─ t.id:12!null\n" +
 24792  			"                                         │   │   │   └─ ci.movie_id:19!null\n" +
 24793  			"                                         │   │   ├─ Filter\n" +
 24794  			"                                         │   │   │   ├─ GreaterThan\n" +
 24795  			"                                         │   │   │   │   ├─ t.production_year:2\n" +
 24796  			"                                         │   │   │   │   └─ 2000 (smallint)\n" +
 24797  			"                                         │   │   │   └─ TableAlias(t)\n" +
 24798  			"                                         │   │   │       └─ ProcessTable\n" +
 24799  			"                                         │   │   │           └─ Table\n" +
 24800  			"                                         │   │   │               ├─ name: title\n" +
 24801  			"                                         │   │   │               └─ columns: [id title production_year]\n" +
 24802  			"                                         │   │   └─ InnerJoin\n" +
 24803  			"                                         │   │       ├─ Eq\n" +
 24804  			"                                         │   │       │   ├─ n.id:15!null\n" +
 24805  			"                                         │   │       │   └─ ci.person_id:18!null\n" +
 24806  			"                                         │   │       ├─ Filter\n" +
 24807  			"                                         │   │       │   ├─ Eq\n" +
 24808  			"                                         │   │       │   │   ├─ n.gender:2\n" +
 24809  			"                                         │   │       │   │   └─ m (longtext)\n" +
 24810  			"                                         │   │       │   └─ TableAlias(n)\n" +
 24811  			"                                         │   │       │       └─ ProcessTable\n" +
 24812  			"                                         │   │       │           └─ Table\n" +
 24813  			"                                         │   │       │               ├─ name: name\n" +
 24814  			"                                         │   │       │               └─ columns: [id name gender]\n" +
 24815  			"                                         │   │       └─ Filter\n" +
 24816  			"                                         │   │           ├─ HashIn\n" +
 24817  			"                                         │   │           │   ├─ ci.note:2\n" +
 24818  			"                                         │   │           │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 24819  			"                                         │   │           └─ TableAlias(ci)\n" +
 24820  			"                                         │   │               └─ ProcessTable\n" +
 24821  			"                                         │   │                   └─ Table\n" +
 24822  			"                                         │   │                       ├─ name: cast_info\n" +
 24823  			"                                         │   │                       └─ columns: [person_id movie_id note]\n" +
 24824  			"                                         │   └─ InnerJoin\n" +
 24825  			"                                         │       ├─ Eq\n" +
 24826  			"                                         │       │   ├─ k.id:23!null\n" +
 24827  			"                                         │       │   └─ mk.keyword_id:22!null\n" +
 24828  			"                                         │       ├─ TableAlias(mk)\n" +
 24829  			"                                         │       │   └─ ProcessTable\n" +
 24830  			"                                         │       │       └─ Table\n" +
 24831  			"                                         │       │           ├─ name: movie_keyword\n" +
 24832  			"                                         │       │           └─ columns: [movie_id keyword_id]\n" +
 24833  			"                                         │       └─ Filter\n" +
 24834  			"                                         │           ├─ HashIn\n" +
 24835  			"                                         │           │   ├─ k.keyword:1!null\n" +
 24836  			"                                         │           │   └─ TUPLE(murder (longtext), violence (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext), hospital (longtext))\n" +
 24837  			"                                         │           └─ TableAlias(k)\n" +
 24838  			"                                         │               └─ ProcessTable\n" +
 24839  			"                                         │                   └─ Table\n" +
 24840  			"                                         │                       ├─ name: keyword\n" +
 24841  			"                                         │                       └─ columns: [id keyword]\n" +
 24842  			"                                         └─ HashLookup\n" +
 24843  			"                                             ├─ left-key: TUPLE(mk.movie_id:21!null)\n" +
 24844  			"                                             ├─ right-key: TUPLE(mi_idx.movie_id:0!null)\n" +
 24845  			"                                             └─ InnerJoin\n" +
 24846  			"                                                 ├─ Eq\n" +
 24847  			"                                                 │   ├─ it2.id:28!null\n" +
 24848  			"                                                 │   └─ mi_idx.info_type_id:26!null\n" +
 24849  			"                                                 ├─ TableAlias(mi_idx)\n" +
 24850  			"                                                 │   └─ ProcessTable\n" +
 24851  			"                                                 │       └─ Table\n" +
 24852  			"                                                 │           ├─ name: movie_info_idx\n" +
 24853  			"                                                 │           └─ columns: [movie_id info_type_id info]\n" +
 24854  			"                                                 └─ Filter\n" +
 24855  			"                                                     ├─ Eq\n" +
 24856  			"                                                     │   ├─ it2.info:1!null\n" +
 24857  			"                                                     │   └─ votes (longtext)\n" +
 24858  			"                                                     └─ TableAlias(it2)\n" +
 24859  			"                                                         └─ Table\n" +
 24860  			"                                                             ├─ name: info_type\n" +
 24861  			"                                                             ├─ columns: [id info]\n" +
 24862  			"                                                             ├─ colSet: (18,19)\n" +
 24863  			"                                                             └─ tableId: 6\n" +
 24864  			"",
 24865  		ExpectedEstimates: "Project\n" +
 24866  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as complete_violent_movie]\n" +
 24867  			" └─ GroupBy\n" +
 24868  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 24869  			"     ├─ Grouping()\n" +
 24870  			"     └─ HashJoin\n" +
 24871  			"         ├─ (cct1.id = cc.subject_id)\n" +
 24872  			"         ├─ Filter\n" +
 24873  			"         │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 24874  			"         │   └─ TableAlias(cct1)\n" +
 24875  			"         │       └─ Table\n" +
 24876  			"         │           ├─ name: comp_cast_type\n" +
 24877  			"         │           └─ columns: [id kind]\n" +
 24878  			"         └─ HashLookup\n" +
 24879  			"             ├─ left-key: (cct1.id)\n" +
 24880  			"             ├─ right-key: (cc.subject_id)\n" +
 24881  			"             └─ HashJoin\n" +
 24882  			"                 ├─ (cct2.id = cc.status_id)\n" +
 24883  			"                 ├─ Filter\n" +
 24884  			"                 │   ├─ (cct2.kind = 'complete+verified')\n" +
 24885  			"                 │   └─ TableAlias(cct2)\n" +
 24886  			"                 │       └─ Table\n" +
 24887  			"                 │           ├─ name: comp_cast_type\n" +
 24888  			"                 │           └─ columns: [id kind]\n" +
 24889  			"                 └─ HashLookup\n" +
 24890  			"                     ├─ left-key: (cct2.id)\n" +
 24891  			"                     ├─ right-key: (cc.status_id)\n" +
 24892  			"                     └─ HashJoin\n" +
 24893  			"                         ├─ (ci.movie_id = cc.movie_id)\n" +
 24894  			"                         ├─ TableAlias(cc)\n" +
 24895  			"                         │   └─ Table\n" +
 24896  			"                         │       ├─ name: complete_cast\n" +
 24897  			"                         │       └─ columns: [movie_id subject_id status_id]\n" +
 24898  			"                         └─ HashLookup\n" +
 24899  			"                             ├─ left-key: (cc.movie_id)\n" +
 24900  			"                             ├─ right-key: (ci.movie_id)\n" +
 24901  			"                             └─ HashJoin\n" +
 24902  			"                                 ├─ (mi.movie_id = mi_idx.movie_id)\n" +
 24903  			"                                 ├─ InnerJoin\n" +
 24904  			"                                 │   ├─ (it1.id = mi.info_type_id)\n" +
 24905  			"                                 │   ├─ Filter\n" +
 24906  			"                                 │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 24907  			"                                 │   │   └─ TableAlias(mi)\n" +
 24908  			"                                 │   │       └─ Table\n" +
 24909  			"                                 │   │           ├─ name: movie_info\n" +
 24910  			"                                 │   │           └─ columns: [movie_id info_type_id info]\n" +
 24911  			"                                 │   └─ Filter\n" +
 24912  			"                                 │       ├─ (it1.info = 'genres')\n" +
 24913  			"                                 │       └─ TableAlias(it1)\n" +
 24914  			"                                 │           └─ Table\n" +
 24915  			"                                 │               ├─ name: info_type\n" +
 24916  			"                                 │               └─ columns: [id info]\n" +
 24917  			"                                 └─ HashLookup\n" +
 24918  			"                                     ├─ left-key: (mi.movie_id)\n" +
 24919  			"                                     ├─ right-key: (mi_idx.movie_id)\n" +
 24920  			"                                     └─ HashJoin\n" +
 24921  			"                                         ├─ (mi_idx.movie_id = mk.movie_id)\n" +
 24922  			"                                         ├─ InnerJoin\n" +
 24923  			"                                         │   ├─ (t.id = mk.movie_id)\n" +
 24924  			"                                         │   ├─ InnerJoin\n" +
 24925  			"                                         │   │   ├─ (t.id = ci.movie_id)\n" +
 24926  			"                                         │   │   ├─ Filter\n" +
 24927  			"                                         │   │   │   ├─ (t.production_year > 2000)\n" +
 24928  			"                                         │   │   │   └─ TableAlias(t)\n" +
 24929  			"                                         │   │   │       └─ Table\n" +
 24930  			"                                         │   │   │           ├─ name: title\n" +
 24931  			"                                         │   │   │           └─ columns: [id title production_year]\n" +
 24932  			"                                         │   │   └─ InnerJoin\n" +
 24933  			"                                         │   │       ├─ (n.id = ci.person_id)\n" +
 24934  			"                                         │   │       ├─ Filter\n" +
 24935  			"                                         │   │       │   ├─ (n.gender = 'm')\n" +
 24936  			"                                         │   │       │   └─ TableAlias(n)\n" +
 24937  			"                                         │   │       │       └─ Table\n" +
 24938  			"                                         │   │       │           ├─ name: name\n" +
 24939  			"                                         │   │       │           └─ columns: [id name gender]\n" +
 24940  			"                                         │   │       └─ Filter\n" +
 24941  			"                                         │   │           ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 24942  			"                                         │   │           └─ TableAlias(ci)\n" +
 24943  			"                                         │   │               └─ Table\n" +
 24944  			"                                         │   │                   ├─ name: cast_info\n" +
 24945  			"                                         │   │                   └─ columns: [person_id movie_id note]\n" +
 24946  			"                                         │   └─ InnerJoin\n" +
 24947  			"                                         │       ├─ (k.id = mk.keyword_id)\n" +
 24948  			"                                         │       ├─ TableAlias(mk)\n" +
 24949  			"                                         │       │   └─ Table\n" +
 24950  			"                                         │       │       ├─ name: movie_keyword\n" +
 24951  			"                                         │       │       └─ columns: [movie_id keyword_id]\n" +
 24952  			"                                         │       └─ Filter\n" +
 24953  			"                                         │           ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 24954  			"                                         │           └─ TableAlias(k)\n" +
 24955  			"                                         │               └─ Table\n" +
 24956  			"                                         │                   ├─ name: keyword\n" +
 24957  			"                                         │                   └─ columns: [id keyword]\n" +
 24958  			"                                         └─ HashLookup\n" +
 24959  			"                                             ├─ left-key: (mk.movie_id)\n" +
 24960  			"                                             ├─ right-key: (mi_idx.movie_id)\n" +
 24961  			"                                             └─ InnerJoin\n" +
 24962  			"                                                 ├─ (it2.id = mi_idx.info_type_id)\n" +
 24963  			"                                                 ├─ TableAlias(mi_idx)\n" +
 24964  			"                                                 │   └─ Table\n" +
 24965  			"                                                 │       ├─ name: movie_info_idx\n" +
 24966  			"                                                 │       └─ columns: [movie_id info_type_id info]\n" +
 24967  			"                                                 └─ Filter\n" +
 24968  			"                                                     ├─ (it2.info = 'votes')\n" +
 24969  			"                                                     └─ TableAlias(it2)\n" +
 24970  			"                                                         └─ Table\n" +
 24971  			"                                                             ├─ name: info_type\n" +
 24972  			"                                                             └─ columns: [id info]\n" +
 24973  			"",
 24974  		ExpectedAnalysis: "Project\n" +
 24975  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as complete_violent_movie]\n" +
 24976  			" └─ GroupBy\n" +
 24977  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 24978  			"     ├─ Grouping()\n" +
 24979  			"     └─ HashJoin\n" +
 24980  			"         ├─ (cct1.id = cc.subject_id)\n" +
 24981  			"         ├─ Filter\n" +
 24982  			"         │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 24983  			"         │   └─ TableAlias(cct1)\n" +
 24984  			"         │       └─ Table\n" +
 24985  			"         │           ├─ name: comp_cast_type\n" +
 24986  			"         │           └─ columns: [id kind]\n" +
 24987  			"         └─ HashLookup\n" +
 24988  			"             ├─ left-key: (cct1.id)\n" +
 24989  			"             ├─ right-key: (cc.subject_id)\n" +
 24990  			"             └─ HashJoin\n" +
 24991  			"                 ├─ (cct2.id = cc.status_id)\n" +
 24992  			"                 ├─ Filter\n" +
 24993  			"                 │   ├─ (cct2.kind = 'complete+verified')\n" +
 24994  			"                 │   └─ TableAlias(cct2)\n" +
 24995  			"                 │       └─ Table\n" +
 24996  			"                 │           ├─ name: comp_cast_type\n" +
 24997  			"                 │           └─ columns: [id kind]\n" +
 24998  			"                 └─ HashLookup\n" +
 24999  			"                     ├─ left-key: (cct2.id)\n" +
 25000  			"                     ├─ right-key: (cc.status_id)\n" +
 25001  			"                     └─ HashJoin\n" +
 25002  			"                         ├─ (ci.movie_id = cc.movie_id)\n" +
 25003  			"                         ├─ TableAlias(cc)\n" +
 25004  			"                         │   └─ Table\n" +
 25005  			"                         │       ├─ name: complete_cast\n" +
 25006  			"                         │       └─ columns: [movie_id subject_id status_id]\n" +
 25007  			"                         └─ HashLookup\n" +
 25008  			"                             ├─ left-key: (cc.movie_id)\n" +
 25009  			"                             ├─ right-key: (ci.movie_id)\n" +
 25010  			"                             └─ HashJoin\n" +
 25011  			"                                 ├─ (mi.movie_id = mi_idx.movie_id)\n" +
 25012  			"                                 ├─ InnerJoin\n" +
 25013  			"                                 │   ├─ (it1.id = mi.info_type_id)\n" +
 25014  			"                                 │   ├─ Filter\n" +
 25015  			"                                 │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 25016  			"                                 │   │   └─ TableAlias(mi)\n" +
 25017  			"                                 │   │       └─ Table\n" +
 25018  			"                                 │   │           ├─ name: movie_info\n" +
 25019  			"                                 │   │           └─ columns: [movie_id info_type_id info]\n" +
 25020  			"                                 │   └─ Filter\n" +
 25021  			"                                 │       ├─ (it1.info = 'genres')\n" +
 25022  			"                                 │       └─ TableAlias(it1)\n" +
 25023  			"                                 │           └─ Table\n" +
 25024  			"                                 │               ├─ name: info_type\n" +
 25025  			"                                 │               └─ columns: [id info]\n" +
 25026  			"                                 └─ HashLookup\n" +
 25027  			"                                     ├─ left-key: (mi.movie_id)\n" +
 25028  			"                                     ├─ right-key: (mi_idx.movie_id)\n" +
 25029  			"                                     └─ HashJoin\n" +
 25030  			"                                         ├─ (mi_idx.movie_id = mk.movie_id)\n" +
 25031  			"                                         ├─ InnerJoin\n" +
 25032  			"                                         │   ├─ (t.id = mk.movie_id)\n" +
 25033  			"                                         │   ├─ InnerJoin\n" +
 25034  			"                                         │   │   ├─ (t.id = ci.movie_id)\n" +
 25035  			"                                         │   │   ├─ Filter\n" +
 25036  			"                                         │   │   │   ├─ (t.production_year > 2000)\n" +
 25037  			"                                         │   │   │   └─ TableAlias(t)\n" +
 25038  			"                                         │   │   │       └─ Table\n" +
 25039  			"                                         │   │   │           ├─ name: title\n" +
 25040  			"                                         │   │   │           └─ columns: [id title production_year]\n" +
 25041  			"                                         │   │   └─ InnerJoin\n" +
 25042  			"                                         │   │       ├─ (n.id = ci.person_id)\n" +
 25043  			"                                         │   │       ├─ Filter\n" +
 25044  			"                                         │   │       │   ├─ (n.gender = 'm')\n" +
 25045  			"                                         │   │       │   └─ TableAlias(n)\n" +
 25046  			"                                         │   │       │       └─ Table\n" +
 25047  			"                                         │   │       │           ├─ name: name\n" +
 25048  			"                                         │   │       │           └─ columns: [id name gender]\n" +
 25049  			"                                         │   │       └─ Filter\n" +
 25050  			"                                         │   │           ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 25051  			"                                         │   │           └─ TableAlias(ci)\n" +
 25052  			"                                         │   │               └─ Table\n" +
 25053  			"                                         │   │                   ├─ name: cast_info\n" +
 25054  			"                                         │   │                   └─ columns: [person_id movie_id note]\n" +
 25055  			"                                         │   └─ InnerJoin\n" +
 25056  			"                                         │       ├─ (k.id = mk.keyword_id)\n" +
 25057  			"                                         │       ├─ TableAlias(mk)\n" +
 25058  			"                                         │       │   └─ Table\n" +
 25059  			"                                         │       │       ├─ name: movie_keyword\n" +
 25060  			"                                         │       │       └─ columns: [movie_id keyword_id]\n" +
 25061  			"                                         │       └─ Filter\n" +
 25062  			"                                         │           ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 25063  			"                                         │           └─ TableAlias(k)\n" +
 25064  			"                                         │               └─ Table\n" +
 25065  			"                                         │                   ├─ name: keyword\n" +
 25066  			"                                         │                   └─ columns: [id keyword]\n" +
 25067  			"                                         └─ HashLookup\n" +
 25068  			"                                             ├─ left-key: (mk.movie_id)\n" +
 25069  			"                                             ├─ right-key: (mi_idx.movie_id)\n" +
 25070  			"                                             └─ InnerJoin\n" +
 25071  			"                                                 ├─ (it2.id = mi_idx.info_type_id)\n" +
 25072  			"                                                 ├─ TableAlias(mi_idx)\n" +
 25073  			"                                                 │   └─ Table\n" +
 25074  			"                                                 │       ├─ name: movie_info_idx\n" +
 25075  			"                                                 │       └─ columns: [movie_id info_type_id info]\n" +
 25076  			"                                                 └─ Filter\n" +
 25077  			"                                                     ├─ (it2.info = 'votes')\n" +
 25078  			"                                                     └─ TableAlias(it2)\n" +
 25079  			"                                                         └─ Table\n" +
 25080  			"                                                             ├─ name: info_type\n" +
 25081  			"                                                             └─ columns: [id info]\n" +
 25082  			"",
 25083  	},
 25084  	{
 25085  		Query: `
 25086  SELECT MIN(mi.info) AS movie_budget,
 25087         MIN(mi_idx.info) AS movie_votes,
 25088         MIN(n.name) AS writer,
 25089         MIN(t.title) AS complete_gore_movie
 25090  FROM complete_cast AS cc,
 25091       comp_cast_type AS cct1,
 25092       comp_cast_type AS cct2,
 25093       cast_info AS ci,
 25094       info_type AS it1,
 25095       info_type AS it2,
 25096       keyword AS k,
 25097       movie_info AS mi,
 25098       movie_info_idx AS mi_idx,
 25099       movie_keyword AS mk,
 25100       name AS n,
 25101       title AS t
 25102  WHERE cct1.kind IN ('cast',
 25103                      'crew')
 25104    AND cct2.kind ='complete+verified'
 25105    AND ci.note IN ('(writer)',
 25106                    '(head writer)',
 25107                    '(written by)',
 25108                    '(story)',
 25109                    '(story editor)')
 25110    AND it1.info = 'genres'
 25111    AND it2.info = 'votes'
 25112    AND k.keyword IN ('murder',
 25113                      'violence',
 25114                      'blood',
 25115                      'gore',
 25116                      'death',
 25117                      'female-nudity',
 25118                      'hospital')
 25119    AND mi.info IN ('Horror',
 25120                    'Thriller')
 25121    AND n.gender = 'm'
 25122    AND t.production_year > 2000
 25123    AND (t.title LIKE '%Freddy%'
 25124         OR t.title LIKE '%Jason%'
 25125         OR t.title LIKE 'Saw%')
 25126    AND t.id = mi.movie_id
 25127    AND t.id = mi_idx.movie_id
 25128    AND t.id = ci.movie_id
 25129    AND t.id = mk.movie_id
 25130    AND t.id = cc.movie_id
 25131    AND ci.movie_id = mi.movie_id
 25132    AND ci.movie_id = mi_idx.movie_id
 25133    AND ci.movie_id = mk.movie_id
 25134    AND ci.movie_id = cc.movie_id
 25135    AND mi.movie_id = mi_idx.movie_id
 25136    AND mi.movie_id = mk.movie_id
 25137    AND mi.movie_id = cc.movie_id
 25138    AND mi_idx.movie_id = mk.movie_id
 25139    AND mi_idx.movie_id = cc.movie_id
 25140    AND mk.movie_id = cc.movie_id
 25141    AND n.id = ci.person_id
 25142    AND it1.id = mi.info_type_id
 25143    AND it2.id = mi_idx.info_type_id
 25144    AND k.id = mk.keyword_id
 25145    AND cct1.id = cc.subject_id
 25146    AND cct2.id = cc.status_id;
 25147  
 25148  `,
 25149  		ExpectedPlan: "Project\n" +
 25150  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as writer, min(t.title):3!null as complete_gore_movie]\n" +
 25151  			" └─ GroupBy\n" +
 25152  			"     ├─ select: MIN(mi.info:9!null), MIN(mi_idx.info:27!null), MIN(n.name:16!null), MIN(t.title:13!null)\n" +
 25153  			"     ├─ group: \n" +
 25154  			"     └─ HashJoin\n" +
 25155  			"         ├─ Eq\n" +
 25156  			"         │   ├─ cct1.id:0!null\n" +
 25157  			"         │   └─ cc.subject_id:5!null\n" +
 25158  			"         ├─ Filter\n" +
 25159  			"         │   ├─ HashIn\n" +
 25160  			"         │   │   ├─ cct1.kind:1!null\n" +
 25161  			"         │   │   └─ TUPLE(cast (longtext), crew (longtext))\n" +
 25162  			"         │   └─ TableAlias(cct1)\n" +
 25163  			"         │       └─ ProcessTable\n" +
 25164  			"         │           └─ Table\n" +
 25165  			"         │               ├─ name: comp_cast_type\n" +
 25166  			"         │               └─ columns: [id kind]\n" +
 25167  			"         └─ HashLookup\n" +
 25168  			"             ├─ left-key: TUPLE(cct1.id:0!null)\n" +
 25169  			"             ├─ right-key: TUPLE(cc.subject_id:3!null)\n" +
 25170  			"             └─ HashJoin\n" +
 25171  			"                 ├─ Eq\n" +
 25172  			"                 │   ├─ cct2.id:2!null\n" +
 25173  			"                 │   └─ cc.status_id:6!null\n" +
 25174  			"                 ├─ Filter\n" +
 25175  			"                 │   ├─ Eq\n" +
 25176  			"                 │   │   ├─ cct2.kind:1!null\n" +
 25177  			"                 │   │   └─ complete+verified (longtext)\n" +
 25178  			"                 │   └─ TableAlias(cct2)\n" +
 25179  			"                 │       └─ Table\n" +
 25180  			"                 │           ├─ name: comp_cast_type\n" +
 25181  			"                 │           ├─ columns: [id kind]\n" +
 25182  			"                 │           ├─ colSet: (7,8)\n" +
 25183  			"                 │           └─ tableId: 3\n" +
 25184  			"                 └─ HashLookup\n" +
 25185  			"                     ├─ left-key: TUPLE(cct2.id:2!null)\n" +
 25186  			"                     ├─ right-key: TUPLE(cc.status_id:2!null)\n" +
 25187  			"                     └─ HashJoin\n" +
 25188  			"                         ├─ Eq\n" +
 25189  			"                         │   ├─ ci.movie_id:19!null\n" +
 25190  			"                         │   └─ cc.movie_id:4\n" +
 25191  			"                         ├─ TableAlias(cc)\n" +
 25192  			"                         │   └─ ProcessTable\n" +
 25193  			"                         │       └─ Table\n" +
 25194  			"                         │           ├─ name: complete_cast\n" +
 25195  			"                         │           └─ columns: [movie_id subject_id status_id]\n" +
 25196  			"                         └─ HashLookup\n" +
 25197  			"                             ├─ left-key: TUPLE(cc.movie_id:4)\n" +
 25198  			"                             ├─ right-key: TUPLE(ci.movie_id:12!null)\n" +
 25199  			"                             └─ HashJoin\n" +
 25200  			"                                 ├─ Eq\n" +
 25201  			"                                 │   ├─ mi.movie_id:7!null\n" +
 25202  			"                                 │   └─ mi_idx.movie_id:25!null\n" +
 25203  			"                                 ├─ InnerJoin\n" +
 25204  			"                                 │   ├─ Eq\n" +
 25205  			"                                 │   │   ├─ it1.id:10!null\n" +
 25206  			"                                 │   │   └─ mi.info_type_id:8!null\n" +
 25207  			"                                 │   ├─ Filter\n" +
 25208  			"                                 │   │   ├─ HashIn\n" +
 25209  			"                                 │   │   │   ├─ mi.info:2!null\n" +
 25210  			"                                 │   │   │   └─ TUPLE(Horror (longtext), Thriller (longtext))\n" +
 25211  			"                                 │   │   └─ TableAlias(mi)\n" +
 25212  			"                                 │   │       └─ ProcessTable\n" +
 25213  			"                                 │   │           └─ Table\n" +
 25214  			"                                 │   │               ├─ name: movie_info\n" +
 25215  			"                                 │   │               └─ columns: [movie_id info_type_id info]\n" +
 25216  			"                                 │   └─ Filter\n" +
 25217  			"                                 │       ├─ Eq\n" +
 25218  			"                                 │       │   ├─ it1.info:1!null\n" +
 25219  			"                                 │       │   └─ genres (longtext)\n" +
 25220  			"                                 │       └─ TableAlias(it1)\n" +
 25221  			"                                 │           └─ ProcessTable\n" +
 25222  			"                                 │               └─ Table\n" +
 25223  			"                                 │                   ├─ name: info_type\n" +
 25224  			"                                 │                   └─ columns: [id info]\n" +
 25225  			"                                 └─ HashLookup\n" +
 25226  			"                                     ├─ left-key: TUPLE(mi.movie_id:7!null)\n" +
 25227  			"                                     ├─ right-key: TUPLE(mi_idx.movie_id:13!null)\n" +
 25228  			"                                     └─ HashJoin\n" +
 25229  			"                                         ├─ Eq\n" +
 25230  			"                                         │   ├─ mi_idx.movie_id:25!null\n" +
 25231  			"                                         │   └─ mk.movie_id:21!null\n" +
 25232  			"                                         ├─ InnerJoin\n" +
 25233  			"                                         │   ├─ Eq\n" +
 25234  			"                                         │   │   ├─ t.id:12!null\n" +
 25235  			"                                         │   │   └─ mk.movie_id:21!null\n" +
 25236  			"                                         │   ├─ InnerJoin\n" +
 25237  			"                                         │   │   ├─ Eq\n" +
 25238  			"                                         │   │   │   ├─ t.id:12!null\n" +
 25239  			"                                         │   │   │   └─ ci.movie_id:19!null\n" +
 25240  			"                                         │   │   ├─ Filter\n" +
 25241  			"                                         │   │   │   ├─ AND\n" +
 25242  			"                                         │   │   │   │   ├─ GreaterThan\n" +
 25243  			"                                         │   │   │   │   │   ├─ t.production_year:2\n" +
 25244  			"                                         │   │   │   │   │   └─ 2000 (smallint)\n" +
 25245  			"                                         │   │   │   │   └─ Or\n" +
 25246  			"                                         │   │   │   │       ├─ Or\n" +
 25247  			"                                         │   │   │   │       │   ├─ t.title LIKE '%Freddy%'\n" +
 25248  			"                                         │   │   │   │       │   └─ t.title LIKE '%Jason%'\n" +
 25249  			"                                         │   │   │   │       └─ AND\n" +
 25250  			"                                         │   │   │   │           ├─ GreaterThanOrEqual\n" +
 25251  			"                                         │   │   │   │           │   ├─ t.title:1!null\n" +
 25252  			"                                         │   │   │   │           │   └─ Saw (longtext)\n" +
 25253  			"                                         │   │   │   │           └─ LessThanOrEqual\n" +
 25254  			"                                         │   │   │   │               ├─ t.title:1!null\n" +
 25255  			"                                         │   │   │   │               └─ Sawÿ (longtext)\n" +
 25256  			"                                         │   │   │   └─ TableAlias(t)\n" +
 25257  			"                                         │   │   │       └─ ProcessTable\n" +
 25258  			"                                         │   │   │           └─ Table\n" +
 25259  			"                                         │   │   │               ├─ name: title\n" +
 25260  			"                                         │   │   │               └─ columns: [id title production_year]\n" +
 25261  			"                                         │   │   └─ InnerJoin\n" +
 25262  			"                                         │   │       ├─ Eq\n" +
 25263  			"                                         │   │       │   ├─ n.id:15!null\n" +
 25264  			"                                         │   │       │   └─ ci.person_id:18!null\n" +
 25265  			"                                         │   │       ├─ Filter\n" +
 25266  			"                                         │   │       │   ├─ Eq\n" +
 25267  			"                                         │   │       │   │   ├─ n.gender:2\n" +
 25268  			"                                         │   │       │   │   └─ m (longtext)\n" +
 25269  			"                                         │   │       │   └─ TableAlias(n)\n" +
 25270  			"                                         │   │       │       └─ ProcessTable\n" +
 25271  			"                                         │   │       │           └─ Table\n" +
 25272  			"                                         │   │       │               ├─ name: name\n" +
 25273  			"                                         │   │       │               └─ columns: [id name gender]\n" +
 25274  			"                                         │   │       └─ Filter\n" +
 25275  			"                                         │   │           ├─ HashIn\n" +
 25276  			"                                         │   │           │   ├─ ci.note:2\n" +
 25277  			"                                         │   │           │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 25278  			"                                         │   │           └─ TableAlias(ci)\n" +
 25279  			"                                         │   │               └─ ProcessTable\n" +
 25280  			"                                         │   │                   └─ Table\n" +
 25281  			"                                         │   │                       ├─ name: cast_info\n" +
 25282  			"                                         │   │                       └─ columns: [person_id movie_id note]\n" +
 25283  			"                                         │   └─ InnerJoin\n" +
 25284  			"                                         │       ├─ Eq\n" +
 25285  			"                                         │       │   ├─ k.id:23!null\n" +
 25286  			"                                         │       │   └─ mk.keyword_id:22!null\n" +
 25287  			"                                         │       ├─ TableAlias(mk)\n" +
 25288  			"                                         │       │   └─ ProcessTable\n" +
 25289  			"                                         │       │       └─ Table\n" +
 25290  			"                                         │       │           ├─ name: movie_keyword\n" +
 25291  			"                                         │       │           └─ columns: [movie_id keyword_id]\n" +
 25292  			"                                         │       └─ Filter\n" +
 25293  			"                                         │           ├─ HashIn\n" +
 25294  			"                                         │           │   ├─ k.keyword:1!null\n" +
 25295  			"                                         │           │   └─ TUPLE(murder (longtext), violence (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext), hospital (longtext))\n" +
 25296  			"                                         │           └─ TableAlias(k)\n" +
 25297  			"                                         │               └─ ProcessTable\n" +
 25298  			"                                         │                   └─ Table\n" +
 25299  			"                                         │                       ├─ name: keyword\n" +
 25300  			"                                         │                       └─ columns: [id keyword]\n" +
 25301  			"                                         └─ HashLookup\n" +
 25302  			"                                             ├─ left-key: TUPLE(mk.movie_id:21!null)\n" +
 25303  			"                                             ├─ right-key: TUPLE(mi_idx.movie_id:0!null)\n" +
 25304  			"                                             └─ InnerJoin\n" +
 25305  			"                                                 ├─ Eq\n" +
 25306  			"                                                 │   ├─ it2.id:28!null\n" +
 25307  			"                                                 │   └─ mi_idx.info_type_id:26!null\n" +
 25308  			"                                                 ├─ TableAlias(mi_idx)\n" +
 25309  			"                                                 │   └─ ProcessTable\n" +
 25310  			"                                                 │       └─ Table\n" +
 25311  			"                                                 │           ├─ name: movie_info_idx\n" +
 25312  			"                                                 │           └─ columns: [movie_id info_type_id info]\n" +
 25313  			"                                                 └─ Filter\n" +
 25314  			"                                                     ├─ Eq\n" +
 25315  			"                                                     │   ├─ it2.info:1!null\n" +
 25316  			"                                                     │   └─ votes (longtext)\n" +
 25317  			"                                                     └─ TableAlias(it2)\n" +
 25318  			"                                                         └─ Table\n" +
 25319  			"                                                             ├─ name: info_type\n" +
 25320  			"                                                             ├─ columns: [id info]\n" +
 25321  			"                                                             ├─ colSet: (18,19)\n" +
 25322  			"                                                             └─ tableId: 6\n" +
 25323  			"",
 25324  		ExpectedEstimates: "Project\n" +
 25325  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as complete_gore_movie]\n" +
 25326  			" └─ GroupBy\n" +
 25327  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 25328  			"     ├─ Grouping()\n" +
 25329  			"     └─ HashJoin\n" +
 25330  			"         ├─ (cct1.id = cc.subject_id)\n" +
 25331  			"         ├─ Filter\n" +
 25332  			"         │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 25333  			"         │   └─ TableAlias(cct1)\n" +
 25334  			"         │       └─ Table\n" +
 25335  			"         │           ├─ name: comp_cast_type\n" +
 25336  			"         │           └─ columns: [id kind]\n" +
 25337  			"         └─ HashLookup\n" +
 25338  			"             ├─ left-key: (cct1.id)\n" +
 25339  			"             ├─ right-key: (cc.subject_id)\n" +
 25340  			"             └─ HashJoin\n" +
 25341  			"                 ├─ (cct2.id = cc.status_id)\n" +
 25342  			"                 ├─ Filter\n" +
 25343  			"                 │   ├─ (cct2.kind = 'complete+verified')\n" +
 25344  			"                 │   └─ TableAlias(cct2)\n" +
 25345  			"                 │       └─ Table\n" +
 25346  			"                 │           ├─ name: comp_cast_type\n" +
 25347  			"                 │           └─ columns: [id kind]\n" +
 25348  			"                 └─ HashLookup\n" +
 25349  			"                     ├─ left-key: (cct2.id)\n" +
 25350  			"                     ├─ right-key: (cc.status_id)\n" +
 25351  			"                     └─ HashJoin\n" +
 25352  			"                         ├─ (ci.movie_id = cc.movie_id)\n" +
 25353  			"                         ├─ TableAlias(cc)\n" +
 25354  			"                         │   └─ Table\n" +
 25355  			"                         │       ├─ name: complete_cast\n" +
 25356  			"                         │       └─ columns: [movie_id subject_id status_id]\n" +
 25357  			"                         └─ HashLookup\n" +
 25358  			"                             ├─ left-key: (cc.movie_id)\n" +
 25359  			"                             ├─ right-key: (ci.movie_id)\n" +
 25360  			"                             └─ HashJoin\n" +
 25361  			"                                 ├─ (mi.movie_id = mi_idx.movie_id)\n" +
 25362  			"                                 ├─ InnerJoin\n" +
 25363  			"                                 │   ├─ (it1.id = mi.info_type_id)\n" +
 25364  			"                                 │   ├─ Filter\n" +
 25365  			"                                 │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 25366  			"                                 │   │   └─ TableAlias(mi)\n" +
 25367  			"                                 │   │       └─ Table\n" +
 25368  			"                                 │   │           ├─ name: movie_info\n" +
 25369  			"                                 │   │           └─ columns: [movie_id info_type_id info]\n" +
 25370  			"                                 │   └─ Filter\n" +
 25371  			"                                 │       ├─ (it1.info = 'genres')\n" +
 25372  			"                                 │       └─ TableAlias(it1)\n" +
 25373  			"                                 │           └─ Table\n" +
 25374  			"                                 │               ├─ name: info_type\n" +
 25375  			"                                 │               └─ columns: [id info]\n" +
 25376  			"                                 └─ HashLookup\n" +
 25377  			"                                     ├─ left-key: (mi.movie_id)\n" +
 25378  			"                                     ├─ right-key: (mi_idx.movie_id)\n" +
 25379  			"                                     └─ HashJoin\n" +
 25380  			"                                         ├─ (mi_idx.movie_id = mk.movie_id)\n" +
 25381  			"                                         ├─ InnerJoin\n" +
 25382  			"                                         │   ├─ (t.id = mk.movie_id)\n" +
 25383  			"                                         │   ├─ InnerJoin\n" +
 25384  			"                                         │   │   ├─ (t.id = ci.movie_id)\n" +
 25385  			"                                         │   │   ├─ Filter\n" +
 25386  			"                                         │   │   │   ├─ ((t.production_year > 2000) AND ((t.title LIKE '%Freddy%' OR t.title LIKE '%Jason%') OR ((t.title >= 'Saw') AND (t.title <= 'Sawÿ'))))\n" +
 25387  			"                                         │   │   │   └─ TableAlias(t)\n" +
 25388  			"                                         │   │   │       └─ Table\n" +
 25389  			"                                         │   │   │           ├─ name: title\n" +
 25390  			"                                         │   │   │           └─ columns: [id title production_year]\n" +
 25391  			"                                         │   │   └─ InnerJoin\n" +
 25392  			"                                         │   │       ├─ (n.id = ci.person_id)\n" +
 25393  			"                                         │   │       ├─ Filter\n" +
 25394  			"                                         │   │       │   ├─ (n.gender = 'm')\n" +
 25395  			"                                         │   │       │   └─ TableAlias(n)\n" +
 25396  			"                                         │   │       │       └─ Table\n" +
 25397  			"                                         │   │       │           ├─ name: name\n" +
 25398  			"                                         │   │       │           └─ columns: [id name gender]\n" +
 25399  			"                                         │   │       └─ Filter\n" +
 25400  			"                                         │   │           ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 25401  			"                                         │   │           └─ TableAlias(ci)\n" +
 25402  			"                                         │   │               └─ Table\n" +
 25403  			"                                         │   │                   ├─ name: cast_info\n" +
 25404  			"                                         │   │                   └─ columns: [person_id movie_id note]\n" +
 25405  			"                                         │   └─ InnerJoin\n" +
 25406  			"                                         │       ├─ (k.id = mk.keyword_id)\n" +
 25407  			"                                         │       ├─ TableAlias(mk)\n" +
 25408  			"                                         │       │   └─ Table\n" +
 25409  			"                                         │       │       ├─ name: movie_keyword\n" +
 25410  			"                                         │       │       └─ columns: [movie_id keyword_id]\n" +
 25411  			"                                         │       └─ Filter\n" +
 25412  			"                                         │           ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 25413  			"                                         │           └─ TableAlias(k)\n" +
 25414  			"                                         │               └─ Table\n" +
 25415  			"                                         │                   ├─ name: keyword\n" +
 25416  			"                                         │                   └─ columns: [id keyword]\n" +
 25417  			"                                         └─ HashLookup\n" +
 25418  			"                                             ├─ left-key: (mk.movie_id)\n" +
 25419  			"                                             ├─ right-key: (mi_idx.movie_id)\n" +
 25420  			"                                             └─ InnerJoin\n" +
 25421  			"                                                 ├─ (it2.id = mi_idx.info_type_id)\n" +
 25422  			"                                                 ├─ TableAlias(mi_idx)\n" +
 25423  			"                                                 │   └─ Table\n" +
 25424  			"                                                 │       ├─ name: movie_info_idx\n" +
 25425  			"                                                 │       └─ columns: [movie_id info_type_id info]\n" +
 25426  			"                                                 └─ Filter\n" +
 25427  			"                                                     ├─ (it2.info = 'votes')\n" +
 25428  			"                                                     └─ TableAlias(it2)\n" +
 25429  			"                                                         └─ Table\n" +
 25430  			"                                                             ├─ name: info_type\n" +
 25431  			"                                                             └─ columns: [id info]\n" +
 25432  			"",
 25433  		ExpectedAnalysis: "Project\n" +
 25434  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as complete_gore_movie]\n" +
 25435  			" └─ GroupBy\n" +
 25436  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 25437  			"     ├─ Grouping()\n" +
 25438  			"     └─ HashJoin\n" +
 25439  			"         ├─ (cct1.id = cc.subject_id)\n" +
 25440  			"         ├─ Filter\n" +
 25441  			"         │   ├─ (cct1.kind HASH IN ('cast', 'crew'))\n" +
 25442  			"         │   └─ TableAlias(cct1)\n" +
 25443  			"         │       └─ Table\n" +
 25444  			"         │           ├─ name: comp_cast_type\n" +
 25445  			"         │           └─ columns: [id kind]\n" +
 25446  			"         └─ HashLookup\n" +
 25447  			"             ├─ left-key: (cct1.id)\n" +
 25448  			"             ├─ right-key: (cc.subject_id)\n" +
 25449  			"             └─ HashJoin\n" +
 25450  			"                 ├─ (cct2.id = cc.status_id)\n" +
 25451  			"                 ├─ Filter\n" +
 25452  			"                 │   ├─ (cct2.kind = 'complete+verified')\n" +
 25453  			"                 │   └─ TableAlias(cct2)\n" +
 25454  			"                 │       └─ Table\n" +
 25455  			"                 │           ├─ name: comp_cast_type\n" +
 25456  			"                 │           └─ columns: [id kind]\n" +
 25457  			"                 └─ HashLookup\n" +
 25458  			"                     ├─ left-key: (cct2.id)\n" +
 25459  			"                     ├─ right-key: (cc.status_id)\n" +
 25460  			"                     └─ HashJoin\n" +
 25461  			"                         ├─ (ci.movie_id = cc.movie_id)\n" +
 25462  			"                         ├─ TableAlias(cc)\n" +
 25463  			"                         │   └─ Table\n" +
 25464  			"                         │       ├─ name: complete_cast\n" +
 25465  			"                         │       └─ columns: [movie_id subject_id status_id]\n" +
 25466  			"                         └─ HashLookup\n" +
 25467  			"                             ├─ left-key: (cc.movie_id)\n" +
 25468  			"                             ├─ right-key: (ci.movie_id)\n" +
 25469  			"                             └─ HashJoin\n" +
 25470  			"                                 ├─ (mi.movie_id = mi_idx.movie_id)\n" +
 25471  			"                                 ├─ InnerJoin\n" +
 25472  			"                                 │   ├─ (it1.id = mi.info_type_id)\n" +
 25473  			"                                 │   ├─ Filter\n" +
 25474  			"                                 │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 25475  			"                                 │   │   └─ TableAlias(mi)\n" +
 25476  			"                                 │   │       └─ Table\n" +
 25477  			"                                 │   │           ├─ name: movie_info\n" +
 25478  			"                                 │   │           └─ columns: [movie_id info_type_id info]\n" +
 25479  			"                                 │   └─ Filter\n" +
 25480  			"                                 │       ├─ (it1.info = 'genres')\n" +
 25481  			"                                 │       └─ TableAlias(it1)\n" +
 25482  			"                                 │           └─ Table\n" +
 25483  			"                                 │               ├─ name: info_type\n" +
 25484  			"                                 │               └─ columns: [id info]\n" +
 25485  			"                                 └─ HashLookup\n" +
 25486  			"                                     ├─ left-key: (mi.movie_id)\n" +
 25487  			"                                     ├─ right-key: (mi_idx.movie_id)\n" +
 25488  			"                                     └─ HashJoin\n" +
 25489  			"                                         ├─ (mi_idx.movie_id = mk.movie_id)\n" +
 25490  			"                                         ├─ InnerJoin\n" +
 25491  			"                                         │   ├─ (t.id = mk.movie_id)\n" +
 25492  			"                                         │   ├─ InnerJoin\n" +
 25493  			"                                         │   │   ├─ (t.id = ci.movie_id)\n" +
 25494  			"                                         │   │   ├─ Filter\n" +
 25495  			"                                         │   │   │   ├─ ((t.production_year > 2000) AND ((t.title LIKE '%Freddy%' OR t.title LIKE '%Jason%') OR ((t.title >= 'Saw') AND (t.title <= 'Sawÿ'))))\n" +
 25496  			"                                         │   │   │   └─ TableAlias(t)\n" +
 25497  			"                                         │   │   │       └─ Table\n" +
 25498  			"                                         │   │   │           ├─ name: title\n" +
 25499  			"                                         │   │   │           └─ columns: [id title production_year]\n" +
 25500  			"                                         │   │   └─ InnerJoin\n" +
 25501  			"                                         │   │       ├─ (n.id = ci.person_id)\n" +
 25502  			"                                         │   │       ├─ Filter\n" +
 25503  			"                                         │   │       │   ├─ (n.gender = 'm')\n" +
 25504  			"                                         │   │       │   └─ TableAlias(n)\n" +
 25505  			"                                         │   │       │       └─ Table\n" +
 25506  			"                                         │   │       │           ├─ name: name\n" +
 25507  			"                                         │   │       │           └─ columns: [id name gender]\n" +
 25508  			"                                         │   │       └─ Filter\n" +
 25509  			"                                         │   │           ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 25510  			"                                         │   │           └─ TableAlias(ci)\n" +
 25511  			"                                         │   │               └─ Table\n" +
 25512  			"                                         │   │                   ├─ name: cast_info\n" +
 25513  			"                                         │   │                   └─ columns: [person_id movie_id note]\n" +
 25514  			"                                         │   └─ InnerJoin\n" +
 25515  			"                                         │       ├─ (k.id = mk.keyword_id)\n" +
 25516  			"                                         │       ├─ TableAlias(mk)\n" +
 25517  			"                                         │       │   └─ Table\n" +
 25518  			"                                         │       │       ├─ name: movie_keyword\n" +
 25519  			"                                         │       │       └─ columns: [movie_id keyword_id]\n" +
 25520  			"                                         │       └─ Filter\n" +
 25521  			"                                         │           ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 25522  			"                                         │           └─ TableAlias(k)\n" +
 25523  			"                                         │               └─ Table\n" +
 25524  			"                                         │                   ├─ name: keyword\n" +
 25525  			"                                         │                   └─ columns: [id keyword]\n" +
 25526  			"                                         └─ HashLookup\n" +
 25527  			"                                             ├─ left-key: (mk.movie_id)\n" +
 25528  			"                                             ├─ right-key: (mi_idx.movie_id)\n" +
 25529  			"                                             └─ InnerJoin\n" +
 25530  			"                                                 ├─ (it2.id = mi_idx.info_type_id)\n" +
 25531  			"                                                 ├─ TableAlias(mi_idx)\n" +
 25532  			"                                                 │   └─ Table\n" +
 25533  			"                                                 │       ├─ name: movie_info_idx\n" +
 25534  			"                                                 │       └─ columns: [movie_id info_type_id info]\n" +
 25535  			"                                                 └─ Filter\n" +
 25536  			"                                                     ├─ (it2.info = 'votes')\n" +
 25537  			"                                                     └─ TableAlias(it2)\n" +
 25538  			"                                                         └─ Table\n" +
 25539  			"                                                             ├─ name: info_type\n" +
 25540  			"                                                             └─ columns: [id info]\n" +
 25541  			"",
 25542  	},
 25543  	{
 25544  		Query: `
 25545  SELECT MIN(mi.info) AS movie_budget,
 25546         MIN(mi_idx.info) AS movie_votes,
 25547         MIN(n.name) AS writer,
 25548         MIN(t.title) AS complete_violent_movie
 25549  FROM complete_cast AS cc,
 25550       comp_cast_type AS cct1,
 25551       comp_cast_type AS cct2,
 25552       cast_info AS ci,
 25553       info_type AS it1,
 25554       info_type AS it2,
 25555       keyword AS k,
 25556       movie_info AS mi,
 25557       movie_info_idx AS mi_idx,
 25558       movie_keyword AS mk,
 25559       name AS n,
 25560       title AS t
 25561  WHERE cct1.kind = 'cast'
 25562    AND cct2.kind ='complete+verified'
 25563    AND ci.note IN ('(writer)',
 25564                    '(head writer)',
 25565                    '(written by)',
 25566                    '(story)',
 25567                    '(story editor)')
 25568    AND it1.info = 'genres'
 25569    AND it2.info = 'votes'
 25570    AND k.keyword IN ('murder',
 25571                      'violence',
 25572                      'blood',
 25573                      'gore',
 25574                      'death',
 25575                      'female-nudity',
 25576                      'hospital')
 25577    AND mi.info IN ('Horror',
 25578                    'Action',
 25579                    'Sci-Fi',
 25580                    'Thriller',
 25581                    'Crime',
 25582                    'War')
 25583    AND n.gender = 'm'
 25584    AND t.id = mi.movie_id
 25585    AND t.id = mi_idx.movie_id
 25586    AND t.id = ci.movie_id
 25587    AND t.id = mk.movie_id
 25588    AND t.id = cc.movie_id
 25589    AND ci.movie_id = mi.movie_id
 25590    AND ci.movie_id = mi_idx.movie_id
 25591    AND ci.movie_id = mk.movie_id
 25592    AND ci.movie_id = cc.movie_id
 25593    AND mi.movie_id = mi_idx.movie_id
 25594    AND mi.movie_id = mk.movie_id
 25595    AND mi.movie_id = cc.movie_id
 25596    AND mi_idx.movie_id = mk.movie_id
 25597    AND mi_idx.movie_id = cc.movie_id
 25598    AND mk.movie_id = cc.movie_id
 25599    AND n.id = ci.person_id
 25600    AND it1.id = mi.info_type_id
 25601    AND it2.id = mi_idx.info_type_id
 25602    AND k.id = mk.keyword_id
 25603    AND cct1.id = cc.subject_id
 25604    AND cct2.id = cc.status_id;
 25605  
 25606  `,
 25607  		ExpectedPlan: "Project\n" +
 25608  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as writer, min(t.title):3!null as complete_violent_movie]\n" +
 25609  			" └─ GroupBy\n" +
 25610  			"     ├─ select: MIN(mi.info:9!null), MIN(mi_idx.info:26!null), MIN(n.name:15!null), MIN(t.title:13!null)\n" +
 25611  			"     ├─ group: \n" +
 25612  			"     └─ HashJoin\n" +
 25613  			"         ├─ Eq\n" +
 25614  			"         │   ├─ cct1.id:0!null\n" +
 25615  			"         │   └─ cc.subject_id:5!null\n" +
 25616  			"         ├─ Filter\n" +
 25617  			"         │   ├─ Eq\n" +
 25618  			"         │   │   ├─ cct1.kind:1!null\n" +
 25619  			"         │   │   └─ cast (longtext)\n" +
 25620  			"         │   └─ TableAlias(cct1)\n" +
 25621  			"         │       └─ ProcessTable\n" +
 25622  			"         │           └─ Table\n" +
 25623  			"         │               ├─ name: comp_cast_type\n" +
 25624  			"         │               └─ columns: [id kind]\n" +
 25625  			"         └─ HashLookup\n" +
 25626  			"             ├─ left-key: TUPLE(cct1.id:0!null)\n" +
 25627  			"             ├─ right-key: TUPLE(cc.subject_id:3!null)\n" +
 25628  			"             └─ HashJoin\n" +
 25629  			"                 ├─ Eq\n" +
 25630  			"                 │   ├─ cct2.id:2!null\n" +
 25631  			"                 │   └─ cc.status_id:6!null\n" +
 25632  			"                 ├─ Filter\n" +
 25633  			"                 │   ├─ Eq\n" +
 25634  			"                 │   │   ├─ cct2.kind:1!null\n" +
 25635  			"                 │   │   └─ complete+verified (longtext)\n" +
 25636  			"                 │   └─ TableAlias(cct2)\n" +
 25637  			"                 │       └─ Table\n" +
 25638  			"                 │           ├─ name: comp_cast_type\n" +
 25639  			"                 │           ├─ columns: [id kind]\n" +
 25640  			"                 │           ├─ colSet: (7,8)\n" +
 25641  			"                 │           └─ tableId: 3\n" +
 25642  			"                 └─ HashLookup\n" +
 25643  			"                     ├─ left-key: TUPLE(cct2.id:2!null)\n" +
 25644  			"                     ├─ right-key: TUPLE(cc.status_id:2!null)\n" +
 25645  			"                     └─ HashJoin\n" +
 25646  			"                         ├─ Eq\n" +
 25647  			"                         │   ├─ ci.movie_id:18!null\n" +
 25648  			"                         │   └─ cc.movie_id:4\n" +
 25649  			"                         ├─ TableAlias(cc)\n" +
 25650  			"                         │   └─ ProcessTable\n" +
 25651  			"                         │       └─ Table\n" +
 25652  			"                         │           ├─ name: complete_cast\n" +
 25653  			"                         │           └─ columns: [movie_id subject_id status_id]\n" +
 25654  			"                         └─ HashLookup\n" +
 25655  			"                             ├─ left-key: TUPLE(cc.movie_id:4)\n" +
 25656  			"                             ├─ right-key: TUPLE(ci.movie_id:11!null)\n" +
 25657  			"                             └─ HashJoin\n" +
 25658  			"                                 ├─ Eq\n" +
 25659  			"                                 │   ├─ mi.movie_id:7!null\n" +
 25660  			"                                 │   └─ mi_idx.movie_id:24!null\n" +
 25661  			"                                 ├─ InnerJoin\n" +
 25662  			"                                 │   ├─ Eq\n" +
 25663  			"                                 │   │   ├─ it1.id:10!null\n" +
 25664  			"                                 │   │   └─ mi.info_type_id:8!null\n" +
 25665  			"                                 │   ├─ Filter\n" +
 25666  			"                                 │   │   ├─ HashIn\n" +
 25667  			"                                 │   │   │   ├─ mi.info:2!null\n" +
 25668  			"                                 │   │   │   └─ TUPLE(Horror (longtext), Action (longtext), Sci-Fi (longtext), Thriller (longtext), Crime (longtext), War (longtext))\n" +
 25669  			"                                 │   │   └─ TableAlias(mi)\n" +
 25670  			"                                 │   │       └─ ProcessTable\n" +
 25671  			"                                 │   │           └─ Table\n" +
 25672  			"                                 │   │               ├─ name: movie_info\n" +
 25673  			"                                 │   │               └─ columns: [movie_id info_type_id info]\n" +
 25674  			"                                 │   └─ Filter\n" +
 25675  			"                                 │       ├─ Eq\n" +
 25676  			"                                 │       │   ├─ it1.info:1!null\n" +
 25677  			"                                 │       │   └─ genres (longtext)\n" +
 25678  			"                                 │       └─ TableAlias(it1)\n" +
 25679  			"                                 │           └─ ProcessTable\n" +
 25680  			"                                 │               └─ Table\n" +
 25681  			"                                 │                   ├─ name: info_type\n" +
 25682  			"                                 │                   └─ columns: [id info]\n" +
 25683  			"                                 └─ HashLookup\n" +
 25684  			"                                     ├─ left-key: TUPLE(mi.movie_id:7!null)\n" +
 25685  			"                                     ├─ right-key: TUPLE(mi_idx.movie_id:12!null)\n" +
 25686  			"                                     └─ HashJoin\n" +
 25687  			"                                         ├─ Eq\n" +
 25688  			"                                         │   ├─ mi_idx.movie_id:24!null\n" +
 25689  			"                                         │   └─ mk.movie_id:20!null\n" +
 25690  			"                                         ├─ InnerJoin\n" +
 25691  			"                                         │   ├─ Eq\n" +
 25692  			"                                         │   │   ├─ t.id:12!null\n" +
 25693  			"                                         │   │   └─ mk.movie_id:20!null\n" +
 25694  			"                                         │   ├─ InnerJoin\n" +
 25695  			"                                         │   │   ├─ Eq\n" +
 25696  			"                                         │   │   │   ├─ t.id:12!null\n" +
 25697  			"                                         │   │   │   └─ ci.movie_id:18!null\n" +
 25698  			"                                         │   │   ├─ TableAlias(t)\n" +
 25699  			"                                         │   │   │   └─ ProcessTable\n" +
 25700  			"                                         │   │   │       └─ Table\n" +
 25701  			"                                         │   │   │           ├─ name: title\n" +
 25702  			"                                         │   │   │           └─ columns: [id title]\n" +
 25703  			"                                         │   │   └─ InnerJoin\n" +
 25704  			"                                         │   │       ├─ Eq\n" +
 25705  			"                                         │   │       │   ├─ n.id:14!null\n" +
 25706  			"                                         │   │       │   └─ ci.person_id:17!null\n" +
 25707  			"                                         │   │       ├─ Filter\n" +
 25708  			"                                         │   │       │   ├─ Eq\n" +
 25709  			"                                         │   │       │   │   ├─ n.gender:2\n" +
 25710  			"                                         │   │       │   │   └─ m (longtext)\n" +
 25711  			"                                         │   │       │   └─ TableAlias(n)\n" +
 25712  			"                                         │   │       │       └─ ProcessTable\n" +
 25713  			"                                         │   │       │           └─ Table\n" +
 25714  			"                                         │   │       │               ├─ name: name\n" +
 25715  			"                                         │   │       │               └─ columns: [id name gender]\n" +
 25716  			"                                         │   │       └─ Filter\n" +
 25717  			"                                         │   │           ├─ HashIn\n" +
 25718  			"                                         │   │           │   ├─ ci.note:2\n" +
 25719  			"                                         │   │           │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 25720  			"                                         │   │           └─ TableAlias(ci)\n" +
 25721  			"                                         │   │               └─ ProcessTable\n" +
 25722  			"                                         │   │                   └─ Table\n" +
 25723  			"                                         │   │                       ├─ name: cast_info\n" +
 25724  			"                                         │   │                       └─ columns: [person_id movie_id note]\n" +
 25725  			"                                         │   └─ InnerJoin\n" +
 25726  			"                                         │       ├─ Eq\n" +
 25727  			"                                         │       │   ├─ k.id:22!null\n" +
 25728  			"                                         │       │   └─ mk.keyword_id:21!null\n" +
 25729  			"                                         │       ├─ TableAlias(mk)\n" +
 25730  			"                                         │       │   └─ ProcessTable\n" +
 25731  			"                                         │       │       └─ Table\n" +
 25732  			"                                         │       │           ├─ name: movie_keyword\n" +
 25733  			"                                         │       │           └─ columns: [movie_id keyword_id]\n" +
 25734  			"                                         │       └─ Filter\n" +
 25735  			"                                         │           ├─ HashIn\n" +
 25736  			"                                         │           │   ├─ k.keyword:1!null\n" +
 25737  			"                                         │           │   └─ TUPLE(murder (longtext), violence (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext), hospital (longtext))\n" +
 25738  			"                                         │           └─ TableAlias(k)\n" +
 25739  			"                                         │               └─ ProcessTable\n" +
 25740  			"                                         │                   └─ Table\n" +
 25741  			"                                         │                       ├─ name: keyword\n" +
 25742  			"                                         │                       └─ columns: [id keyword]\n" +
 25743  			"                                         └─ HashLookup\n" +
 25744  			"                                             ├─ left-key: TUPLE(mk.movie_id:20!null)\n" +
 25745  			"                                             ├─ right-key: TUPLE(mi_idx.movie_id:0!null)\n" +
 25746  			"                                             └─ InnerJoin\n" +
 25747  			"                                                 ├─ Eq\n" +
 25748  			"                                                 │   ├─ it2.id:27!null\n" +
 25749  			"                                                 │   └─ mi_idx.info_type_id:25!null\n" +
 25750  			"                                                 ├─ TableAlias(mi_idx)\n" +
 25751  			"                                                 │   └─ ProcessTable\n" +
 25752  			"                                                 │       └─ Table\n" +
 25753  			"                                                 │           ├─ name: movie_info_idx\n" +
 25754  			"                                                 │           └─ columns: [movie_id info_type_id info]\n" +
 25755  			"                                                 └─ Filter\n" +
 25756  			"                                                     ├─ Eq\n" +
 25757  			"                                                     │   ├─ it2.info:1!null\n" +
 25758  			"                                                     │   └─ votes (longtext)\n" +
 25759  			"                                                     └─ TableAlias(it2)\n" +
 25760  			"                                                         └─ Table\n" +
 25761  			"                                                             ├─ name: info_type\n" +
 25762  			"                                                             ├─ columns: [id info]\n" +
 25763  			"                                                             ├─ colSet: (18,19)\n" +
 25764  			"                                                             └─ tableId: 6\n" +
 25765  			"",
 25766  		ExpectedEstimates: "Project\n" +
 25767  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as complete_violent_movie]\n" +
 25768  			" └─ GroupBy\n" +
 25769  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 25770  			"     ├─ Grouping()\n" +
 25771  			"     └─ HashJoin\n" +
 25772  			"         ├─ (cct1.id = cc.subject_id)\n" +
 25773  			"         ├─ Filter\n" +
 25774  			"         │   ├─ (cct1.kind = 'cast')\n" +
 25775  			"         │   └─ TableAlias(cct1)\n" +
 25776  			"         │       └─ Table\n" +
 25777  			"         │           ├─ name: comp_cast_type\n" +
 25778  			"         │           └─ columns: [id kind]\n" +
 25779  			"         └─ HashLookup\n" +
 25780  			"             ├─ left-key: (cct1.id)\n" +
 25781  			"             ├─ right-key: (cc.subject_id)\n" +
 25782  			"             └─ HashJoin\n" +
 25783  			"                 ├─ (cct2.id = cc.status_id)\n" +
 25784  			"                 ├─ Filter\n" +
 25785  			"                 │   ├─ (cct2.kind = 'complete+verified')\n" +
 25786  			"                 │   └─ TableAlias(cct2)\n" +
 25787  			"                 │       └─ Table\n" +
 25788  			"                 │           ├─ name: comp_cast_type\n" +
 25789  			"                 │           └─ columns: [id kind]\n" +
 25790  			"                 └─ HashLookup\n" +
 25791  			"                     ├─ left-key: (cct2.id)\n" +
 25792  			"                     ├─ right-key: (cc.status_id)\n" +
 25793  			"                     └─ HashJoin\n" +
 25794  			"                         ├─ (ci.movie_id = cc.movie_id)\n" +
 25795  			"                         ├─ TableAlias(cc)\n" +
 25796  			"                         │   └─ Table\n" +
 25797  			"                         │       ├─ name: complete_cast\n" +
 25798  			"                         │       └─ columns: [movie_id subject_id status_id]\n" +
 25799  			"                         └─ HashLookup\n" +
 25800  			"                             ├─ left-key: (cc.movie_id)\n" +
 25801  			"                             ├─ right-key: (ci.movie_id)\n" +
 25802  			"                             └─ HashJoin\n" +
 25803  			"                                 ├─ (mi.movie_id = mi_idx.movie_id)\n" +
 25804  			"                                 ├─ InnerJoin\n" +
 25805  			"                                 │   ├─ (it1.id = mi.info_type_id)\n" +
 25806  			"                                 │   ├─ Filter\n" +
 25807  			"                                 │   │   ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
 25808  			"                                 │   │   └─ TableAlias(mi)\n" +
 25809  			"                                 │   │       └─ Table\n" +
 25810  			"                                 │   │           ├─ name: movie_info\n" +
 25811  			"                                 │   │           └─ columns: [movie_id info_type_id info]\n" +
 25812  			"                                 │   └─ Filter\n" +
 25813  			"                                 │       ├─ (it1.info = 'genres')\n" +
 25814  			"                                 │       └─ TableAlias(it1)\n" +
 25815  			"                                 │           └─ Table\n" +
 25816  			"                                 │               ├─ name: info_type\n" +
 25817  			"                                 │               └─ columns: [id info]\n" +
 25818  			"                                 └─ HashLookup\n" +
 25819  			"                                     ├─ left-key: (mi.movie_id)\n" +
 25820  			"                                     ├─ right-key: (mi_idx.movie_id)\n" +
 25821  			"                                     └─ HashJoin\n" +
 25822  			"                                         ├─ (mi_idx.movie_id = mk.movie_id)\n" +
 25823  			"                                         ├─ InnerJoin\n" +
 25824  			"                                         │   ├─ (t.id = mk.movie_id)\n" +
 25825  			"                                         │   ├─ InnerJoin\n" +
 25826  			"                                         │   │   ├─ (t.id = ci.movie_id)\n" +
 25827  			"                                         │   │   ├─ TableAlias(t)\n" +
 25828  			"                                         │   │   │   └─ Table\n" +
 25829  			"                                         │   │   │       ├─ name: title\n" +
 25830  			"                                         │   │   │       └─ columns: [id title]\n" +
 25831  			"                                         │   │   └─ InnerJoin\n" +
 25832  			"                                         │   │       ├─ (n.id = ci.person_id)\n" +
 25833  			"                                         │   │       ├─ Filter\n" +
 25834  			"                                         │   │       │   ├─ (n.gender = 'm')\n" +
 25835  			"                                         │   │       │   └─ TableAlias(n)\n" +
 25836  			"                                         │   │       │       └─ Table\n" +
 25837  			"                                         │   │       │           ├─ name: name\n" +
 25838  			"                                         │   │       │           └─ columns: [id name gender]\n" +
 25839  			"                                         │   │       └─ Filter\n" +
 25840  			"                                         │   │           ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 25841  			"                                         │   │           └─ TableAlias(ci)\n" +
 25842  			"                                         │   │               └─ Table\n" +
 25843  			"                                         │   │                   ├─ name: cast_info\n" +
 25844  			"                                         │   │                   └─ columns: [person_id movie_id note]\n" +
 25845  			"                                         │   └─ InnerJoin\n" +
 25846  			"                                         │       ├─ (k.id = mk.keyword_id)\n" +
 25847  			"                                         │       ├─ TableAlias(mk)\n" +
 25848  			"                                         │       │   └─ Table\n" +
 25849  			"                                         │       │       ├─ name: movie_keyword\n" +
 25850  			"                                         │       │       └─ columns: [movie_id keyword_id]\n" +
 25851  			"                                         │       └─ Filter\n" +
 25852  			"                                         │           ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 25853  			"                                         │           └─ TableAlias(k)\n" +
 25854  			"                                         │               └─ Table\n" +
 25855  			"                                         │                   ├─ name: keyword\n" +
 25856  			"                                         │                   └─ columns: [id keyword]\n" +
 25857  			"                                         └─ HashLookup\n" +
 25858  			"                                             ├─ left-key: (mk.movie_id)\n" +
 25859  			"                                             ├─ right-key: (mi_idx.movie_id)\n" +
 25860  			"                                             └─ InnerJoin\n" +
 25861  			"                                                 ├─ (it2.id = mi_idx.info_type_id)\n" +
 25862  			"                                                 ├─ TableAlias(mi_idx)\n" +
 25863  			"                                                 │   └─ Table\n" +
 25864  			"                                                 │       ├─ name: movie_info_idx\n" +
 25865  			"                                                 │       └─ columns: [movie_id info_type_id info]\n" +
 25866  			"                                                 └─ Filter\n" +
 25867  			"                                                     ├─ (it2.info = 'votes')\n" +
 25868  			"                                                     └─ TableAlias(it2)\n" +
 25869  			"                                                         └─ Table\n" +
 25870  			"                                                             ├─ name: info_type\n" +
 25871  			"                                                             └─ columns: [id info]\n" +
 25872  			"",
 25873  		ExpectedAnalysis: "Project\n" +
 25874  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as complete_violent_movie]\n" +
 25875  			" └─ GroupBy\n" +
 25876  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 25877  			"     ├─ Grouping()\n" +
 25878  			"     └─ HashJoin\n" +
 25879  			"         ├─ (cct1.id = cc.subject_id)\n" +
 25880  			"         ├─ Filter\n" +
 25881  			"         │   ├─ (cct1.kind = 'cast')\n" +
 25882  			"         │   └─ TableAlias(cct1)\n" +
 25883  			"         │       └─ Table\n" +
 25884  			"         │           ├─ name: comp_cast_type\n" +
 25885  			"         │           └─ columns: [id kind]\n" +
 25886  			"         └─ HashLookup\n" +
 25887  			"             ├─ left-key: (cct1.id)\n" +
 25888  			"             ├─ right-key: (cc.subject_id)\n" +
 25889  			"             └─ HashJoin\n" +
 25890  			"                 ├─ (cct2.id = cc.status_id)\n" +
 25891  			"                 ├─ Filter\n" +
 25892  			"                 │   ├─ (cct2.kind = 'complete+verified')\n" +
 25893  			"                 │   └─ TableAlias(cct2)\n" +
 25894  			"                 │       └─ Table\n" +
 25895  			"                 │           ├─ name: comp_cast_type\n" +
 25896  			"                 │           └─ columns: [id kind]\n" +
 25897  			"                 └─ HashLookup\n" +
 25898  			"                     ├─ left-key: (cct2.id)\n" +
 25899  			"                     ├─ right-key: (cc.status_id)\n" +
 25900  			"                     └─ HashJoin\n" +
 25901  			"                         ├─ (ci.movie_id = cc.movie_id)\n" +
 25902  			"                         ├─ TableAlias(cc)\n" +
 25903  			"                         │   └─ Table\n" +
 25904  			"                         │       ├─ name: complete_cast\n" +
 25905  			"                         │       └─ columns: [movie_id subject_id status_id]\n" +
 25906  			"                         └─ HashLookup\n" +
 25907  			"                             ├─ left-key: (cc.movie_id)\n" +
 25908  			"                             ├─ right-key: (ci.movie_id)\n" +
 25909  			"                             └─ HashJoin\n" +
 25910  			"                                 ├─ (mi.movie_id = mi_idx.movie_id)\n" +
 25911  			"                                 ├─ InnerJoin\n" +
 25912  			"                                 │   ├─ (it1.id = mi.info_type_id)\n" +
 25913  			"                                 │   ├─ Filter\n" +
 25914  			"                                 │   │   ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
 25915  			"                                 │   │   └─ TableAlias(mi)\n" +
 25916  			"                                 │   │       └─ Table\n" +
 25917  			"                                 │   │           ├─ name: movie_info\n" +
 25918  			"                                 │   │           └─ columns: [movie_id info_type_id info]\n" +
 25919  			"                                 │   └─ Filter\n" +
 25920  			"                                 │       ├─ (it1.info = 'genres')\n" +
 25921  			"                                 │       └─ TableAlias(it1)\n" +
 25922  			"                                 │           └─ Table\n" +
 25923  			"                                 │               ├─ name: info_type\n" +
 25924  			"                                 │               └─ columns: [id info]\n" +
 25925  			"                                 └─ HashLookup\n" +
 25926  			"                                     ├─ left-key: (mi.movie_id)\n" +
 25927  			"                                     ├─ right-key: (mi_idx.movie_id)\n" +
 25928  			"                                     └─ HashJoin\n" +
 25929  			"                                         ├─ (mi_idx.movie_id = mk.movie_id)\n" +
 25930  			"                                         ├─ InnerJoin\n" +
 25931  			"                                         │   ├─ (t.id = mk.movie_id)\n" +
 25932  			"                                         │   ├─ InnerJoin\n" +
 25933  			"                                         │   │   ├─ (t.id = ci.movie_id)\n" +
 25934  			"                                         │   │   ├─ TableAlias(t)\n" +
 25935  			"                                         │   │   │   └─ Table\n" +
 25936  			"                                         │   │   │       ├─ name: title\n" +
 25937  			"                                         │   │   │       └─ columns: [id title]\n" +
 25938  			"                                         │   │   └─ InnerJoin\n" +
 25939  			"                                         │   │       ├─ (n.id = ci.person_id)\n" +
 25940  			"                                         │   │       ├─ Filter\n" +
 25941  			"                                         │   │       │   ├─ (n.gender = 'm')\n" +
 25942  			"                                         │   │       │   └─ TableAlias(n)\n" +
 25943  			"                                         │   │       │       └─ Table\n" +
 25944  			"                                         │   │       │           ├─ name: name\n" +
 25945  			"                                         │   │       │           └─ columns: [id name gender]\n" +
 25946  			"                                         │   │       └─ Filter\n" +
 25947  			"                                         │   │           ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 25948  			"                                         │   │           └─ TableAlias(ci)\n" +
 25949  			"                                         │   │               └─ Table\n" +
 25950  			"                                         │   │                   ├─ name: cast_info\n" +
 25951  			"                                         │   │                   └─ columns: [person_id movie_id note]\n" +
 25952  			"                                         │   └─ InnerJoin\n" +
 25953  			"                                         │       ├─ (k.id = mk.keyword_id)\n" +
 25954  			"                                         │       ├─ TableAlias(mk)\n" +
 25955  			"                                         │       │   └─ Table\n" +
 25956  			"                                         │       │       ├─ name: movie_keyword\n" +
 25957  			"                                         │       │       └─ columns: [movie_id keyword_id]\n" +
 25958  			"                                         │       └─ Filter\n" +
 25959  			"                                         │           ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 25960  			"                                         │           └─ TableAlias(k)\n" +
 25961  			"                                         │               └─ Table\n" +
 25962  			"                                         │                   ├─ name: keyword\n" +
 25963  			"                                         │                   └─ columns: [id keyword]\n" +
 25964  			"                                         └─ HashLookup\n" +
 25965  			"                                             ├─ left-key: (mk.movie_id)\n" +
 25966  			"                                             ├─ right-key: (mi_idx.movie_id)\n" +
 25967  			"                                             └─ InnerJoin\n" +
 25968  			"                                                 ├─ (it2.id = mi_idx.info_type_id)\n" +
 25969  			"                                                 ├─ TableAlias(mi_idx)\n" +
 25970  			"                                                 │   └─ Table\n" +
 25971  			"                                                 │       ├─ name: movie_info_idx\n" +
 25972  			"                                                 │       └─ columns: [movie_id info_type_id info]\n" +
 25973  			"                                                 └─ Filter\n" +
 25974  			"                                                     ├─ (it2.info = 'votes')\n" +
 25975  			"                                                     └─ TableAlias(it2)\n" +
 25976  			"                                                         └─ Table\n" +
 25977  			"                                                             ├─ name: info_type\n" +
 25978  			"                                                             └─ columns: [id info]\n" +
 25979  			"",
 25980  	},
 25981  	{
 25982  		Query: `
 25983  SELECT MIN(mi.info) AS movie_budget,
 25984         MIN(mi_idx.info) AS movie_votes,
 25985         MIN(n.name) AS writer,
 25986         MIN(t.title) AS violent_liongate_movie
 25987  FROM cast_info AS ci,
 25988       company_name AS cn,
 25989       info_type AS it1,
 25990       info_type AS it2,
 25991       keyword AS k,
 25992       movie_companies AS mc,
 25993       movie_info AS mi,
 25994       movie_info_idx AS mi_idx,
 25995       movie_keyword AS mk,
 25996       name AS n,
 25997       title AS t
 25998  WHERE ci.note IN ('(writer)',
 25999                    '(head writer)',
 26000                    '(written by)',
 26001                    '(story)',
 26002                    '(story editor)')
 26003    AND cn.name LIKE 'Lionsgate%'
 26004    AND it1.info = 'genres'
 26005    AND it2.info = 'votes'
 26006    AND k.keyword IN ('murder',
 26007                      'violence',
 26008                      'blood',
 26009                      'gore',
 26010                      'death',
 26011                      'female-nudity',
 26012                      'hospital')
 26013    AND mi.info IN ('Horror',
 26014                    'Thriller')
 26015    AND n.gender = 'm'
 26016    AND t.id = mi.movie_id
 26017    AND t.id = mi_idx.movie_id
 26018    AND t.id = ci.movie_id
 26019    AND t.id = mk.movie_id
 26020    AND t.id = mc.movie_id
 26021    AND ci.movie_id = mi.movie_id
 26022    AND ci.movie_id = mi_idx.movie_id
 26023    AND ci.movie_id = mk.movie_id
 26024    AND ci.movie_id = mc.movie_id
 26025    AND mi.movie_id = mi_idx.movie_id
 26026    AND mi.movie_id = mk.movie_id
 26027    AND mi.movie_id = mc.movie_id
 26028    AND mi_idx.movie_id = mk.movie_id
 26029    AND mi_idx.movie_id = mc.movie_id
 26030    AND mk.movie_id = mc.movie_id
 26031    AND n.id = ci.person_id
 26032    AND it1.id = mi.info_type_id
 26033    AND it2.id = mi_idx.info_type_id
 26034    AND k.id = mk.keyword_id
 26035    AND cn.id = mc.company_id;
 26036  
 26037  `,
 26038  		ExpectedPlan: "Project\n" +
 26039  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as writer, min(t.title):3!null as violent_liongate_movie]\n" +
 26040  			" └─ GroupBy\n" +
 26041  			"     ├─ select: MIN(mi.info:4!null), MIN(mi_idx.info:9!null), MIN(n.name:22!null), MIN(t.title:25!null)\n" +
 26042  			"     ├─ group: \n" +
 26043  			"     └─ HashJoin\n" +
 26044  			"         ├─ AND\n" +
 26045  			"         │   ├─ AND\n" +
 26046  			"         │   │   ├─ AND\n" +
 26047  			"         │   │   │   ├─ AND\n" +
 26048  			"         │   │   │   │   ├─ Eq\n" +
 26049  			"         │   │   │   │   │   ├─ t.id:24!null\n" +
 26050  			"         │   │   │   │   │   └─ mi.movie_id:2!null\n" +
 26051  			"         │   │   │   │   └─ Eq\n" +
 26052  			"         │   │   │   │       ├─ t.id:24!null\n" +
 26053  			"         │   │   │   │       └─ mi_idx.movie_id:7!null\n" +
 26054  			"         │   │   │   └─ Eq\n" +
 26055  			"         │   │   │       ├─ t.id:24!null\n" +
 26056  			"         │   │   │       └─ ci.movie_id:19!null\n" +
 26057  			"         │   │   └─ Eq\n" +
 26058  			"         │   │       ├─ t.id:24!null\n" +
 26059  			"         │   │       └─ mk.movie_id:14!null\n" +
 26060  			"         │   └─ Eq\n" +
 26061  			"         │       ├─ t.id:24!null\n" +
 26062  			"         │       └─ mc.movie_id:16!null\n" +
 26063  			"         ├─ HashJoin\n" +
 26064  			"         │   ├─ Eq\n" +
 26065  			"         │   │   ├─ n.id:21!null\n" +
 26066  			"         │   │   └─ ci.person_id:18!null\n" +
 26067  			"         │   ├─ HashJoin\n" +
 26068  			"         │   │   ├─ Eq\n" +
 26069  			"         │   │   │   ├─ it2.id:0!null\n" +
 26070  			"         │   │   │   └─ mi_idx.info_type_id:8!null\n" +
 26071  			"         │   │   ├─ Filter\n" +
 26072  			"         │   │   │   ├─ Eq\n" +
 26073  			"         │   │   │   │   ├─ it2.info:1!null\n" +
 26074  			"         │   │   │   │   └─ votes (longtext)\n" +
 26075  			"         │   │   │   └─ TableAlias(it2)\n" +
 26076  			"         │   │   │       └─ ProcessTable\n" +
 26077  			"         │   │   │           └─ Table\n" +
 26078  			"         │   │   │               ├─ name: info_type\n" +
 26079  			"         │   │   │               └─ columns: [id info]\n" +
 26080  			"         │   │   └─ HashLookup\n" +
 26081  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
 26082  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:6!null)\n" +
 26083  			"         │   │       └─ HashJoin\n" +
 26084  			"         │   │           ├─ AND\n" +
 26085  			"         │   │           │   ├─ Eq\n" +
 26086  			"         │   │           │   │   ├─ mi.movie_id:2!null\n" +
 26087  			"         │   │           │   │   └─ mc.movie_id:16!null\n" +
 26088  			"         │   │           │   └─ Eq\n" +
 26089  			"         │   │           │       ├─ mi.movie_id:2!null\n" +
 26090  			"         │   │           │       └─ mi_idx.movie_id:7!null\n" +
 26091  			"         │   │           ├─ InnerJoin\n" +
 26092  			"         │   │           │   ├─ Eq\n" +
 26093  			"         │   │           │   │   ├─ it1.id:5!null\n" +
 26094  			"         │   │           │   │   └─ mi.info_type_id:3!null\n" +
 26095  			"         │   │           │   ├─ Filter\n" +
 26096  			"         │   │           │   │   ├─ HashIn\n" +
 26097  			"         │   │           │   │   │   ├─ mi.info:2!null\n" +
 26098  			"         │   │           │   │   │   └─ TUPLE(Horror (longtext), Thriller (longtext))\n" +
 26099  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 26100  			"         │   │           │   │       └─ ProcessTable\n" +
 26101  			"         │   │           │   │           └─ Table\n" +
 26102  			"         │   │           │   │               ├─ name: movie_info\n" +
 26103  			"         │   │           │   │               └─ columns: [movie_id info_type_id info]\n" +
 26104  			"         │   │           │   └─ Filter\n" +
 26105  			"         │   │           │       ├─ Eq\n" +
 26106  			"         │   │           │       │   ├─ it1.info:1!null\n" +
 26107  			"         │   │           │       │   └─ genres (longtext)\n" +
 26108  			"         │   │           │       └─ TableAlias(it1)\n" +
 26109  			"         │   │           │           └─ Table\n" +
 26110  			"         │   │           │               ├─ name: info_type\n" +
 26111  			"         │   │           │               ├─ columns: [id info]\n" +
 26112  			"         │   │           │               ├─ colSet: (15,16)\n" +
 26113  			"         │   │           │               └─ tableId: 3\n" +
 26114  			"         │   │           └─ HashLookup\n" +
 26115  			"         │   │               ├─ left-key: TUPLE(mi.movie_id:2!null, mi.movie_id:2!null)\n" +
 26116  			"         │   │               ├─ right-key: TUPLE(mc.movie_id:9!null, mi_idx.movie_id:0!null)\n" +
 26117  			"         │   │               └─ HashJoin\n" +
 26118  			"         │   │                   ├─ AND\n" +
 26119  			"         │   │                   │   ├─ Eq\n" +
 26120  			"         │   │                   │   │   ├─ mi_idx.movie_id:7!null\n" +
 26121  			"         │   │                   │   │   └─ mc.movie_id:16!null\n" +
 26122  			"         │   │                   │   └─ Eq\n" +
 26123  			"         │   │                   │       ├─ mi_idx.movie_id:7!null\n" +
 26124  			"         │   │                   │       └─ mk.movie_id:14!null\n" +
 26125  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 26126  			"         │   │                   │   └─ ProcessTable\n" +
 26127  			"         │   │                   │       └─ Table\n" +
 26128  			"         │   │                   │           ├─ name: movie_info_idx\n" +
 26129  			"         │   │                   │           └─ columns: [movie_id info_type_id info]\n" +
 26130  			"         │   │                   └─ HashLookup\n" +
 26131  			"         │   │                       ├─ left-key: TUPLE(mi_idx.movie_id:7!null, mi_idx.movie_id:7!null)\n" +
 26132  			"         │   │                       ├─ right-key: TUPLE(mc.movie_id:6!null, mk.movie_id:4!null)\n" +
 26133  			"         │   │                       └─ HashJoin\n" +
 26134  			"         │   │                           ├─ Eq\n" +
 26135  			"         │   │                           │   ├─ k.id:10!null\n" +
 26136  			"         │   │                           │   └─ mk.keyword_id:15!null\n" +
 26137  			"         │   │                           ├─ Filter\n" +
 26138  			"         │   │                           │   ├─ HashIn\n" +
 26139  			"         │   │                           │   │   ├─ k.keyword:1!null\n" +
 26140  			"         │   │                           │   │   └─ TUPLE(murder (longtext), violence (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext), hospital (longtext))\n" +
 26141  			"         │   │                           │   └─ TableAlias(k)\n" +
 26142  			"         │   │                           │       └─ ProcessTable\n" +
 26143  			"         │   │                           │           └─ Table\n" +
 26144  			"         │   │                           │               ├─ name: keyword\n" +
 26145  			"         │   │                           │               └─ columns: [id keyword]\n" +
 26146  			"         │   │                           └─ HashLookup\n" +
 26147  			"         │   │                               ├─ left-key: TUPLE(k.id:10!null)\n" +
 26148  			"         │   │                               ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
 26149  			"         │   │                               └─ HashJoin\n" +
 26150  			"         │   │                                   ├─ Eq\n" +
 26151  			"         │   │                                   │   ├─ cn.id:12!null\n" +
 26152  			"         │   │                                   │   └─ mc.company_id:17!null\n" +
 26153  			"         │   │                                   ├─ Filter\n" +
 26154  			"         │   │                                   │   ├─ AND\n" +
 26155  			"         │   │                                   │   │   ├─ GreaterThanOrEqual\n" +
 26156  			"         │   │                                   │   │   │   ├─ cn.name:1!null\n" +
 26157  			"         │   │                                   │   │   │   └─ Lionsgate (longtext)\n" +
 26158  			"         │   │                                   │   │   └─ LessThanOrEqual\n" +
 26159  			"         │   │                                   │   │       ├─ cn.name:1!null\n" +
 26160  			"         │   │                                   │   │       └─ Lionsgateÿ (longtext)\n" +
 26161  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 26162  			"         │   │                                   │       └─ ProcessTable\n" +
 26163  			"         │   │                                   │           └─ Table\n" +
 26164  			"         │   │                                   │               ├─ name: company_name\n" +
 26165  			"         │   │                                   │               └─ columns: [id name]\n" +
 26166  			"         │   │                                   └─ HashLookup\n" +
 26167  			"         │   │                                       ├─ left-key: TUPLE(cn.id:12!null)\n" +
 26168  			"         │   │                                       ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
 26169  			"         │   │                                       └─ LookupJoin\n" +
 26170  			"         │   │                                           ├─ InnerJoin\n" +
 26171  			"         │   │                                           │   ├─ Eq\n" +
 26172  			"         │   │                                           │   │   ├─ mk.movie_id:14!null\n" +
 26173  			"         │   │                                           │   │   └─ mc.movie_id:16!null\n" +
 26174  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 26175  			"         │   │                                           │   │   └─ ProcessTable\n" +
 26176  			"         │   │                                           │   │       └─ Table\n" +
 26177  			"         │   │                                           │   │           ├─ name: movie_keyword\n" +
 26178  			"         │   │                                           │   │           └─ columns: [movie_id keyword_id]\n" +
 26179  			"         │   │                                           │   └─ TableAlias(mc)\n" +
 26180  			"         │   │                                           │       └─ ProcessTable\n" +
 26181  			"         │   │                                           │           └─ Table\n" +
 26182  			"         │   │                                           │               ├─ name: movie_companies\n" +
 26183  			"         │   │                                           │               └─ columns: [movie_id company_id]\n" +
 26184  			"         │   │                                           └─ Filter\n" +
 26185  			"         │   │                                               ├─ HashIn\n" +
 26186  			"         │   │                                               │   ├─ ci.note:2\n" +
 26187  			"         │   │                                               │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 26188  			"         │   │                                               └─ TableAlias(ci)\n" +
 26189  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 26190  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 26191  			"         │   │                                                       ├─ keys: [mc.movie_id:16!null]\n" +
 26192  			"         │   │                                                       ├─ colSet: (1-7)\n" +
 26193  			"         │   │                                                       ├─ tableId: 1\n" +
 26194  			"         │   │                                                       └─ Table\n" +
 26195  			"         │   │                                                           ├─ name: cast_info\n" +
 26196  			"         │   │                                                           └─ columns: [person_id movie_id note]\n" +
 26197  			"         │   └─ HashLookup\n" +
 26198  			"         │       ├─ left-key: TUPLE(ci.person_id:18!null)\n" +
 26199  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
 26200  			"         │       └─ Filter\n" +
 26201  			"         │           ├─ Eq\n" +
 26202  			"         │           │   ├─ n.gender:2\n" +
 26203  			"         │           │   └─ m (longtext)\n" +
 26204  			"         │           └─ TableAlias(n)\n" +
 26205  			"         │               └─ ProcessTable\n" +
 26206  			"         │                   └─ Table\n" +
 26207  			"         │                       ├─ name: name\n" +
 26208  			"         │                       └─ columns: [id name gender]\n" +
 26209  			"         └─ HashLookup\n" +
 26210  			"             ├─ left-key: TUPLE(mi.movie_id:2!null, mi_idx.movie_id:7!null, ci.movie_id:19!null, mk.movie_id:14!null, mc.movie_id:16!null)\n" +
 26211  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 26212  			"             └─ TableAlias(t)\n" +
 26213  			"                 └─ ProcessTable\n" +
 26214  			"                     └─ Table\n" +
 26215  			"                         ├─ name: title\n" +
 26216  			"                         └─ columns: [id title]\n" +
 26217  			"",
 26218  		ExpectedEstimates: "Project\n" +
 26219  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as violent_liongate_movie]\n" +
 26220  			" └─ GroupBy\n" +
 26221  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 26222  			"     ├─ Grouping()\n" +
 26223  			"     └─ HashJoin\n" +
 26224  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
 26225  			"         ├─ HashJoin\n" +
 26226  			"         │   ├─ (n.id = ci.person_id)\n" +
 26227  			"         │   ├─ HashJoin\n" +
 26228  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 26229  			"         │   │   ├─ Filter\n" +
 26230  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 26231  			"         │   │   │   └─ TableAlias(it2)\n" +
 26232  			"         │   │   │       └─ Table\n" +
 26233  			"         │   │   │           ├─ name: info_type\n" +
 26234  			"         │   │   │           └─ columns: [id info]\n" +
 26235  			"         │   │   └─ HashLookup\n" +
 26236  			"         │   │       ├─ left-key: (it2.id)\n" +
 26237  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 26238  			"         │   │       └─ HashJoin\n" +
 26239  			"         │   │           ├─ ((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id))\n" +
 26240  			"         │   │           ├─ InnerJoin\n" +
 26241  			"         │   │           │   ├─ (it1.id = mi.info_type_id)\n" +
 26242  			"         │   │           │   ├─ Filter\n" +
 26243  			"         │   │           │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 26244  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 26245  			"         │   │           │   │       └─ Table\n" +
 26246  			"         │   │           │   │           ├─ name: movie_info\n" +
 26247  			"         │   │           │   │           └─ columns: [movie_id info_type_id info]\n" +
 26248  			"         │   │           │   └─ Filter\n" +
 26249  			"         │   │           │       ├─ (it1.info = 'genres')\n" +
 26250  			"         │   │           │       └─ TableAlias(it1)\n" +
 26251  			"         │   │           │           └─ Table\n" +
 26252  			"         │   │           │               ├─ name: info_type\n" +
 26253  			"         │   │           │               └─ columns: [id info]\n" +
 26254  			"         │   │           └─ HashLookup\n" +
 26255  			"         │   │               ├─ left-key: (mi.movie_id, mi.movie_id)\n" +
 26256  			"         │   │               ├─ right-key: (mc.movie_id, mi_idx.movie_id)\n" +
 26257  			"         │   │               └─ HashJoin\n" +
 26258  			"         │   │                   ├─ ((mi_idx.movie_id = mc.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 26259  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 26260  			"         │   │                   │   └─ Table\n" +
 26261  			"         │   │                   │       ├─ name: movie_info_idx\n" +
 26262  			"         │   │                   │       └─ columns: [movie_id info_type_id info]\n" +
 26263  			"         │   │                   └─ HashLookup\n" +
 26264  			"         │   │                       ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 26265  			"         │   │                       ├─ right-key: (mc.movie_id, mk.movie_id)\n" +
 26266  			"         │   │                       └─ HashJoin\n" +
 26267  			"         │   │                           ├─ (k.id = mk.keyword_id)\n" +
 26268  			"         │   │                           ├─ Filter\n" +
 26269  			"         │   │                           │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 26270  			"         │   │                           │   └─ TableAlias(k)\n" +
 26271  			"         │   │                           │       └─ Table\n" +
 26272  			"         │   │                           │           ├─ name: keyword\n" +
 26273  			"         │   │                           │           └─ columns: [id keyword]\n" +
 26274  			"         │   │                           └─ HashLookup\n" +
 26275  			"         │   │                               ├─ left-key: (k.id)\n" +
 26276  			"         │   │                               ├─ right-key: (mk.keyword_id)\n" +
 26277  			"         │   │                               └─ HashJoin\n" +
 26278  			"         │   │                                   ├─ (cn.id = mc.company_id)\n" +
 26279  			"         │   │                                   ├─ Filter\n" +
 26280  			"         │   │                                   │   ├─ ((cn.name >= 'Lionsgate') AND (cn.name <= 'Lionsgateÿ'))\n" +
 26281  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 26282  			"         │   │                                   │       └─ Table\n" +
 26283  			"         │   │                                   │           ├─ name: company_name\n" +
 26284  			"         │   │                                   │           └─ columns: [id name]\n" +
 26285  			"         │   │                                   └─ HashLookup\n" +
 26286  			"         │   │                                       ├─ left-key: (cn.id)\n" +
 26287  			"         │   │                                       ├─ right-key: (mc.company_id)\n" +
 26288  			"         │   │                                       └─ LookupJoin\n" +
 26289  			"         │   │                                           ├─ InnerJoin\n" +
 26290  			"         │   │                                           │   ├─ (mk.movie_id = mc.movie_id)\n" +
 26291  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 26292  			"         │   │                                           │   │   └─ Table\n" +
 26293  			"         │   │                                           │   │       ├─ name: movie_keyword\n" +
 26294  			"         │   │                                           │   │       └─ columns: [movie_id keyword_id]\n" +
 26295  			"         │   │                                           │   └─ TableAlias(mc)\n" +
 26296  			"         │   │                                           │       └─ Table\n" +
 26297  			"         │   │                                           │           ├─ name: movie_companies\n" +
 26298  			"         │   │                                           │           └─ columns: [movie_id company_id]\n" +
 26299  			"         │   │                                           └─ Filter\n" +
 26300  			"         │   │                                               ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 26301  			"         │   │                                               └─ TableAlias(ci)\n" +
 26302  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 26303  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 26304  			"         │   │                                                       ├─ columns: [person_id movie_id note]\n" +
 26305  			"         │   │                                                       └─ keys: mc.movie_id\n" +
 26306  			"         │   └─ HashLookup\n" +
 26307  			"         │       ├─ left-key: (ci.person_id)\n" +
 26308  			"         │       ├─ right-key: (n.id)\n" +
 26309  			"         │       └─ Filter\n" +
 26310  			"         │           ├─ (n.gender = 'm')\n" +
 26311  			"         │           └─ TableAlias(n)\n" +
 26312  			"         │               └─ Table\n" +
 26313  			"         │                   ├─ name: name\n" +
 26314  			"         │                   └─ columns: [id name gender]\n" +
 26315  			"         └─ HashLookup\n" +
 26316  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id, mc.movie_id)\n" +
 26317  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 26318  			"             └─ TableAlias(t)\n" +
 26319  			"                 └─ Table\n" +
 26320  			"                     ├─ name: title\n" +
 26321  			"                     └─ columns: [id title]\n" +
 26322  			"",
 26323  		ExpectedAnalysis: "Project\n" +
 26324  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as violent_liongate_movie]\n" +
 26325  			" └─ GroupBy\n" +
 26326  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 26327  			"     ├─ Grouping()\n" +
 26328  			"     └─ HashJoin\n" +
 26329  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
 26330  			"         ├─ HashJoin\n" +
 26331  			"         │   ├─ (n.id = ci.person_id)\n" +
 26332  			"         │   ├─ HashJoin\n" +
 26333  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 26334  			"         │   │   ├─ Filter\n" +
 26335  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 26336  			"         │   │   │   └─ TableAlias(it2)\n" +
 26337  			"         │   │   │       └─ Table\n" +
 26338  			"         │   │   │           ├─ name: info_type\n" +
 26339  			"         │   │   │           └─ columns: [id info]\n" +
 26340  			"         │   │   └─ HashLookup\n" +
 26341  			"         │   │       ├─ left-key: (it2.id)\n" +
 26342  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 26343  			"         │   │       └─ HashJoin\n" +
 26344  			"         │   │           ├─ ((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id))\n" +
 26345  			"         │   │           ├─ InnerJoin\n" +
 26346  			"         │   │           │   ├─ (it1.id = mi.info_type_id)\n" +
 26347  			"         │   │           │   ├─ Filter\n" +
 26348  			"         │   │           │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 26349  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 26350  			"         │   │           │   │       └─ Table\n" +
 26351  			"         │   │           │   │           ├─ name: movie_info\n" +
 26352  			"         │   │           │   │           └─ columns: [movie_id info_type_id info]\n" +
 26353  			"         │   │           │   └─ Filter\n" +
 26354  			"         │   │           │       ├─ (it1.info = 'genres')\n" +
 26355  			"         │   │           │       └─ TableAlias(it1)\n" +
 26356  			"         │   │           │           └─ Table\n" +
 26357  			"         │   │           │               ├─ name: info_type\n" +
 26358  			"         │   │           │               └─ columns: [id info]\n" +
 26359  			"         │   │           └─ HashLookup\n" +
 26360  			"         │   │               ├─ left-key: (mi.movie_id, mi.movie_id)\n" +
 26361  			"         │   │               ├─ right-key: (mc.movie_id, mi_idx.movie_id)\n" +
 26362  			"         │   │               └─ HashJoin\n" +
 26363  			"         │   │                   ├─ ((mi_idx.movie_id = mc.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 26364  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 26365  			"         │   │                   │   └─ Table\n" +
 26366  			"         │   │                   │       ├─ name: movie_info_idx\n" +
 26367  			"         │   │                   │       └─ columns: [movie_id info_type_id info]\n" +
 26368  			"         │   │                   └─ HashLookup\n" +
 26369  			"         │   │                       ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 26370  			"         │   │                       ├─ right-key: (mc.movie_id, mk.movie_id)\n" +
 26371  			"         │   │                       └─ HashJoin\n" +
 26372  			"         │   │                           ├─ (k.id = mk.keyword_id)\n" +
 26373  			"         │   │                           ├─ Filter\n" +
 26374  			"         │   │                           │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 26375  			"         │   │                           │   └─ TableAlias(k)\n" +
 26376  			"         │   │                           │       └─ Table\n" +
 26377  			"         │   │                           │           ├─ name: keyword\n" +
 26378  			"         │   │                           │           └─ columns: [id keyword]\n" +
 26379  			"         │   │                           └─ HashLookup\n" +
 26380  			"         │   │                               ├─ left-key: (k.id)\n" +
 26381  			"         │   │                               ├─ right-key: (mk.keyword_id)\n" +
 26382  			"         │   │                               └─ HashJoin\n" +
 26383  			"         │   │                                   ├─ (cn.id = mc.company_id)\n" +
 26384  			"         │   │                                   ├─ Filter\n" +
 26385  			"         │   │                                   │   ├─ ((cn.name >= 'Lionsgate') AND (cn.name <= 'Lionsgateÿ'))\n" +
 26386  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 26387  			"         │   │                                   │       └─ Table\n" +
 26388  			"         │   │                                   │           ├─ name: company_name\n" +
 26389  			"         │   │                                   │           └─ columns: [id name]\n" +
 26390  			"         │   │                                   └─ HashLookup\n" +
 26391  			"         │   │                                       ├─ left-key: (cn.id)\n" +
 26392  			"         │   │                                       ├─ right-key: (mc.company_id)\n" +
 26393  			"         │   │                                       └─ LookupJoin\n" +
 26394  			"         │   │                                           ├─ InnerJoin\n" +
 26395  			"         │   │                                           │   ├─ (mk.movie_id = mc.movie_id)\n" +
 26396  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 26397  			"         │   │                                           │   │   └─ Table\n" +
 26398  			"         │   │                                           │   │       ├─ name: movie_keyword\n" +
 26399  			"         │   │                                           │   │       └─ columns: [movie_id keyword_id]\n" +
 26400  			"         │   │                                           │   └─ TableAlias(mc)\n" +
 26401  			"         │   │                                           │       └─ Table\n" +
 26402  			"         │   │                                           │           ├─ name: movie_companies\n" +
 26403  			"         │   │                                           │           └─ columns: [movie_id company_id]\n" +
 26404  			"         │   │                                           └─ Filter\n" +
 26405  			"         │   │                                               ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 26406  			"         │   │                                               └─ TableAlias(ci)\n" +
 26407  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 26408  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 26409  			"         │   │                                                       ├─ columns: [person_id movie_id note]\n" +
 26410  			"         │   │                                                       └─ keys: mc.movie_id\n" +
 26411  			"         │   └─ HashLookup\n" +
 26412  			"         │       ├─ left-key: (ci.person_id)\n" +
 26413  			"         │       ├─ right-key: (n.id)\n" +
 26414  			"         │       └─ Filter\n" +
 26415  			"         │           ├─ (n.gender = 'm')\n" +
 26416  			"         │           └─ TableAlias(n)\n" +
 26417  			"         │               └─ Table\n" +
 26418  			"         │                   ├─ name: name\n" +
 26419  			"         │                   └─ columns: [id name gender]\n" +
 26420  			"         └─ HashLookup\n" +
 26421  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id, mc.movie_id)\n" +
 26422  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 26423  			"             └─ TableAlias(t)\n" +
 26424  			"                 └─ Table\n" +
 26425  			"                     ├─ name: title\n" +
 26426  			"                     └─ columns: [id title]\n" +
 26427  			"",
 26428  	},
 26429  	{
 26430  		Query: `
 26431  SELECT MIN(mi.info) AS movie_budget,
 26432         MIN(mi_idx.info) AS movie_votes,
 26433         MIN(n.name) AS writer,
 26434         MIN(t.title) AS violent_liongate_movie
 26435  FROM cast_info AS ci,
 26436       company_name AS cn,
 26437       info_type AS it1,
 26438       info_type AS it2,
 26439       keyword AS k,
 26440       movie_companies AS mc,
 26441       movie_info AS mi,
 26442       movie_info_idx AS mi_idx,
 26443       movie_keyword AS mk,
 26444       name AS n,
 26445       title AS t
 26446  WHERE ci.note IN ('(writer)',
 26447                    '(head writer)',
 26448                    '(written by)',
 26449                    '(story)',
 26450                    '(story editor)')
 26451    AND cn.name LIKE 'Lionsgate%'
 26452    AND it1.info = 'genres'
 26453    AND it2.info = 'votes'
 26454    AND k.keyword IN ('murder',
 26455                      'violence',
 26456                      'blood',
 26457                      'gore',
 26458                      'death',
 26459                      'female-nudity',
 26460                      'hospital')
 26461    AND mc.note LIKE '%(Blu-ray)%'
 26462    AND mi.info IN ('Horror',
 26463                    'Thriller')
 26464    AND n.gender = 'm'
 26465    AND t.production_year > 2000
 26466    AND (t.title LIKE '%Freddy%'
 26467         OR t.title LIKE '%Jason%'
 26468         OR t.title LIKE 'Saw%')
 26469    AND t.id = mi.movie_id
 26470    AND t.id = mi_idx.movie_id
 26471    AND t.id = ci.movie_id
 26472    AND t.id = mk.movie_id
 26473    AND t.id = mc.movie_id
 26474    AND ci.movie_id = mi.movie_id
 26475    AND ci.movie_id = mi_idx.movie_id
 26476    AND ci.movie_id = mk.movie_id
 26477    AND ci.movie_id = mc.movie_id
 26478    AND mi.movie_id = mi_idx.movie_id
 26479    AND mi.movie_id = mk.movie_id
 26480    AND mi.movie_id = mc.movie_id
 26481    AND mi_idx.movie_id = mk.movie_id
 26482    AND mi_idx.movie_id = mc.movie_id
 26483    AND mk.movie_id = mc.movie_id
 26484    AND n.id = ci.person_id
 26485    AND it1.id = mi.info_type_id
 26486    AND it2.id = mi_idx.info_type_id
 26487    AND k.id = mk.keyword_id
 26488    AND cn.id = mc.company_id;
 26489  
 26490  `,
 26491  		ExpectedPlan: "Project\n" +
 26492  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as writer, min(t.title):3!null as violent_liongate_movie]\n" +
 26493  			" └─ GroupBy\n" +
 26494  			"     ├─ select: MIN(mi.info:4!null), MIN(mi_idx.info:9!null), MIN(n.name:23!null), MIN(t.title:26!null)\n" +
 26495  			"     ├─ group: \n" +
 26496  			"     └─ HashJoin\n" +
 26497  			"         ├─ AND\n" +
 26498  			"         │   ├─ AND\n" +
 26499  			"         │   │   ├─ AND\n" +
 26500  			"         │   │   │   ├─ AND\n" +
 26501  			"         │   │   │   │   ├─ Eq\n" +
 26502  			"         │   │   │   │   │   ├─ t.id:25!null\n" +
 26503  			"         │   │   │   │   │   └─ mi.movie_id:2!null\n" +
 26504  			"         │   │   │   │   └─ Eq\n" +
 26505  			"         │   │   │   │       ├─ t.id:25!null\n" +
 26506  			"         │   │   │   │       └─ mi_idx.movie_id:7!null\n" +
 26507  			"         │   │   │   └─ Eq\n" +
 26508  			"         │   │   │       ├─ t.id:25!null\n" +
 26509  			"         │   │   │       └─ ci.movie_id:20!null\n" +
 26510  			"         │   │   └─ Eq\n" +
 26511  			"         │   │       ├─ t.id:25!null\n" +
 26512  			"         │   │       └─ mk.movie_id:14!null\n" +
 26513  			"         │   └─ Eq\n" +
 26514  			"         │       ├─ t.id:25!null\n" +
 26515  			"         │       └─ mc.movie_id:16!null\n" +
 26516  			"         ├─ HashJoin\n" +
 26517  			"         │   ├─ Eq\n" +
 26518  			"         │   │   ├─ n.id:22!null\n" +
 26519  			"         │   │   └─ ci.person_id:19!null\n" +
 26520  			"         │   ├─ HashJoin\n" +
 26521  			"         │   │   ├─ Eq\n" +
 26522  			"         │   │   │   ├─ it2.id:0!null\n" +
 26523  			"         │   │   │   └─ mi_idx.info_type_id:8!null\n" +
 26524  			"         │   │   ├─ Filter\n" +
 26525  			"         │   │   │   ├─ Eq\n" +
 26526  			"         │   │   │   │   ├─ it2.info:1!null\n" +
 26527  			"         │   │   │   │   └─ votes (longtext)\n" +
 26528  			"         │   │   │   └─ TableAlias(it2)\n" +
 26529  			"         │   │   │       └─ ProcessTable\n" +
 26530  			"         │   │   │           └─ Table\n" +
 26531  			"         │   │   │               ├─ name: info_type\n" +
 26532  			"         │   │   │               └─ columns: [id info]\n" +
 26533  			"         │   │   └─ HashLookup\n" +
 26534  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
 26535  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:6!null)\n" +
 26536  			"         │   │       └─ HashJoin\n" +
 26537  			"         │   │           ├─ AND\n" +
 26538  			"         │   │           │   ├─ Eq\n" +
 26539  			"         │   │           │   │   ├─ mi.movie_id:2!null\n" +
 26540  			"         │   │           │   │   └─ mc.movie_id:16!null\n" +
 26541  			"         │   │           │   └─ Eq\n" +
 26542  			"         │   │           │       ├─ mi.movie_id:2!null\n" +
 26543  			"         │   │           │       └─ mi_idx.movie_id:7!null\n" +
 26544  			"         │   │           ├─ InnerJoin\n" +
 26545  			"         │   │           │   ├─ Eq\n" +
 26546  			"         │   │           │   │   ├─ it1.id:5!null\n" +
 26547  			"         │   │           │   │   └─ mi.info_type_id:3!null\n" +
 26548  			"         │   │           │   ├─ Filter\n" +
 26549  			"         │   │           │   │   ├─ HashIn\n" +
 26550  			"         │   │           │   │   │   ├─ mi.info:2!null\n" +
 26551  			"         │   │           │   │   │   └─ TUPLE(Horror (longtext), Thriller (longtext))\n" +
 26552  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 26553  			"         │   │           │   │       └─ ProcessTable\n" +
 26554  			"         │   │           │   │           └─ Table\n" +
 26555  			"         │   │           │   │               ├─ name: movie_info\n" +
 26556  			"         │   │           │   │               └─ columns: [movie_id info_type_id info]\n" +
 26557  			"         │   │           │   └─ Filter\n" +
 26558  			"         │   │           │       ├─ Eq\n" +
 26559  			"         │   │           │       │   ├─ it1.info:1!null\n" +
 26560  			"         │   │           │       │   └─ genres (longtext)\n" +
 26561  			"         │   │           │       └─ TableAlias(it1)\n" +
 26562  			"         │   │           │           └─ Table\n" +
 26563  			"         │   │           │               ├─ name: info_type\n" +
 26564  			"         │   │           │               ├─ columns: [id info]\n" +
 26565  			"         │   │           │               ├─ colSet: (15,16)\n" +
 26566  			"         │   │           │               └─ tableId: 3\n" +
 26567  			"         │   │           └─ HashLookup\n" +
 26568  			"         │   │               ├─ left-key: TUPLE(mi.movie_id:2!null, mi.movie_id:2!null)\n" +
 26569  			"         │   │               ├─ right-key: TUPLE(mc.movie_id:9!null, mi_idx.movie_id:0!null)\n" +
 26570  			"         │   │               └─ HashJoin\n" +
 26571  			"         │   │                   ├─ AND\n" +
 26572  			"         │   │                   │   ├─ Eq\n" +
 26573  			"         │   │                   │   │   ├─ mi_idx.movie_id:7!null\n" +
 26574  			"         │   │                   │   │   └─ mc.movie_id:16!null\n" +
 26575  			"         │   │                   │   └─ Eq\n" +
 26576  			"         │   │                   │       ├─ mi_idx.movie_id:7!null\n" +
 26577  			"         │   │                   │       └─ mk.movie_id:14!null\n" +
 26578  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 26579  			"         │   │                   │   └─ ProcessTable\n" +
 26580  			"         │   │                   │       └─ Table\n" +
 26581  			"         │   │                   │           ├─ name: movie_info_idx\n" +
 26582  			"         │   │                   │           └─ columns: [movie_id info_type_id info]\n" +
 26583  			"         │   │                   └─ HashLookup\n" +
 26584  			"         │   │                       ├─ left-key: TUPLE(mi_idx.movie_id:7!null, mi_idx.movie_id:7!null)\n" +
 26585  			"         │   │                       ├─ right-key: TUPLE(mc.movie_id:6!null, mk.movie_id:4!null)\n" +
 26586  			"         │   │                       └─ HashJoin\n" +
 26587  			"         │   │                           ├─ Eq\n" +
 26588  			"         │   │                           │   ├─ k.id:10!null\n" +
 26589  			"         │   │                           │   └─ mk.keyword_id:15!null\n" +
 26590  			"         │   │                           ├─ Filter\n" +
 26591  			"         │   │                           │   ├─ HashIn\n" +
 26592  			"         │   │                           │   │   ├─ k.keyword:1!null\n" +
 26593  			"         │   │                           │   │   └─ TUPLE(murder (longtext), violence (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext), hospital (longtext))\n" +
 26594  			"         │   │                           │   └─ TableAlias(k)\n" +
 26595  			"         │   │                           │       └─ ProcessTable\n" +
 26596  			"         │   │                           │           └─ Table\n" +
 26597  			"         │   │                           │               ├─ name: keyword\n" +
 26598  			"         │   │                           │               └─ columns: [id keyword]\n" +
 26599  			"         │   │                           └─ HashLookup\n" +
 26600  			"         │   │                               ├─ left-key: TUPLE(k.id:10!null)\n" +
 26601  			"         │   │                               ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
 26602  			"         │   │                               └─ HashJoin\n" +
 26603  			"         │   │                                   ├─ Eq\n" +
 26604  			"         │   │                                   │   ├─ cn.id:12!null\n" +
 26605  			"         │   │                                   │   └─ mc.company_id:17!null\n" +
 26606  			"         │   │                                   ├─ Filter\n" +
 26607  			"         │   │                                   │   ├─ AND\n" +
 26608  			"         │   │                                   │   │   ├─ GreaterThanOrEqual\n" +
 26609  			"         │   │                                   │   │   │   ├─ cn.name:1!null\n" +
 26610  			"         │   │                                   │   │   │   └─ Lionsgate (longtext)\n" +
 26611  			"         │   │                                   │   │   └─ LessThanOrEqual\n" +
 26612  			"         │   │                                   │   │       ├─ cn.name:1!null\n" +
 26613  			"         │   │                                   │   │       └─ Lionsgateÿ (longtext)\n" +
 26614  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 26615  			"         │   │                                   │       └─ ProcessTable\n" +
 26616  			"         │   │                                   │           └─ Table\n" +
 26617  			"         │   │                                   │               ├─ name: company_name\n" +
 26618  			"         │   │                                   │               └─ columns: [id name]\n" +
 26619  			"         │   │                                   └─ HashLookup\n" +
 26620  			"         │   │                                       ├─ left-key: TUPLE(cn.id:12!null)\n" +
 26621  			"         │   │                                       ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
 26622  			"         │   │                                       └─ LookupJoin\n" +
 26623  			"         │   │                                           ├─ InnerJoin\n" +
 26624  			"         │   │                                           │   ├─ Eq\n" +
 26625  			"         │   │                                           │   │   ├─ mk.movie_id:14!null\n" +
 26626  			"         │   │                                           │   │   └─ mc.movie_id:16!null\n" +
 26627  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 26628  			"         │   │                                           │   │   └─ ProcessTable\n" +
 26629  			"         │   │                                           │   │       └─ Table\n" +
 26630  			"         │   │                                           │   │           ├─ name: movie_keyword\n" +
 26631  			"         │   │                                           │   │           └─ columns: [movie_id keyword_id]\n" +
 26632  			"         │   │                                           │   └─ Filter\n" +
 26633  			"         │   │                                           │       ├─ mc.note LIKE '%(Blu-ray)%'\n" +
 26634  			"         │   │                                           │       └─ TableAlias(mc)\n" +
 26635  			"         │   │                                           │           └─ ProcessTable\n" +
 26636  			"         │   │                                           │               └─ Table\n" +
 26637  			"         │   │                                           │                   ├─ name: movie_companies\n" +
 26638  			"         │   │                                           │                   └─ columns: [movie_id company_id note]\n" +
 26639  			"         │   │                                           └─ Filter\n" +
 26640  			"         │   │                                               ├─ HashIn\n" +
 26641  			"         │   │                                               │   ├─ ci.note:2\n" +
 26642  			"         │   │                                               │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 26643  			"         │   │                                               └─ TableAlias(ci)\n" +
 26644  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 26645  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 26646  			"         │   │                                                       ├─ keys: [mc.movie_id:16!null]\n" +
 26647  			"         │   │                                                       ├─ colSet: (1-7)\n" +
 26648  			"         │   │                                                       ├─ tableId: 1\n" +
 26649  			"         │   │                                                       └─ Table\n" +
 26650  			"         │   │                                                           ├─ name: cast_info\n" +
 26651  			"         │   │                                                           └─ columns: [person_id movie_id note]\n" +
 26652  			"         │   └─ HashLookup\n" +
 26653  			"         │       ├─ left-key: TUPLE(ci.person_id:19!null)\n" +
 26654  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
 26655  			"         │       └─ Filter\n" +
 26656  			"         │           ├─ Eq\n" +
 26657  			"         │           │   ├─ n.gender:2\n" +
 26658  			"         │           │   └─ m (longtext)\n" +
 26659  			"         │           └─ TableAlias(n)\n" +
 26660  			"         │               └─ ProcessTable\n" +
 26661  			"         │                   └─ Table\n" +
 26662  			"         │                       ├─ name: name\n" +
 26663  			"         │                       └─ columns: [id name gender]\n" +
 26664  			"         └─ HashLookup\n" +
 26665  			"             ├─ left-key: TUPLE(mi.movie_id:2!null, mi_idx.movie_id:7!null, ci.movie_id:20!null, mk.movie_id:14!null, mc.movie_id:16!null)\n" +
 26666  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 26667  			"             └─ Filter\n" +
 26668  			"                 ├─ AND\n" +
 26669  			"                 │   ├─ GreaterThan\n" +
 26670  			"                 │   │   ├─ t.production_year:2\n" +
 26671  			"                 │   │   └─ 2000 (smallint)\n" +
 26672  			"                 │   └─ Or\n" +
 26673  			"                 │       ├─ Or\n" +
 26674  			"                 │       │   ├─ t.title LIKE '%Freddy%'\n" +
 26675  			"                 │       │   └─ t.title LIKE '%Jason%'\n" +
 26676  			"                 │       └─ AND\n" +
 26677  			"                 │           ├─ GreaterThanOrEqual\n" +
 26678  			"                 │           │   ├─ t.title:1!null\n" +
 26679  			"                 │           │   └─ Saw (longtext)\n" +
 26680  			"                 │           └─ LessThanOrEqual\n" +
 26681  			"                 │               ├─ t.title:1!null\n" +
 26682  			"                 │               └─ Sawÿ (longtext)\n" +
 26683  			"                 └─ TableAlias(t)\n" +
 26684  			"                     └─ ProcessTable\n" +
 26685  			"                         └─ Table\n" +
 26686  			"                             ├─ name: title\n" +
 26687  			"                             └─ columns: [id title production_year]\n" +
 26688  			"",
 26689  		ExpectedEstimates: "Project\n" +
 26690  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as violent_liongate_movie]\n" +
 26691  			" └─ GroupBy\n" +
 26692  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 26693  			"     ├─ Grouping()\n" +
 26694  			"     └─ HashJoin\n" +
 26695  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
 26696  			"         ├─ HashJoin\n" +
 26697  			"         │   ├─ (n.id = ci.person_id)\n" +
 26698  			"         │   ├─ HashJoin\n" +
 26699  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 26700  			"         │   │   ├─ Filter\n" +
 26701  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 26702  			"         │   │   │   └─ TableAlias(it2)\n" +
 26703  			"         │   │   │       └─ Table\n" +
 26704  			"         │   │   │           ├─ name: info_type\n" +
 26705  			"         │   │   │           └─ columns: [id info]\n" +
 26706  			"         │   │   └─ HashLookup\n" +
 26707  			"         │   │       ├─ left-key: (it2.id)\n" +
 26708  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 26709  			"         │   │       └─ HashJoin\n" +
 26710  			"         │   │           ├─ ((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id))\n" +
 26711  			"         │   │           ├─ InnerJoin\n" +
 26712  			"         │   │           │   ├─ (it1.id = mi.info_type_id)\n" +
 26713  			"         │   │           │   ├─ Filter\n" +
 26714  			"         │   │           │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 26715  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 26716  			"         │   │           │   │       └─ Table\n" +
 26717  			"         │   │           │   │           ├─ name: movie_info\n" +
 26718  			"         │   │           │   │           └─ columns: [movie_id info_type_id info]\n" +
 26719  			"         │   │           │   └─ Filter\n" +
 26720  			"         │   │           │       ├─ (it1.info = 'genres')\n" +
 26721  			"         │   │           │       └─ TableAlias(it1)\n" +
 26722  			"         │   │           │           └─ Table\n" +
 26723  			"         │   │           │               ├─ name: info_type\n" +
 26724  			"         │   │           │               └─ columns: [id info]\n" +
 26725  			"         │   │           └─ HashLookup\n" +
 26726  			"         │   │               ├─ left-key: (mi.movie_id, mi.movie_id)\n" +
 26727  			"         │   │               ├─ right-key: (mc.movie_id, mi_idx.movie_id)\n" +
 26728  			"         │   │               └─ HashJoin\n" +
 26729  			"         │   │                   ├─ ((mi_idx.movie_id = mc.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 26730  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 26731  			"         │   │                   │   └─ Table\n" +
 26732  			"         │   │                   │       ├─ name: movie_info_idx\n" +
 26733  			"         │   │                   │       └─ columns: [movie_id info_type_id info]\n" +
 26734  			"         │   │                   └─ HashLookup\n" +
 26735  			"         │   │                       ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 26736  			"         │   │                       ├─ right-key: (mc.movie_id, mk.movie_id)\n" +
 26737  			"         │   │                       └─ HashJoin\n" +
 26738  			"         │   │                           ├─ (k.id = mk.keyword_id)\n" +
 26739  			"         │   │                           ├─ Filter\n" +
 26740  			"         │   │                           │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 26741  			"         │   │                           │   └─ TableAlias(k)\n" +
 26742  			"         │   │                           │       └─ Table\n" +
 26743  			"         │   │                           │           ├─ name: keyword\n" +
 26744  			"         │   │                           │           └─ columns: [id keyword]\n" +
 26745  			"         │   │                           └─ HashLookup\n" +
 26746  			"         │   │                               ├─ left-key: (k.id)\n" +
 26747  			"         │   │                               ├─ right-key: (mk.keyword_id)\n" +
 26748  			"         │   │                               └─ HashJoin\n" +
 26749  			"         │   │                                   ├─ (cn.id = mc.company_id)\n" +
 26750  			"         │   │                                   ├─ Filter\n" +
 26751  			"         │   │                                   │   ├─ ((cn.name >= 'Lionsgate') AND (cn.name <= 'Lionsgateÿ'))\n" +
 26752  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 26753  			"         │   │                                   │       └─ Table\n" +
 26754  			"         │   │                                   │           ├─ name: company_name\n" +
 26755  			"         │   │                                   │           └─ columns: [id name]\n" +
 26756  			"         │   │                                   └─ HashLookup\n" +
 26757  			"         │   │                                       ├─ left-key: (cn.id)\n" +
 26758  			"         │   │                                       ├─ right-key: (mc.company_id)\n" +
 26759  			"         │   │                                       └─ LookupJoin\n" +
 26760  			"         │   │                                           ├─ InnerJoin\n" +
 26761  			"         │   │                                           │   ├─ (mk.movie_id = mc.movie_id)\n" +
 26762  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 26763  			"         │   │                                           │   │   └─ Table\n" +
 26764  			"         │   │                                           │   │       ├─ name: movie_keyword\n" +
 26765  			"         │   │                                           │   │       └─ columns: [movie_id keyword_id]\n" +
 26766  			"         │   │                                           │   └─ Filter\n" +
 26767  			"         │   │                                           │       ├─ mc.note LIKE '%(Blu-ray)%'\n" +
 26768  			"         │   │                                           │       └─ TableAlias(mc)\n" +
 26769  			"         │   │                                           │           └─ Table\n" +
 26770  			"         │   │                                           │               ├─ name: movie_companies\n" +
 26771  			"         │   │                                           │               └─ columns: [movie_id company_id note]\n" +
 26772  			"         │   │                                           └─ Filter\n" +
 26773  			"         │   │                                               ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 26774  			"         │   │                                               └─ TableAlias(ci)\n" +
 26775  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 26776  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 26777  			"         │   │                                                       ├─ columns: [person_id movie_id note]\n" +
 26778  			"         │   │                                                       └─ keys: mc.movie_id\n" +
 26779  			"         │   └─ HashLookup\n" +
 26780  			"         │       ├─ left-key: (ci.person_id)\n" +
 26781  			"         │       ├─ right-key: (n.id)\n" +
 26782  			"         │       └─ Filter\n" +
 26783  			"         │           ├─ (n.gender = 'm')\n" +
 26784  			"         │           └─ TableAlias(n)\n" +
 26785  			"         │               └─ Table\n" +
 26786  			"         │                   ├─ name: name\n" +
 26787  			"         │                   └─ columns: [id name gender]\n" +
 26788  			"         └─ HashLookup\n" +
 26789  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id, mc.movie_id)\n" +
 26790  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 26791  			"             └─ Filter\n" +
 26792  			"                 ├─ ((t.production_year > 2000) AND ((t.title LIKE '%Freddy%' OR t.title LIKE '%Jason%') OR ((t.title >= 'Saw') AND (t.title <= 'Sawÿ'))))\n" +
 26793  			"                 └─ TableAlias(t)\n" +
 26794  			"                     └─ Table\n" +
 26795  			"                         ├─ name: title\n" +
 26796  			"                         └─ columns: [id title production_year]\n" +
 26797  			"",
 26798  		ExpectedAnalysis: "Project\n" +
 26799  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as violent_liongate_movie]\n" +
 26800  			" └─ GroupBy\n" +
 26801  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 26802  			"     ├─ Grouping()\n" +
 26803  			"     └─ HashJoin\n" +
 26804  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
 26805  			"         ├─ HashJoin\n" +
 26806  			"         │   ├─ (n.id = ci.person_id)\n" +
 26807  			"         │   ├─ HashJoin\n" +
 26808  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 26809  			"         │   │   ├─ Filter\n" +
 26810  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 26811  			"         │   │   │   └─ TableAlias(it2)\n" +
 26812  			"         │   │   │       └─ Table\n" +
 26813  			"         │   │   │           ├─ name: info_type\n" +
 26814  			"         │   │   │           └─ columns: [id info]\n" +
 26815  			"         │   │   └─ HashLookup\n" +
 26816  			"         │   │       ├─ left-key: (it2.id)\n" +
 26817  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 26818  			"         │   │       └─ HashJoin\n" +
 26819  			"         │   │           ├─ ((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id))\n" +
 26820  			"         │   │           ├─ InnerJoin\n" +
 26821  			"         │   │           │   ├─ (it1.id = mi.info_type_id)\n" +
 26822  			"         │   │           │   ├─ Filter\n" +
 26823  			"         │   │           │   │   ├─ (mi.info HASH IN ('Horror', 'Thriller'))\n" +
 26824  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 26825  			"         │   │           │   │       └─ Table\n" +
 26826  			"         │   │           │   │           ├─ name: movie_info\n" +
 26827  			"         │   │           │   │           └─ columns: [movie_id info_type_id info]\n" +
 26828  			"         │   │           │   └─ Filter\n" +
 26829  			"         │   │           │       ├─ (it1.info = 'genres')\n" +
 26830  			"         │   │           │       └─ TableAlias(it1)\n" +
 26831  			"         │   │           │           └─ Table\n" +
 26832  			"         │   │           │               ├─ name: info_type\n" +
 26833  			"         │   │           │               └─ columns: [id info]\n" +
 26834  			"         │   │           └─ HashLookup\n" +
 26835  			"         │   │               ├─ left-key: (mi.movie_id, mi.movie_id)\n" +
 26836  			"         │   │               ├─ right-key: (mc.movie_id, mi_idx.movie_id)\n" +
 26837  			"         │   │               └─ HashJoin\n" +
 26838  			"         │   │                   ├─ ((mi_idx.movie_id = mc.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 26839  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 26840  			"         │   │                   │   └─ Table\n" +
 26841  			"         │   │                   │       ├─ name: movie_info_idx\n" +
 26842  			"         │   │                   │       └─ columns: [movie_id info_type_id info]\n" +
 26843  			"         │   │                   └─ HashLookup\n" +
 26844  			"         │   │                       ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 26845  			"         │   │                       ├─ right-key: (mc.movie_id, mk.movie_id)\n" +
 26846  			"         │   │                       └─ HashJoin\n" +
 26847  			"         │   │                           ├─ (k.id = mk.keyword_id)\n" +
 26848  			"         │   │                           ├─ Filter\n" +
 26849  			"         │   │                           │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 26850  			"         │   │                           │   └─ TableAlias(k)\n" +
 26851  			"         │   │                           │       └─ Table\n" +
 26852  			"         │   │                           │           ├─ name: keyword\n" +
 26853  			"         │   │                           │           └─ columns: [id keyword]\n" +
 26854  			"         │   │                           └─ HashLookup\n" +
 26855  			"         │   │                               ├─ left-key: (k.id)\n" +
 26856  			"         │   │                               ├─ right-key: (mk.keyword_id)\n" +
 26857  			"         │   │                               └─ HashJoin\n" +
 26858  			"         │   │                                   ├─ (cn.id = mc.company_id)\n" +
 26859  			"         │   │                                   ├─ Filter\n" +
 26860  			"         │   │                                   │   ├─ ((cn.name >= 'Lionsgate') AND (cn.name <= 'Lionsgateÿ'))\n" +
 26861  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 26862  			"         │   │                                   │       └─ Table\n" +
 26863  			"         │   │                                   │           ├─ name: company_name\n" +
 26864  			"         │   │                                   │           └─ columns: [id name]\n" +
 26865  			"         │   │                                   └─ HashLookup\n" +
 26866  			"         │   │                                       ├─ left-key: (cn.id)\n" +
 26867  			"         │   │                                       ├─ right-key: (mc.company_id)\n" +
 26868  			"         │   │                                       └─ LookupJoin\n" +
 26869  			"         │   │                                           ├─ InnerJoin\n" +
 26870  			"         │   │                                           │   ├─ (mk.movie_id = mc.movie_id)\n" +
 26871  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 26872  			"         │   │                                           │   │   └─ Table\n" +
 26873  			"         │   │                                           │   │       ├─ name: movie_keyword\n" +
 26874  			"         │   │                                           │   │       └─ columns: [movie_id keyword_id]\n" +
 26875  			"         │   │                                           │   └─ Filter\n" +
 26876  			"         │   │                                           │       ├─ mc.note LIKE '%(Blu-ray)%'\n" +
 26877  			"         │   │                                           │       └─ TableAlias(mc)\n" +
 26878  			"         │   │                                           │           └─ Table\n" +
 26879  			"         │   │                                           │               ├─ name: movie_companies\n" +
 26880  			"         │   │                                           │               └─ columns: [movie_id company_id note]\n" +
 26881  			"         │   │                                           └─ Filter\n" +
 26882  			"         │   │                                               ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 26883  			"         │   │                                               └─ TableAlias(ci)\n" +
 26884  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 26885  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 26886  			"         │   │                                                       ├─ columns: [person_id movie_id note]\n" +
 26887  			"         │   │                                                       └─ keys: mc.movie_id\n" +
 26888  			"         │   └─ HashLookup\n" +
 26889  			"         │       ├─ left-key: (ci.person_id)\n" +
 26890  			"         │       ├─ right-key: (n.id)\n" +
 26891  			"         │       └─ Filter\n" +
 26892  			"         │           ├─ (n.gender = 'm')\n" +
 26893  			"         │           └─ TableAlias(n)\n" +
 26894  			"         │               └─ Table\n" +
 26895  			"         │                   ├─ name: name\n" +
 26896  			"         │                   └─ columns: [id name gender]\n" +
 26897  			"         └─ HashLookup\n" +
 26898  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id, mc.movie_id)\n" +
 26899  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 26900  			"             └─ Filter\n" +
 26901  			"                 ├─ ((t.production_year > 2000) AND ((t.title LIKE '%Freddy%' OR t.title LIKE '%Jason%') OR ((t.title >= 'Saw') AND (t.title <= 'Sawÿ'))))\n" +
 26902  			"                 └─ TableAlias(t)\n" +
 26903  			"                     └─ Table\n" +
 26904  			"                         ├─ name: title\n" +
 26905  			"                         └─ columns: [id title production_year]\n" +
 26906  			"",
 26907  	},
 26908  	{
 26909  		Query: `
 26910  SELECT MIN(mi.info) AS movie_budget,
 26911         MIN(mi_idx.info) AS movie_votes,
 26912         MIN(n.name) AS writer,
 26913         MIN(t.title) AS violent_liongate_movie
 26914  FROM cast_info AS ci,
 26915       company_name AS cn,
 26916       info_type AS it1,
 26917       info_type AS it2,
 26918       keyword AS k,
 26919       movie_companies AS mc,
 26920       movie_info AS mi,
 26921       movie_info_idx AS mi_idx,
 26922       movie_keyword AS mk,
 26923       name AS n,
 26924       title AS t
 26925  WHERE ci.note IN ('(writer)',
 26926                    '(head writer)',
 26927                    '(written by)',
 26928                    '(story)',
 26929                    '(story editor)')
 26930    AND cn.name LIKE 'Lionsgate%'
 26931    AND it1.info = 'genres'
 26932    AND it2.info = 'votes'
 26933    AND k.keyword IN ('murder',
 26934                      'violence',
 26935                      'blood',
 26936                      'gore',
 26937                      'death',
 26938                      'female-nudity',
 26939                      'hospital')
 26940    AND mi.info IN ('Horror',
 26941                    'Action',
 26942                    'Sci-Fi',
 26943                    'Thriller',
 26944                    'Crime',
 26945                    'War')
 26946    AND t.id = mi.movie_id
 26947    AND t.id = mi_idx.movie_id
 26948    AND t.id = ci.movie_id
 26949    AND t.id = mk.movie_id
 26950    AND t.id = mc.movie_id
 26951    AND ci.movie_id = mi.movie_id
 26952    AND ci.movie_id = mi_idx.movie_id
 26953    AND ci.movie_id = mk.movie_id
 26954    AND ci.movie_id = mc.movie_id
 26955    AND mi.movie_id = mi_idx.movie_id
 26956    AND mi.movie_id = mk.movie_id
 26957    AND mi.movie_id = mc.movie_id
 26958    AND mi_idx.movie_id = mk.movie_id
 26959    AND mi_idx.movie_id = mc.movie_id
 26960    AND mk.movie_id = mc.movie_id
 26961    AND n.id = ci.person_id
 26962    AND it1.id = mi.info_type_id
 26963    AND it2.id = mi_idx.info_type_id
 26964    AND k.id = mk.keyword_id
 26965    AND cn.id = mc.company_id;
 26966  
 26967  `,
 26968  		ExpectedPlan: "Project\n" +
 26969  			" ├─ columns: [min(mi.info):0!null as movie_budget, min(mi_idx.info):1!null as movie_votes, min(n.name):2!null as writer, min(t.title):3!null as violent_liongate_movie]\n" +
 26970  			" └─ GroupBy\n" +
 26971  			"     ├─ select: MIN(mi.info:4!null), MIN(mi_idx.info:9!null), MIN(n.name:22!null), MIN(t.title:24!null)\n" +
 26972  			"     ├─ group: \n" +
 26973  			"     └─ HashJoin\n" +
 26974  			"         ├─ AND\n" +
 26975  			"         │   ├─ AND\n" +
 26976  			"         │   │   ├─ AND\n" +
 26977  			"         │   │   │   ├─ AND\n" +
 26978  			"         │   │   │   │   ├─ Eq\n" +
 26979  			"         │   │   │   │   │   ├─ t.id:23!null\n" +
 26980  			"         │   │   │   │   │   └─ mi.movie_id:2!null\n" +
 26981  			"         │   │   │   │   └─ Eq\n" +
 26982  			"         │   │   │   │       ├─ t.id:23!null\n" +
 26983  			"         │   │   │   │       └─ mi_idx.movie_id:7!null\n" +
 26984  			"         │   │   │   └─ Eq\n" +
 26985  			"         │   │   │       ├─ t.id:23!null\n" +
 26986  			"         │   │   │       └─ ci.movie_id:19!null\n" +
 26987  			"         │   │   └─ Eq\n" +
 26988  			"         │   │       ├─ t.id:23!null\n" +
 26989  			"         │   │       └─ mk.movie_id:14!null\n" +
 26990  			"         │   └─ Eq\n" +
 26991  			"         │       ├─ t.id:23!null\n" +
 26992  			"         │       └─ mc.movie_id:16!null\n" +
 26993  			"         ├─ HashJoin\n" +
 26994  			"         │   ├─ Eq\n" +
 26995  			"         │   │   ├─ n.id:21!null\n" +
 26996  			"         │   │   └─ ci.person_id:18!null\n" +
 26997  			"         │   ├─ HashJoin\n" +
 26998  			"         │   │   ├─ Eq\n" +
 26999  			"         │   │   │   ├─ it2.id:0!null\n" +
 27000  			"         │   │   │   └─ mi_idx.info_type_id:8!null\n" +
 27001  			"         │   │   ├─ Filter\n" +
 27002  			"         │   │   │   ├─ Eq\n" +
 27003  			"         │   │   │   │   ├─ it2.info:1!null\n" +
 27004  			"         │   │   │   │   └─ votes (longtext)\n" +
 27005  			"         │   │   │   └─ TableAlias(it2)\n" +
 27006  			"         │   │   │       └─ ProcessTable\n" +
 27007  			"         │   │   │           └─ Table\n" +
 27008  			"         │   │   │               ├─ name: info_type\n" +
 27009  			"         │   │   │               └─ columns: [id info]\n" +
 27010  			"         │   │   └─ HashLookup\n" +
 27011  			"         │   │       ├─ left-key: TUPLE(it2.id:0!null)\n" +
 27012  			"         │   │       ├─ right-key: TUPLE(mi_idx.info_type_id:6!null)\n" +
 27013  			"         │   │       └─ HashJoin\n" +
 27014  			"         │   │           ├─ AND\n" +
 27015  			"         │   │           │   ├─ Eq\n" +
 27016  			"         │   │           │   │   ├─ mi.movie_id:2!null\n" +
 27017  			"         │   │           │   │   └─ mc.movie_id:16!null\n" +
 27018  			"         │   │           │   └─ Eq\n" +
 27019  			"         │   │           │       ├─ mi.movie_id:2!null\n" +
 27020  			"         │   │           │       └─ mi_idx.movie_id:7!null\n" +
 27021  			"         │   │           ├─ InnerJoin\n" +
 27022  			"         │   │           │   ├─ Eq\n" +
 27023  			"         │   │           │   │   ├─ it1.id:5!null\n" +
 27024  			"         │   │           │   │   └─ mi.info_type_id:3!null\n" +
 27025  			"         │   │           │   ├─ Filter\n" +
 27026  			"         │   │           │   │   ├─ HashIn\n" +
 27027  			"         │   │           │   │   │   ├─ mi.info:2!null\n" +
 27028  			"         │   │           │   │   │   └─ TUPLE(Horror (longtext), Action (longtext), Sci-Fi (longtext), Thriller (longtext), Crime (longtext), War (longtext))\n" +
 27029  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 27030  			"         │   │           │   │       └─ ProcessTable\n" +
 27031  			"         │   │           │   │           └─ Table\n" +
 27032  			"         │   │           │   │               ├─ name: movie_info\n" +
 27033  			"         │   │           │   │               └─ columns: [movie_id info_type_id info]\n" +
 27034  			"         │   │           │   └─ Filter\n" +
 27035  			"         │   │           │       ├─ Eq\n" +
 27036  			"         │   │           │       │   ├─ it1.info:1!null\n" +
 27037  			"         │   │           │       │   └─ genres (longtext)\n" +
 27038  			"         │   │           │       └─ TableAlias(it1)\n" +
 27039  			"         │   │           │           └─ Table\n" +
 27040  			"         │   │           │               ├─ name: info_type\n" +
 27041  			"         │   │           │               ├─ columns: [id info]\n" +
 27042  			"         │   │           │               ├─ colSet: (15,16)\n" +
 27043  			"         │   │           │               └─ tableId: 3\n" +
 27044  			"         │   │           └─ HashLookup\n" +
 27045  			"         │   │               ├─ left-key: TUPLE(mi.movie_id:2!null, mi.movie_id:2!null)\n" +
 27046  			"         │   │               ├─ right-key: TUPLE(mc.movie_id:9!null, mi_idx.movie_id:0!null)\n" +
 27047  			"         │   │               └─ HashJoin\n" +
 27048  			"         │   │                   ├─ AND\n" +
 27049  			"         │   │                   │   ├─ Eq\n" +
 27050  			"         │   │                   │   │   ├─ mi_idx.movie_id:7!null\n" +
 27051  			"         │   │                   │   │   └─ mc.movie_id:16!null\n" +
 27052  			"         │   │                   │   └─ Eq\n" +
 27053  			"         │   │                   │       ├─ mi_idx.movie_id:7!null\n" +
 27054  			"         │   │                   │       └─ mk.movie_id:14!null\n" +
 27055  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 27056  			"         │   │                   │   └─ ProcessTable\n" +
 27057  			"         │   │                   │       └─ Table\n" +
 27058  			"         │   │                   │           ├─ name: movie_info_idx\n" +
 27059  			"         │   │                   │           └─ columns: [movie_id info_type_id info]\n" +
 27060  			"         │   │                   └─ HashLookup\n" +
 27061  			"         │   │                       ├─ left-key: TUPLE(mi_idx.movie_id:7!null, mi_idx.movie_id:7!null)\n" +
 27062  			"         │   │                       ├─ right-key: TUPLE(mc.movie_id:6!null, mk.movie_id:4!null)\n" +
 27063  			"         │   │                       └─ HashJoin\n" +
 27064  			"         │   │                           ├─ Eq\n" +
 27065  			"         │   │                           │   ├─ k.id:10!null\n" +
 27066  			"         │   │                           │   └─ mk.keyword_id:15!null\n" +
 27067  			"         │   │                           ├─ Filter\n" +
 27068  			"         │   │                           │   ├─ HashIn\n" +
 27069  			"         │   │                           │   │   ├─ k.keyword:1!null\n" +
 27070  			"         │   │                           │   │   └─ TUPLE(murder (longtext), violence (longtext), blood (longtext), gore (longtext), death (longtext), female-nudity (longtext), hospital (longtext))\n" +
 27071  			"         │   │                           │   └─ TableAlias(k)\n" +
 27072  			"         │   │                           │       └─ ProcessTable\n" +
 27073  			"         │   │                           │           └─ Table\n" +
 27074  			"         │   │                           │               ├─ name: keyword\n" +
 27075  			"         │   │                           │               └─ columns: [id keyword]\n" +
 27076  			"         │   │                           └─ HashLookup\n" +
 27077  			"         │   │                               ├─ left-key: TUPLE(k.id:10!null)\n" +
 27078  			"         │   │                               ├─ right-key: TUPLE(mk.keyword_id:3!null)\n" +
 27079  			"         │   │                               └─ HashJoin\n" +
 27080  			"         │   │                                   ├─ Eq\n" +
 27081  			"         │   │                                   │   ├─ cn.id:12!null\n" +
 27082  			"         │   │                                   │   └─ mc.company_id:17!null\n" +
 27083  			"         │   │                                   ├─ Filter\n" +
 27084  			"         │   │                                   │   ├─ AND\n" +
 27085  			"         │   │                                   │   │   ├─ GreaterThanOrEqual\n" +
 27086  			"         │   │                                   │   │   │   ├─ cn.name:1!null\n" +
 27087  			"         │   │                                   │   │   │   └─ Lionsgate (longtext)\n" +
 27088  			"         │   │                                   │   │   └─ LessThanOrEqual\n" +
 27089  			"         │   │                                   │   │       ├─ cn.name:1!null\n" +
 27090  			"         │   │                                   │   │       └─ Lionsgateÿ (longtext)\n" +
 27091  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 27092  			"         │   │                                   │       └─ ProcessTable\n" +
 27093  			"         │   │                                   │           └─ Table\n" +
 27094  			"         │   │                                   │               ├─ name: company_name\n" +
 27095  			"         │   │                                   │               └─ columns: [id name]\n" +
 27096  			"         │   │                                   └─ HashLookup\n" +
 27097  			"         │   │                                       ├─ left-key: TUPLE(cn.id:12!null)\n" +
 27098  			"         │   │                                       ├─ right-key: TUPLE(mc.company_id:3!null)\n" +
 27099  			"         │   │                                       └─ LookupJoin\n" +
 27100  			"         │   │                                           ├─ InnerJoin\n" +
 27101  			"         │   │                                           │   ├─ Eq\n" +
 27102  			"         │   │                                           │   │   ├─ mk.movie_id:14!null\n" +
 27103  			"         │   │                                           │   │   └─ mc.movie_id:16!null\n" +
 27104  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 27105  			"         │   │                                           │   │   └─ ProcessTable\n" +
 27106  			"         │   │                                           │   │       └─ Table\n" +
 27107  			"         │   │                                           │   │           ├─ name: movie_keyword\n" +
 27108  			"         │   │                                           │   │           └─ columns: [movie_id keyword_id]\n" +
 27109  			"         │   │                                           │   └─ TableAlias(mc)\n" +
 27110  			"         │   │                                           │       └─ ProcessTable\n" +
 27111  			"         │   │                                           │           └─ Table\n" +
 27112  			"         │   │                                           │               ├─ name: movie_companies\n" +
 27113  			"         │   │                                           │               └─ columns: [movie_id company_id]\n" +
 27114  			"         │   │                                           └─ Filter\n" +
 27115  			"         │   │                                               ├─ HashIn\n" +
 27116  			"         │   │                                               │   ├─ ci.note:2\n" +
 27117  			"         │   │                                               │   └─ TUPLE((writer) (longtext), (head writer) (longtext), (written by) (longtext), (story) (longtext), (story editor) (longtext))\n" +
 27118  			"         │   │                                               └─ TableAlias(ci)\n" +
 27119  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 27120  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 27121  			"         │   │                                                       ├─ keys: [mc.movie_id:16!null]\n" +
 27122  			"         │   │                                                       ├─ colSet: (1-7)\n" +
 27123  			"         │   │                                                       ├─ tableId: 1\n" +
 27124  			"         │   │                                                       └─ Table\n" +
 27125  			"         │   │                                                           ├─ name: cast_info\n" +
 27126  			"         │   │                                                           └─ columns: [person_id movie_id note]\n" +
 27127  			"         │   └─ HashLookup\n" +
 27128  			"         │       ├─ left-key: TUPLE(ci.person_id:18!null)\n" +
 27129  			"         │       ├─ right-key: TUPLE(n.id:0!null)\n" +
 27130  			"         │       └─ TableAlias(n)\n" +
 27131  			"         │           └─ ProcessTable\n" +
 27132  			"         │               └─ Table\n" +
 27133  			"         │                   ├─ name: name\n" +
 27134  			"         │                   └─ columns: [id name]\n" +
 27135  			"         └─ HashLookup\n" +
 27136  			"             ├─ left-key: TUPLE(mi.movie_id:2!null, mi_idx.movie_id:7!null, ci.movie_id:19!null, mk.movie_id:14!null, mc.movie_id:16!null)\n" +
 27137  			"             ├─ right-key: TUPLE(t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null, t.id:0!null)\n" +
 27138  			"             └─ TableAlias(t)\n" +
 27139  			"                 └─ ProcessTable\n" +
 27140  			"                     └─ Table\n" +
 27141  			"                         ├─ name: title\n" +
 27142  			"                         └─ columns: [id title]\n" +
 27143  			"",
 27144  		ExpectedEstimates: "Project\n" +
 27145  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as violent_liongate_movie]\n" +
 27146  			" └─ GroupBy\n" +
 27147  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 27148  			"     ├─ Grouping()\n" +
 27149  			"     └─ HashJoin\n" +
 27150  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
 27151  			"         ├─ HashJoin\n" +
 27152  			"         │   ├─ (n.id = ci.person_id)\n" +
 27153  			"         │   ├─ HashJoin\n" +
 27154  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 27155  			"         │   │   ├─ Filter\n" +
 27156  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 27157  			"         │   │   │   └─ TableAlias(it2)\n" +
 27158  			"         │   │   │       └─ Table\n" +
 27159  			"         │   │   │           ├─ name: info_type\n" +
 27160  			"         │   │   │           └─ columns: [id info]\n" +
 27161  			"         │   │   └─ HashLookup\n" +
 27162  			"         │   │       ├─ left-key: (it2.id)\n" +
 27163  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 27164  			"         │   │       └─ HashJoin\n" +
 27165  			"         │   │           ├─ ((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id))\n" +
 27166  			"         │   │           ├─ InnerJoin\n" +
 27167  			"         │   │           │   ├─ (it1.id = mi.info_type_id)\n" +
 27168  			"         │   │           │   ├─ Filter\n" +
 27169  			"         │   │           │   │   ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
 27170  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 27171  			"         │   │           │   │       └─ Table\n" +
 27172  			"         │   │           │   │           ├─ name: movie_info\n" +
 27173  			"         │   │           │   │           └─ columns: [movie_id info_type_id info]\n" +
 27174  			"         │   │           │   └─ Filter\n" +
 27175  			"         │   │           │       ├─ (it1.info = 'genres')\n" +
 27176  			"         │   │           │       └─ TableAlias(it1)\n" +
 27177  			"         │   │           │           └─ Table\n" +
 27178  			"         │   │           │               ├─ name: info_type\n" +
 27179  			"         │   │           │               └─ columns: [id info]\n" +
 27180  			"         │   │           └─ HashLookup\n" +
 27181  			"         │   │               ├─ left-key: (mi.movie_id, mi.movie_id)\n" +
 27182  			"         │   │               ├─ right-key: (mc.movie_id, mi_idx.movie_id)\n" +
 27183  			"         │   │               └─ HashJoin\n" +
 27184  			"         │   │                   ├─ ((mi_idx.movie_id = mc.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 27185  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 27186  			"         │   │                   │   └─ Table\n" +
 27187  			"         │   │                   │       ├─ name: movie_info_idx\n" +
 27188  			"         │   │                   │       └─ columns: [movie_id info_type_id info]\n" +
 27189  			"         │   │                   └─ HashLookup\n" +
 27190  			"         │   │                       ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 27191  			"         │   │                       ├─ right-key: (mc.movie_id, mk.movie_id)\n" +
 27192  			"         │   │                       └─ HashJoin\n" +
 27193  			"         │   │                           ├─ (k.id = mk.keyword_id)\n" +
 27194  			"         │   │                           ├─ Filter\n" +
 27195  			"         │   │                           │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 27196  			"         │   │                           │   └─ TableAlias(k)\n" +
 27197  			"         │   │                           │       └─ Table\n" +
 27198  			"         │   │                           │           ├─ name: keyword\n" +
 27199  			"         │   │                           │           └─ columns: [id keyword]\n" +
 27200  			"         │   │                           └─ HashLookup\n" +
 27201  			"         │   │                               ├─ left-key: (k.id)\n" +
 27202  			"         │   │                               ├─ right-key: (mk.keyword_id)\n" +
 27203  			"         │   │                               └─ HashJoin\n" +
 27204  			"         │   │                                   ├─ (cn.id = mc.company_id)\n" +
 27205  			"         │   │                                   ├─ Filter\n" +
 27206  			"         │   │                                   │   ├─ ((cn.name >= 'Lionsgate') AND (cn.name <= 'Lionsgateÿ'))\n" +
 27207  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 27208  			"         │   │                                   │       └─ Table\n" +
 27209  			"         │   │                                   │           ├─ name: company_name\n" +
 27210  			"         │   │                                   │           └─ columns: [id name]\n" +
 27211  			"         │   │                                   └─ HashLookup\n" +
 27212  			"         │   │                                       ├─ left-key: (cn.id)\n" +
 27213  			"         │   │                                       ├─ right-key: (mc.company_id)\n" +
 27214  			"         │   │                                       └─ LookupJoin\n" +
 27215  			"         │   │                                           ├─ InnerJoin\n" +
 27216  			"         │   │                                           │   ├─ (mk.movie_id = mc.movie_id)\n" +
 27217  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 27218  			"         │   │                                           │   │   └─ Table\n" +
 27219  			"         │   │                                           │   │       ├─ name: movie_keyword\n" +
 27220  			"         │   │                                           │   │       └─ columns: [movie_id keyword_id]\n" +
 27221  			"         │   │                                           │   └─ TableAlias(mc)\n" +
 27222  			"         │   │                                           │       └─ Table\n" +
 27223  			"         │   │                                           │           ├─ name: movie_companies\n" +
 27224  			"         │   │                                           │           └─ columns: [movie_id company_id]\n" +
 27225  			"         │   │                                           └─ Filter\n" +
 27226  			"         │   │                                               ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 27227  			"         │   │                                               └─ TableAlias(ci)\n" +
 27228  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 27229  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 27230  			"         │   │                                                       ├─ columns: [person_id movie_id note]\n" +
 27231  			"         │   │                                                       └─ keys: mc.movie_id\n" +
 27232  			"         │   └─ HashLookup\n" +
 27233  			"         │       ├─ left-key: (ci.person_id)\n" +
 27234  			"         │       ├─ right-key: (n.id)\n" +
 27235  			"         │       └─ TableAlias(n)\n" +
 27236  			"         │           └─ Table\n" +
 27237  			"         │               ├─ name: name\n" +
 27238  			"         │               └─ columns: [id name]\n" +
 27239  			"         └─ HashLookup\n" +
 27240  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id, mc.movie_id)\n" +
 27241  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 27242  			"             └─ TableAlias(t)\n" +
 27243  			"                 └─ Table\n" +
 27244  			"                     ├─ name: title\n" +
 27245  			"                     └─ columns: [id title]\n" +
 27246  			"",
 27247  		ExpectedAnalysis: "Project\n" +
 27248  			" ├─ columns: [min(mi.info) as movie_budget, min(mi_idx.info) as movie_votes, min(n.name) as writer, min(t.title) as violent_liongate_movie]\n" +
 27249  			" └─ GroupBy\n" +
 27250  			"     ├─ SelectedExprs(MIN(mi.info), MIN(mi_idx.info), MIN(n.name), MIN(t.title))\n" +
 27251  			"     ├─ Grouping()\n" +
 27252  			"     └─ HashJoin\n" +
 27253  			"         ├─ (((((t.id = mi.movie_id) AND (t.id = mi_idx.movie_id)) AND (t.id = ci.movie_id)) AND (t.id = mk.movie_id)) AND (t.id = mc.movie_id))\n" +
 27254  			"         ├─ HashJoin\n" +
 27255  			"         │   ├─ (n.id = ci.person_id)\n" +
 27256  			"         │   ├─ HashJoin\n" +
 27257  			"         │   │   ├─ (it2.id = mi_idx.info_type_id)\n" +
 27258  			"         │   │   ├─ Filter\n" +
 27259  			"         │   │   │   ├─ (it2.info = 'votes')\n" +
 27260  			"         │   │   │   └─ TableAlias(it2)\n" +
 27261  			"         │   │   │       └─ Table\n" +
 27262  			"         │   │   │           ├─ name: info_type\n" +
 27263  			"         │   │   │           └─ columns: [id info]\n" +
 27264  			"         │   │   └─ HashLookup\n" +
 27265  			"         │   │       ├─ left-key: (it2.id)\n" +
 27266  			"         │   │       ├─ right-key: (mi_idx.info_type_id)\n" +
 27267  			"         │   │       └─ HashJoin\n" +
 27268  			"         │   │           ├─ ((mi.movie_id = mc.movie_id) AND (mi.movie_id = mi_idx.movie_id))\n" +
 27269  			"         │   │           ├─ InnerJoin\n" +
 27270  			"         │   │           │   ├─ (it1.id = mi.info_type_id)\n" +
 27271  			"         │   │           │   ├─ Filter\n" +
 27272  			"         │   │           │   │   ├─ (mi.info HASH IN ('Horror', 'Action', 'Sci-Fi', 'Thriller', 'Crime', 'War'))\n" +
 27273  			"         │   │           │   │   └─ TableAlias(mi)\n" +
 27274  			"         │   │           │   │       └─ Table\n" +
 27275  			"         │   │           │   │           ├─ name: movie_info\n" +
 27276  			"         │   │           │   │           └─ columns: [movie_id info_type_id info]\n" +
 27277  			"         │   │           │   └─ Filter\n" +
 27278  			"         │   │           │       ├─ (it1.info = 'genres')\n" +
 27279  			"         │   │           │       └─ TableAlias(it1)\n" +
 27280  			"         │   │           │           └─ Table\n" +
 27281  			"         │   │           │               ├─ name: info_type\n" +
 27282  			"         │   │           │               └─ columns: [id info]\n" +
 27283  			"         │   │           └─ HashLookup\n" +
 27284  			"         │   │               ├─ left-key: (mi.movie_id, mi.movie_id)\n" +
 27285  			"         │   │               ├─ right-key: (mc.movie_id, mi_idx.movie_id)\n" +
 27286  			"         │   │               └─ HashJoin\n" +
 27287  			"         │   │                   ├─ ((mi_idx.movie_id = mc.movie_id) AND (mi_idx.movie_id = mk.movie_id))\n" +
 27288  			"         │   │                   ├─ TableAlias(mi_idx)\n" +
 27289  			"         │   │                   │   └─ Table\n" +
 27290  			"         │   │                   │       ├─ name: movie_info_idx\n" +
 27291  			"         │   │                   │       └─ columns: [movie_id info_type_id info]\n" +
 27292  			"         │   │                   └─ HashLookup\n" +
 27293  			"         │   │                       ├─ left-key: (mi_idx.movie_id, mi_idx.movie_id)\n" +
 27294  			"         │   │                       ├─ right-key: (mc.movie_id, mk.movie_id)\n" +
 27295  			"         │   │                       └─ HashJoin\n" +
 27296  			"         │   │                           ├─ (k.id = mk.keyword_id)\n" +
 27297  			"         │   │                           ├─ Filter\n" +
 27298  			"         │   │                           │   ├─ (k.keyword HASH IN ('murder', 'violence', 'blood', 'gore', 'death', 'female-nudity', 'hospital'))\n" +
 27299  			"         │   │                           │   └─ TableAlias(k)\n" +
 27300  			"         │   │                           │       └─ Table\n" +
 27301  			"         │   │                           │           ├─ name: keyword\n" +
 27302  			"         │   │                           │           └─ columns: [id keyword]\n" +
 27303  			"         │   │                           └─ HashLookup\n" +
 27304  			"         │   │                               ├─ left-key: (k.id)\n" +
 27305  			"         │   │                               ├─ right-key: (mk.keyword_id)\n" +
 27306  			"         │   │                               └─ HashJoin\n" +
 27307  			"         │   │                                   ├─ (cn.id = mc.company_id)\n" +
 27308  			"         │   │                                   ├─ Filter\n" +
 27309  			"         │   │                                   │   ├─ ((cn.name >= 'Lionsgate') AND (cn.name <= 'Lionsgateÿ'))\n" +
 27310  			"         │   │                                   │   └─ TableAlias(cn)\n" +
 27311  			"         │   │                                   │       └─ Table\n" +
 27312  			"         │   │                                   │           ├─ name: company_name\n" +
 27313  			"         │   │                                   │           └─ columns: [id name]\n" +
 27314  			"         │   │                                   └─ HashLookup\n" +
 27315  			"         │   │                                       ├─ left-key: (cn.id)\n" +
 27316  			"         │   │                                       ├─ right-key: (mc.company_id)\n" +
 27317  			"         │   │                                       └─ LookupJoin\n" +
 27318  			"         │   │                                           ├─ InnerJoin\n" +
 27319  			"         │   │                                           │   ├─ (mk.movie_id = mc.movie_id)\n" +
 27320  			"         │   │                                           │   ├─ TableAlias(mk)\n" +
 27321  			"         │   │                                           │   │   └─ Table\n" +
 27322  			"         │   │                                           │   │       ├─ name: movie_keyword\n" +
 27323  			"         │   │                                           │   │       └─ columns: [movie_id keyword_id]\n" +
 27324  			"         │   │                                           │   └─ TableAlias(mc)\n" +
 27325  			"         │   │                                           │       └─ Table\n" +
 27326  			"         │   │                                           │           ├─ name: movie_companies\n" +
 27327  			"         │   │                                           │           └─ columns: [movie_id company_id]\n" +
 27328  			"         │   │                                           └─ Filter\n" +
 27329  			"         │   │                                               ├─ (ci.note HASH IN ('(writer)', '(head writer)', '(written by)', '(story)', '(story editor)'))\n" +
 27330  			"         │   │                                               └─ TableAlias(ci)\n" +
 27331  			"         │   │                                                   └─ IndexedTableAccess(cast_info)\n" +
 27332  			"         │   │                                                       ├─ index: [cast_info.movie_id]\n" +
 27333  			"         │   │                                                       ├─ columns: [person_id movie_id note]\n" +
 27334  			"         │   │                                                       └─ keys: mc.movie_id\n" +
 27335  			"         │   └─ HashLookup\n" +
 27336  			"         │       ├─ left-key: (ci.person_id)\n" +
 27337  			"         │       ├─ right-key: (n.id)\n" +
 27338  			"         │       └─ TableAlias(n)\n" +
 27339  			"         │           └─ Table\n" +
 27340  			"         │               ├─ name: name\n" +
 27341  			"         │               └─ columns: [id name]\n" +
 27342  			"         └─ HashLookup\n" +
 27343  			"             ├─ left-key: (mi.movie_id, mi_idx.movie_id, ci.movie_id, mk.movie_id, mc.movie_id)\n" +
 27344  			"             ├─ right-key: (t.id, t.id, t.id, t.id, t.id)\n" +
 27345  			"             └─ TableAlias(t)\n" +
 27346  			"                 └─ Table\n" +
 27347  			"                     ├─ name: title\n" +
 27348  			"                     └─ columns: [id title]\n" +
 27349  			"",
 27350  	},
 27351  	{
 27352  		Query: `
 27353  SELECT MIN(lt.link) AS link_type,
 27354         MIN(t1.title) AS first_movie,
 27355         MIN(t2.title) AS second_movie
 27356  FROM keyword AS k,
 27357       link_type AS lt,
 27358       movie_keyword AS mk,
 27359       movie_link AS ml,
 27360       title AS t1,
 27361       title AS t2
 27362  WHERE k.keyword ='10,000-mile-club'
 27363    AND mk.keyword_id = k.id
 27364    AND t1.id = mk.movie_id
 27365    AND ml.movie_id = t1.id
 27366    AND ml.linked_movie_id = t2.id
 27367    AND lt.id = ml.link_type_id
 27368    AND mk.movie_id = t1.id;
 27369  
 27370  `,
 27371  		ExpectedPlan: "Project\n" +
 27372  			" ├─ columns: [min(lt.link):0!null as link_type, min(t1.title):1!null as first_movie, min(t2.title):2!null as second_movie]\n" +
 27373  			" └─ GroupBy\n" +
 27374  			"     ├─ select: MIN(lt.link:6!null), MIN(t1.title:8!null), MIN(t2.title:1!null)\n" +
 27375  			"     ├─ group: \n" +
 27376  			"     └─ InnerJoin\n" +
 27377  			"         ├─ AND\n" +
 27378  			"         │   ├─ Eq\n" +
 27379  			"         │   │   ├─ ml.movie_id:2!null\n" +
 27380  			"         │   │   └─ t1.id:7!null\n" +
 27381  			"         │   └─ Eq\n" +
 27382  			"         │       ├─ mk.movie_id:9!null\n" +
 27383  			"         │       └─ ml.movie_id:2!null\n" +
 27384  			"         ├─ InnerJoin\n" +
 27385  			"         │   ├─ Eq\n" +
 27386  			"         │   │   ├─ ml.linked_movie_id:3!null\n" +
 27387  			"         │   │   └─ t2.id:0!null\n" +
 27388  			"         │   ├─ TableAlias(t2)\n" +
 27389  			"         │   │   └─ ProcessTable\n" +
 27390  			"         │   │       └─ Table\n" +
 27391  			"         │   │           ├─ name: title\n" +
 27392  			"         │   │           └─ columns: [id title]\n" +
 27393  			"         │   └─ InnerJoin\n" +
 27394  			"         │       ├─ Eq\n" +
 27395  			"         │       │   ├─ lt.id:5!null\n" +
 27396  			"         │       │   └─ ml.link_type_id:4!null\n" +
 27397  			"         │       ├─ TableAlias(ml)\n" +
 27398  			"         │       │   └─ ProcessTable\n" +
 27399  			"         │       │       └─ Table\n" +
 27400  			"         │       │           ├─ name: movie_link\n" +
 27401  			"         │       │           └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27402  			"         │       └─ TableAlias(lt)\n" +
 27403  			"         │           └─ ProcessTable\n" +
 27404  			"         │               └─ Table\n" +
 27405  			"         │                   ├─ name: link_type\n" +
 27406  			"         │                   └─ columns: [id link]\n" +
 27407  			"         └─ InnerJoin\n" +
 27408  			"             ├─ AND\n" +
 27409  			"             │   ├─ Eq\n" +
 27410  			"             │   │   ├─ t1.id:7!null\n" +
 27411  			"             │   │   └─ mk.movie_id:9!null\n" +
 27412  			"             │   └─ Eq\n" +
 27413  			"             │       ├─ mk.movie_id:9!null\n" +
 27414  			"             │       └─ t1.id:7!null\n" +
 27415  			"             ├─ TableAlias(t1)\n" +
 27416  			"             │   └─ Table\n" +
 27417  			"             │       ├─ name: title\n" +
 27418  			"             │       ├─ columns: [id title]\n" +
 27419  			"             │       ├─ colSet: (13-24)\n" +
 27420  			"             │       └─ tableId: 5\n" +
 27421  			"             └─ InnerJoin\n" +
 27422  			"                 ├─ Eq\n" +
 27423  			"                 │   ├─ mk.keyword_id:10!null\n" +
 27424  			"                 │   └─ k.id:11!null\n" +
 27425  			"                 ├─ TableAlias(mk)\n" +
 27426  			"                 │   └─ ProcessTable\n" +
 27427  			"                 │       └─ Table\n" +
 27428  			"                 │           ├─ name: movie_keyword\n" +
 27429  			"                 │           └─ columns: [movie_id keyword_id]\n" +
 27430  			"                 └─ Filter\n" +
 27431  			"                     ├─ Eq\n" +
 27432  			"                     │   ├─ k.keyword:1!null\n" +
 27433  			"                     │   └─ 10,000-mile-club (longtext)\n" +
 27434  			"                     └─ TableAlias(k)\n" +
 27435  			"                         └─ ProcessTable\n" +
 27436  			"                             └─ Table\n" +
 27437  			"                                 ├─ name: keyword\n" +
 27438  			"                                 └─ columns: [id keyword]\n" +
 27439  			"",
 27440  		ExpectedEstimates: "Project\n" +
 27441  			" ├─ columns: [min(lt.link) as link_type, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 27442  			" └─ GroupBy\n" +
 27443  			"     ├─ SelectedExprs(MIN(lt.link), MIN(t1.title), MIN(t2.title))\n" +
 27444  			"     ├─ Grouping()\n" +
 27445  			"     └─ InnerJoin\n" +
 27446  			"         ├─ ((ml.movie_id = t1.id) AND (mk.movie_id = ml.movie_id))\n" +
 27447  			"         ├─ InnerJoin\n" +
 27448  			"         │   ├─ (ml.linked_movie_id = t2.id)\n" +
 27449  			"         │   ├─ TableAlias(t2)\n" +
 27450  			"         │   │   └─ Table\n" +
 27451  			"         │   │       ├─ name: title\n" +
 27452  			"         │   │       └─ columns: [id title]\n" +
 27453  			"         │   └─ InnerJoin\n" +
 27454  			"         │       ├─ (lt.id = ml.link_type_id)\n" +
 27455  			"         │       ├─ TableAlias(ml)\n" +
 27456  			"         │       │   └─ Table\n" +
 27457  			"         │       │       ├─ name: movie_link\n" +
 27458  			"         │       │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27459  			"         │       └─ TableAlias(lt)\n" +
 27460  			"         │           └─ Table\n" +
 27461  			"         │               ├─ name: link_type\n" +
 27462  			"         │               └─ columns: [id link]\n" +
 27463  			"         └─ InnerJoin\n" +
 27464  			"             ├─ ((t1.id = mk.movie_id) AND (mk.movie_id = t1.id))\n" +
 27465  			"             ├─ TableAlias(t1)\n" +
 27466  			"             │   └─ Table\n" +
 27467  			"             │       ├─ name: title\n" +
 27468  			"             │       └─ columns: [id title]\n" +
 27469  			"             └─ InnerJoin\n" +
 27470  			"                 ├─ (mk.keyword_id = k.id)\n" +
 27471  			"                 ├─ TableAlias(mk)\n" +
 27472  			"                 │   └─ Table\n" +
 27473  			"                 │       ├─ name: movie_keyword\n" +
 27474  			"                 │       └─ columns: [movie_id keyword_id]\n" +
 27475  			"                 └─ Filter\n" +
 27476  			"                     ├─ (k.keyword = '10,000-mile-club')\n" +
 27477  			"                     └─ TableAlias(k)\n" +
 27478  			"                         └─ Table\n" +
 27479  			"                             ├─ name: keyword\n" +
 27480  			"                             └─ columns: [id keyword]\n" +
 27481  			"",
 27482  		ExpectedAnalysis: "Project\n" +
 27483  			" ├─ columns: [min(lt.link) as link_type, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 27484  			" └─ GroupBy\n" +
 27485  			"     ├─ SelectedExprs(MIN(lt.link), MIN(t1.title), MIN(t2.title))\n" +
 27486  			"     ├─ Grouping()\n" +
 27487  			"     └─ InnerJoin\n" +
 27488  			"         ├─ ((ml.movie_id = t1.id) AND (mk.movie_id = ml.movie_id))\n" +
 27489  			"         ├─ InnerJoin\n" +
 27490  			"         │   ├─ (ml.linked_movie_id = t2.id)\n" +
 27491  			"         │   ├─ TableAlias(t2)\n" +
 27492  			"         │   │   └─ Table\n" +
 27493  			"         │   │       ├─ name: title\n" +
 27494  			"         │   │       └─ columns: [id title]\n" +
 27495  			"         │   └─ InnerJoin\n" +
 27496  			"         │       ├─ (lt.id = ml.link_type_id)\n" +
 27497  			"         │       ├─ TableAlias(ml)\n" +
 27498  			"         │       │   └─ Table\n" +
 27499  			"         │       │       ├─ name: movie_link\n" +
 27500  			"         │       │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27501  			"         │       └─ TableAlias(lt)\n" +
 27502  			"         │           └─ Table\n" +
 27503  			"         │               ├─ name: link_type\n" +
 27504  			"         │               └─ columns: [id link]\n" +
 27505  			"         └─ InnerJoin\n" +
 27506  			"             ├─ ((t1.id = mk.movie_id) AND (mk.movie_id = t1.id))\n" +
 27507  			"             ├─ TableAlias(t1)\n" +
 27508  			"             │   └─ Table\n" +
 27509  			"             │       ├─ name: title\n" +
 27510  			"             │       └─ columns: [id title]\n" +
 27511  			"             └─ InnerJoin\n" +
 27512  			"                 ├─ (mk.keyword_id = k.id)\n" +
 27513  			"                 ├─ TableAlias(mk)\n" +
 27514  			"                 │   └─ Table\n" +
 27515  			"                 │       ├─ name: movie_keyword\n" +
 27516  			"                 │       └─ columns: [movie_id keyword_id]\n" +
 27517  			"                 └─ Filter\n" +
 27518  			"                     ├─ (k.keyword = '10,000-mile-club')\n" +
 27519  			"                     └─ TableAlias(k)\n" +
 27520  			"                         └─ Table\n" +
 27521  			"                             ├─ name: keyword\n" +
 27522  			"                             └─ columns: [id keyword]\n" +
 27523  			"",
 27524  	},
 27525  	{
 27526  		Query: `
 27527  SELECT MIN(lt.link) AS link_type,
 27528         MIN(t1.title) AS first_movie,
 27529         MIN(t2.title) AS second_movie
 27530  FROM keyword AS k,
 27531       link_type AS lt,
 27532       movie_keyword AS mk,
 27533       movie_link AS ml,
 27534       title AS t1,
 27535       title AS t2
 27536  WHERE k.keyword ='character-name-in-title'
 27537    AND mk.keyword_id = k.id
 27538    AND t1.id = mk.movie_id
 27539    AND ml.movie_id = t1.id
 27540    AND ml.linked_movie_id = t2.id
 27541    AND lt.id = ml.link_type_id
 27542    AND mk.movie_id = t1.id;
 27543  
 27544  `,
 27545  		ExpectedPlan: "Project\n" +
 27546  			" ├─ columns: [min(lt.link):0!null as link_type, min(t1.title):1!null as first_movie, min(t2.title):2!null as second_movie]\n" +
 27547  			" └─ GroupBy\n" +
 27548  			"     ├─ select: MIN(lt.link:6!null), MIN(t1.title:8!null), MIN(t2.title:1!null)\n" +
 27549  			"     ├─ group: \n" +
 27550  			"     └─ InnerJoin\n" +
 27551  			"         ├─ AND\n" +
 27552  			"         │   ├─ Eq\n" +
 27553  			"         │   │   ├─ ml.movie_id:2!null\n" +
 27554  			"         │   │   └─ t1.id:7!null\n" +
 27555  			"         │   └─ Eq\n" +
 27556  			"         │       ├─ mk.movie_id:9!null\n" +
 27557  			"         │       └─ ml.movie_id:2!null\n" +
 27558  			"         ├─ InnerJoin\n" +
 27559  			"         │   ├─ Eq\n" +
 27560  			"         │   │   ├─ ml.linked_movie_id:3!null\n" +
 27561  			"         │   │   └─ t2.id:0!null\n" +
 27562  			"         │   ├─ TableAlias(t2)\n" +
 27563  			"         │   │   └─ ProcessTable\n" +
 27564  			"         │   │       └─ Table\n" +
 27565  			"         │   │           ├─ name: title\n" +
 27566  			"         │   │           └─ columns: [id title]\n" +
 27567  			"         │   └─ InnerJoin\n" +
 27568  			"         │       ├─ Eq\n" +
 27569  			"         │       │   ├─ lt.id:5!null\n" +
 27570  			"         │       │   └─ ml.link_type_id:4!null\n" +
 27571  			"         │       ├─ TableAlias(ml)\n" +
 27572  			"         │       │   └─ ProcessTable\n" +
 27573  			"         │       │       └─ Table\n" +
 27574  			"         │       │           ├─ name: movie_link\n" +
 27575  			"         │       │           └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27576  			"         │       └─ TableAlias(lt)\n" +
 27577  			"         │           └─ ProcessTable\n" +
 27578  			"         │               └─ Table\n" +
 27579  			"         │                   ├─ name: link_type\n" +
 27580  			"         │                   └─ columns: [id link]\n" +
 27581  			"         └─ InnerJoin\n" +
 27582  			"             ├─ AND\n" +
 27583  			"             │   ├─ Eq\n" +
 27584  			"             │   │   ├─ t1.id:7!null\n" +
 27585  			"             │   │   └─ mk.movie_id:9!null\n" +
 27586  			"             │   └─ Eq\n" +
 27587  			"             │       ├─ mk.movie_id:9!null\n" +
 27588  			"             │       └─ t1.id:7!null\n" +
 27589  			"             ├─ TableAlias(t1)\n" +
 27590  			"             │   └─ Table\n" +
 27591  			"             │       ├─ name: title\n" +
 27592  			"             │       ├─ columns: [id title]\n" +
 27593  			"             │       ├─ colSet: (13-24)\n" +
 27594  			"             │       └─ tableId: 5\n" +
 27595  			"             └─ InnerJoin\n" +
 27596  			"                 ├─ Eq\n" +
 27597  			"                 │   ├─ mk.keyword_id:10!null\n" +
 27598  			"                 │   └─ k.id:11!null\n" +
 27599  			"                 ├─ TableAlias(mk)\n" +
 27600  			"                 │   └─ ProcessTable\n" +
 27601  			"                 │       └─ Table\n" +
 27602  			"                 │           ├─ name: movie_keyword\n" +
 27603  			"                 │           └─ columns: [movie_id keyword_id]\n" +
 27604  			"                 └─ Filter\n" +
 27605  			"                     ├─ Eq\n" +
 27606  			"                     │   ├─ k.keyword:1!null\n" +
 27607  			"                     │   └─ character-name-in-title (longtext)\n" +
 27608  			"                     └─ TableAlias(k)\n" +
 27609  			"                         └─ ProcessTable\n" +
 27610  			"                             └─ Table\n" +
 27611  			"                                 ├─ name: keyword\n" +
 27612  			"                                 └─ columns: [id keyword]\n" +
 27613  			"",
 27614  		ExpectedEstimates: "Project\n" +
 27615  			" ├─ columns: [min(lt.link) as link_type, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 27616  			" └─ GroupBy\n" +
 27617  			"     ├─ SelectedExprs(MIN(lt.link), MIN(t1.title), MIN(t2.title))\n" +
 27618  			"     ├─ Grouping()\n" +
 27619  			"     └─ InnerJoin\n" +
 27620  			"         ├─ ((ml.movie_id = t1.id) AND (mk.movie_id = ml.movie_id))\n" +
 27621  			"         ├─ InnerJoin\n" +
 27622  			"         │   ├─ (ml.linked_movie_id = t2.id)\n" +
 27623  			"         │   ├─ TableAlias(t2)\n" +
 27624  			"         │   │   └─ Table\n" +
 27625  			"         │   │       ├─ name: title\n" +
 27626  			"         │   │       └─ columns: [id title]\n" +
 27627  			"         │   └─ InnerJoin\n" +
 27628  			"         │       ├─ (lt.id = ml.link_type_id)\n" +
 27629  			"         │       ├─ TableAlias(ml)\n" +
 27630  			"         │       │   └─ Table\n" +
 27631  			"         │       │       ├─ name: movie_link\n" +
 27632  			"         │       │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27633  			"         │       └─ TableAlias(lt)\n" +
 27634  			"         │           └─ Table\n" +
 27635  			"         │               ├─ name: link_type\n" +
 27636  			"         │               └─ columns: [id link]\n" +
 27637  			"         └─ InnerJoin\n" +
 27638  			"             ├─ ((t1.id = mk.movie_id) AND (mk.movie_id = t1.id))\n" +
 27639  			"             ├─ TableAlias(t1)\n" +
 27640  			"             │   └─ Table\n" +
 27641  			"             │       ├─ name: title\n" +
 27642  			"             │       └─ columns: [id title]\n" +
 27643  			"             └─ InnerJoin\n" +
 27644  			"                 ├─ (mk.keyword_id = k.id)\n" +
 27645  			"                 ├─ TableAlias(mk)\n" +
 27646  			"                 │   └─ Table\n" +
 27647  			"                 │       ├─ name: movie_keyword\n" +
 27648  			"                 │       └─ columns: [movie_id keyword_id]\n" +
 27649  			"                 └─ Filter\n" +
 27650  			"                     ├─ (k.keyword = 'character-name-in-title')\n" +
 27651  			"                     └─ TableAlias(k)\n" +
 27652  			"                         └─ Table\n" +
 27653  			"                             ├─ name: keyword\n" +
 27654  			"                             └─ columns: [id keyword]\n" +
 27655  			"",
 27656  		ExpectedAnalysis: "Project\n" +
 27657  			" ├─ columns: [min(lt.link) as link_type, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 27658  			" └─ GroupBy\n" +
 27659  			"     ├─ SelectedExprs(MIN(lt.link), MIN(t1.title), MIN(t2.title))\n" +
 27660  			"     ├─ Grouping()\n" +
 27661  			"     └─ InnerJoin\n" +
 27662  			"         ├─ ((ml.movie_id = t1.id) AND (mk.movie_id = ml.movie_id))\n" +
 27663  			"         ├─ InnerJoin\n" +
 27664  			"         │   ├─ (ml.linked_movie_id = t2.id)\n" +
 27665  			"         │   ├─ TableAlias(t2)\n" +
 27666  			"         │   │   └─ Table\n" +
 27667  			"         │   │       ├─ name: title\n" +
 27668  			"         │   │       └─ columns: [id title]\n" +
 27669  			"         │   └─ InnerJoin\n" +
 27670  			"         │       ├─ (lt.id = ml.link_type_id)\n" +
 27671  			"         │       ├─ TableAlias(ml)\n" +
 27672  			"         │       │   └─ Table\n" +
 27673  			"         │       │       ├─ name: movie_link\n" +
 27674  			"         │       │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27675  			"         │       └─ TableAlias(lt)\n" +
 27676  			"         │           └─ Table\n" +
 27677  			"         │               ├─ name: link_type\n" +
 27678  			"         │               └─ columns: [id link]\n" +
 27679  			"         └─ InnerJoin\n" +
 27680  			"             ├─ ((t1.id = mk.movie_id) AND (mk.movie_id = t1.id))\n" +
 27681  			"             ├─ TableAlias(t1)\n" +
 27682  			"             │   └─ Table\n" +
 27683  			"             │       ├─ name: title\n" +
 27684  			"             │       └─ columns: [id title]\n" +
 27685  			"             └─ InnerJoin\n" +
 27686  			"                 ├─ (mk.keyword_id = k.id)\n" +
 27687  			"                 ├─ TableAlias(mk)\n" +
 27688  			"                 │   └─ Table\n" +
 27689  			"                 │       ├─ name: movie_keyword\n" +
 27690  			"                 │       └─ columns: [movie_id keyword_id]\n" +
 27691  			"                 └─ Filter\n" +
 27692  			"                     ├─ (k.keyword = 'character-name-in-title')\n" +
 27693  			"                     └─ TableAlias(k)\n" +
 27694  			"                         └─ Table\n" +
 27695  			"                             ├─ name: keyword\n" +
 27696  			"                             └─ columns: [id keyword]\n" +
 27697  			"",
 27698  	},
 27699  	{
 27700  		Query: `
 27701  SELECT MIN(cn1.name) AS first_company,
 27702         MIN(cn2.name) AS second_company,
 27703         MIN(mi_idx1.info) AS first_rating,
 27704         MIN(mi_idx2.info) AS second_rating,
 27705         MIN(t1.title) AS first_movie,
 27706         MIN(t2.title) AS second_movie
 27707  FROM company_name AS cn1,
 27708       company_name AS cn2,
 27709       info_type AS it1,
 27710       info_type AS it2,
 27711       kind_type AS kt1,
 27712       kind_type AS kt2,
 27713       link_type AS lt,
 27714       movie_companies AS mc1,
 27715       movie_companies AS mc2,
 27716       movie_info_idx AS mi_idx1,
 27717       movie_info_idx AS mi_idx2,
 27718       movie_link AS ml,
 27719       title AS t1,
 27720       title AS t2
 27721  WHERE cn1.country_code = '[us]'
 27722    AND it1.info = 'rating'
 27723    AND it2.info = 'rating'
 27724    AND kt1.kind IN ('tv series')
 27725    AND kt2.kind IN ('tv series')
 27726    AND lt.link IN ('sequel',
 27727                    'follows',
 27728                    'followed by')
 27729    AND mi_idx2.info < '3.0'
 27730    AND t2.production_year BETWEEN 2005 AND 2008
 27731    AND lt.id = ml.link_type_id
 27732    AND t1.id = ml.movie_id
 27733    AND t2.id = ml.linked_movie_id
 27734    AND it1.id = mi_idx1.info_type_id
 27735    AND t1.id = mi_idx1.movie_id
 27736    AND kt1.id = t1.kind_id
 27737    AND cn1.id = mc1.company_id
 27738    AND t1.id = mc1.movie_id
 27739    AND ml.movie_id = mi_idx1.movie_id
 27740    AND ml.movie_id = mc1.movie_id
 27741    AND mi_idx1.movie_id = mc1.movie_id
 27742    AND it2.id = mi_idx2.info_type_id
 27743    AND t2.id = mi_idx2.movie_id
 27744    AND kt2.id = t2.kind_id
 27745    AND cn2.id = mc2.company_id
 27746    AND t2.id = mc2.movie_id
 27747    AND ml.linked_movie_id = mi_idx2.movie_id
 27748    AND ml.linked_movie_id = mc2.movie_id
 27749    AND mi_idx2.movie_id = mc2.movie_id;
 27750  
 27751  `,
 27752  		ExpectedPlan: "Project\n" +
 27753  			" ├─ columns: [min(cn1.name):0!null as first_company, min(cn2.name):1!null as second_company, min(mi_idx1.info):2!null as first_rating, min(mi_idx2.info):3!null as second_rating, min(t1.title):4!null as first_movie, min(t2.title):5!null as second_movie]\n" +
 27754  			" └─ GroupBy\n" +
 27755  			"     ├─ select: MIN(cn1.name:31!null), MIN(cn2.name:29!null), MIN(mi_idx1.info:23!null), MIN(mi_idx2.info:18!null), MIN(t1.title:7!null), MIN(t2.title:1!null)\n" +
 27756  			"     ├─ group: \n" +
 27757  			"     └─ InnerJoin\n" +
 27758  			"         ├─ AND\n" +
 27759  			"         │   ├─ AND\n" +
 27760  			"         │   │   ├─ Eq\n" +
 27761  			"         │   │   │   ├─ t2.id:0!null\n" +
 27762  			"         │   │   │   └─ ml.linked_movie_id:12!null\n" +
 27763  			"         │   │   └─ Eq\n" +
 27764  			"         │   │       ├─ t2.id:0!null\n" +
 27765  			"         │   │       └─ mi_idx2.movie_id:16!null\n" +
 27766  			"         │   └─ Eq\n" +
 27767  			"         │       ├─ t2.id:0!null\n" +
 27768  			"         │       └─ mc2.movie_id:26!null\n" +
 27769  			"         ├─ InnerJoin\n" +
 27770  			"         │   ├─ Eq\n" +
 27771  			"         │   │   ├─ kt2.id:4!null\n" +
 27772  			"         │   │   └─ t2.kind_id:2!null\n" +
 27773  			"         │   ├─ Filter\n" +
 27774  			"         │   │   ├─ AND\n" +
 27775  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
 27776  			"         │   │   │   │   ├─ t2.production_year:3\n" +
 27777  			"         │   │   │   │   └─ 2005 (smallint)\n" +
 27778  			"         │   │   │   └─ LessThanOrEqual\n" +
 27779  			"         │   │   │       ├─ t2.production_year:3\n" +
 27780  			"         │   │   │       └─ 2008 (smallint)\n" +
 27781  			"         │   │   └─ TableAlias(t2)\n" +
 27782  			"         │   │       └─ ProcessTable\n" +
 27783  			"         │   │           └─ Table\n" +
 27784  			"         │   │               ├─ name: title\n" +
 27785  			"         │   │               └─ columns: [id title kind_id production_year]\n" +
 27786  			"         │   └─ Filter\n" +
 27787  			"         │       ├─ HashIn\n" +
 27788  			"         │       │   ├─ kt2.kind:1!null\n" +
 27789  			"         │       │   └─ TUPLE(tv series (longtext))\n" +
 27790  			"         │       └─ TableAlias(kt2)\n" +
 27791  			"         │           └─ ProcessTable\n" +
 27792  			"         │               └─ Table\n" +
 27793  			"         │                   ├─ name: kind_type\n" +
 27794  			"         │                   └─ columns: [id kind]\n" +
 27795  			"         └─ InnerJoin\n" +
 27796  			"             ├─ AND\n" +
 27797  			"             │   ├─ AND\n" +
 27798  			"             │   │   ├─ Eq\n" +
 27799  			"             │   │   │   ├─ t1.id:6!null\n" +
 27800  			"             │   │   │   └─ ml.movie_id:11!null\n" +
 27801  			"             │   │   └─ Eq\n" +
 27802  			"             │   │       ├─ t1.id:6!null\n" +
 27803  			"             │   │       └─ mi_idx1.movie_id:21!null\n" +
 27804  			"             │   └─ Eq\n" +
 27805  			"             │       ├─ t1.id:6!null\n" +
 27806  			"             │       └─ mc1.movie_id:33!null\n" +
 27807  			"             ├─ InnerJoin\n" +
 27808  			"             │   ├─ Eq\n" +
 27809  			"             │   │   ├─ kt1.id:9!null\n" +
 27810  			"             │   │   └─ t1.kind_id:8!null\n" +
 27811  			"             │   ├─ TableAlias(t1)\n" +
 27812  			"             │   │   └─ Table\n" +
 27813  			"             │   │       ├─ name: title\n" +
 27814  			"             │   │       ├─ columns: [id title kind_id]\n" +
 27815  			"             │   │       ├─ colSet: (49-60)\n" +
 27816  			"             │   │       └─ tableId: 13\n" +
 27817  			"             │   └─ Filter\n" +
 27818  			"             │       ├─ HashIn\n" +
 27819  			"             │       │   ├─ kt1.kind:1!null\n" +
 27820  			"             │       │   └─ TUPLE(tv series (longtext))\n" +
 27821  			"             │       └─ TableAlias(kt1)\n" +
 27822  			"             │           └─ Table\n" +
 27823  			"             │               ├─ name: kind_type\n" +
 27824  			"             │               ├─ columns: [id kind]\n" +
 27825  			"             │               ├─ colSet: (19,20)\n" +
 27826  			"             │               └─ tableId: 5\n" +
 27827  			"             └─ InnerJoin\n" +
 27828  			"                 ├─ AND\n" +
 27829  			"                 │   ├─ Eq\n" +
 27830  			"                 │   │   ├─ mi_idx1.movie_id:21!null\n" +
 27831  			"                 │   │   └─ mc1.movie_id:33!null\n" +
 27832  			"                 │   └─ Eq\n" +
 27833  			"                 │       ├─ ml.movie_id:11!null\n" +
 27834  			"                 │       └─ mc1.movie_id:33!null\n" +
 27835  			"                 ├─ InnerJoin\n" +
 27836  			"                 │   ├─ AND\n" +
 27837  			"                 │   │   ├─ Eq\n" +
 27838  			"                 │   │   │   ├─ ml.movie_id:11!null\n" +
 27839  			"                 │   │   │   └─ mi_idx1.movie_id:21!null\n" +
 27840  			"                 │   │   └─ Eq\n" +
 27841  			"                 │   │       ├─ ml.linked_movie_id:12!null\n" +
 27842  			"                 │   │       └─ mi_idx2.movie_id:16!null\n" +
 27843  			"                 │   ├─ InnerJoin\n" +
 27844  			"                 │   │   ├─ Eq\n" +
 27845  			"                 │   │   │   ├─ lt.id:14!null\n" +
 27846  			"                 │   │   │   └─ ml.link_type_id:13!null\n" +
 27847  			"                 │   │   ├─ TableAlias(ml)\n" +
 27848  			"                 │   │   │   └─ ProcessTable\n" +
 27849  			"                 │   │   │       └─ Table\n" +
 27850  			"                 │   │   │           ├─ name: movie_link\n" +
 27851  			"                 │   │   │           └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27852  			"                 │   │   └─ Filter\n" +
 27853  			"                 │   │       ├─ HashIn\n" +
 27854  			"                 │   │       │   ├─ lt.link:1!null\n" +
 27855  			"                 │   │       │   └─ TUPLE(sequel (longtext), follows (longtext), followed by (longtext))\n" +
 27856  			"                 │   │       └─ TableAlias(lt)\n" +
 27857  			"                 │   │           └─ ProcessTable\n" +
 27858  			"                 │   │               └─ Table\n" +
 27859  			"                 │   │                   ├─ name: link_type\n" +
 27860  			"                 │   │                   └─ columns: [id link]\n" +
 27861  			"                 │   └─ CrossJoin\n" +
 27862  			"                 │       ├─ InnerJoin\n" +
 27863  			"                 │       │   ├─ Eq\n" +
 27864  			"                 │       │   │   ├─ it2.id:19!null\n" +
 27865  			"                 │       │   │   └─ mi_idx2.info_type_id:17!null\n" +
 27866  			"                 │       │   ├─ Filter\n" +
 27867  			"                 │       │   │   ├─ LessThan\n" +
 27868  			"                 │       │   │   │   ├─ mi_idx2.info:2!null\n" +
 27869  			"                 │       │   │   │   └─ 3.0 (longtext)\n" +
 27870  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 27871  			"                 │       │   │       └─ ProcessTable\n" +
 27872  			"                 │       │   │           └─ Table\n" +
 27873  			"                 │       │   │               ├─ name: movie_info_idx\n" +
 27874  			"                 │       │   │               └─ columns: [movie_id info_type_id info]\n" +
 27875  			"                 │       │   └─ Filter\n" +
 27876  			"                 │       │       ├─ Eq\n" +
 27877  			"                 │       │       │   ├─ it2.info:1!null\n" +
 27878  			"                 │       │       │   └─ rating (longtext)\n" +
 27879  			"                 │       │       └─ TableAlias(it2)\n" +
 27880  			"                 │       │           └─ ProcessTable\n" +
 27881  			"                 │       │               └─ Table\n" +
 27882  			"                 │       │                   ├─ name: info_type\n" +
 27883  			"                 │       │                   └─ columns: [id info]\n" +
 27884  			"                 │       └─ CrossJoin\n" +
 27885  			"                 │           ├─ InnerJoin\n" +
 27886  			"                 │           │   ├─ Eq\n" +
 27887  			"                 │           │   │   ├─ it1.id:24!null\n" +
 27888  			"                 │           │   │   └─ mi_idx1.info_type_id:22!null\n" +
 27889  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 27890  			"                 │           │   │   └─ Table\n" +
 27891  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 27892  			"                 │           │   │       ├─ columns: [movie_id info_type_id info]\n" +
 27893  			"                 │           │   │       ├─ colSet: (35-39)\n" +
 27894  			"                 │           │   │       └─ tableId: 10\n" +
 27895  			"                 │           │   └─ Filter\n" +
 27896  			"                 │           │       ├─ Eq\n" +
 27897  			"                 │           │       │   ├─ it1.info:1!null\n" +
 27898  			"                 │           │       │   └─ rating (longtext)\n" +
 27899  			"                 │           │       └─ TableAlias(it1)\n" +
 27900  			"                 │           │           └─ Table\n" +
 27901  			"                 │           │               ├─ name: info_type\n" +
 27902  			"                 │           │               ├─ columns: [id info]\n" +
 27903  			"                 │           │               ├─ colSet: (15,16)\n" +
 27904  			"                 │           │               └─ tableId: 3\n" +
 27905  			"                 │           └─ CrossJoin\n" +
 27906  			"                 │               ├─ InnerJoin\n" +
 27907  			"                 │               │   ├─ Eq\n" +
 27908  			"                 │               │   │   ├─ cn2.id:28!null\n" +
 27909  			"                 │               │   │   └─ mc2.company_id:27!null\n" +
 27910  			"                 │               │   ├─ TableAlias(mc2)\n" +
 27911  			"                 │               │   │   └─ ProcessTable\n" +
 27912  			"                 │               │   │       └─ Table\n" +
 27913  			"                 │               │   │           ├─ name: movie_companies\n" +
 27914  			"                 │               │   │           └─ columns: [movie_id company_id]\n" +
 27915  			"                 │               │   └─ TableAlias(cn2)\n" +
 27916  			"                 │               │       └─ ProcessTable\n" +
 27917  			"                 │               │           └─ Table\n" +
 27918  			"                 │               │               ├─ name: company_name\n" +
 27919  			"                 │               │               └─ columns: [id name]\n" +
 27920  			"                 │               └─ Filter\n" +
 27921  			"                 │                   ├─ Eq\n" +
 27922  			"                 │                   │   ├─ cn1.country_code:2\n" +
 27923  			"                 │                   │   └─ [us] (longtext)\n" +
 27924  			"                 │                   └─ TableAlias(cn1)\n" +
 27925  			"                 │                       └─ Table\n" +
 27926  			"                 │                           ├─ name: company_name\n" +
 27927  			"                 │                           ├─ columns: [id name country_code]\n" +
 27928  			"                 │                           ├─ colSet: (1-7)\n" +
 27929  			"                 │                           └─ tableId: 1\n" +
 27930  			"                 └─ TableAlias(mc1)\n" +
 27931  			"                     └─ Table\n" +
 27932  			"                         ├─ name: movie_companies\n" +
 27933  			"                         ├─ columns: [movie_id company_id]\n" +
 27934  			"                         ├─ colSet: (25-29)\n" +
 27935  			"                         └─ tableId: 8\n" +
 27936  			"",
 27937  		ExpectedEstimates: "Project\n" +
 27938  			" ├─ columns: [min(cn1.name) as first_company, min(cn2.name) as second_company, min(mi_idx1.info) as first_rating, min(mi_idx2.info) as second_rating, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 27939  			" └─ GroupBy\n" +
 27940  			"     ├─ SelectedExprs(MIN(cn1.name), MIN(cn2.name), MIN(mi_idx1.info), MIN(mi_idx2.info), MIN(t1.title), MIN(t2.title))\n" +
 27941  			"     ├─ Grouping()\n" +
 27942  			"     └─ InnerJoin\n" +
 27943  			"         ├─ (((t2.id = ml.linked_movie_id) AND (t2.id = mi_idx2.movie_id)) AND (t2.id = mc2.movie_id))\n" +
 27944  			"         ├─ InnerJoin\n" +
 27945  			"         │   ├─ (kt2.id = t2.kind_id)\n" +
 27946  			"         │   ├─ Filter\n" +
 27947  			"         │   │   ├─ ((t2.production_year >= 2005) AND (t2.production_year <= 2008))\n" +
 27948  			"         │   │   └─ TableAlias(t2)\n" +
 27949  			"         │   │       └─ Table\n" +
 27950  			"         │   │           ├─ name: title\n" +
 27951  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
 27952  			"         │   └─ Filter\n" +
 27953  			"         │       ├─ (kt2.kind HASH IN ('tv series'))\n" +
 27954  			"         │       └─ TableAlias(kt2)\n" +
 27955  			"         │           └─ Table\n" +
 27956  			"         │               ├─ name: kind_type\n" +
 27957  			"         │               └─ columns: [id kind]\n" +
 27958  			"         └─ InnerJoin\n" +
 27959  			"             ├─ (((t1.id = ml.movie_id) AND (t1.id = mi_idx1.movie_id)) AND (t1.id = mc1.movie_id))\n" +
 27960  			"             ├─ InnerJoin\n" +
 27961  			"             │   ├─ (kt1.id = t1.kind_id)\n" +
 27962  			"             │   ├─ TableAlias(t1)\n" +
 27963  			"             │   │   └─ Table\n" +
 27964  			"             │   │       ├─ name: title\n" +
 27965  			"             │   │       └─ columns: [id title kind_id]\n" +
 27966  			"             │   └─ Filter\n" +
 27967  			"             │       ├─ (kt1.kind HASH IN ('tv series'))\n" +
 27968  			"             │       └─ TableAlias(kt1)\n" +
 27969  			"             │           └─ Table\n" +
 27970  			"             │               ├─ name: kind_type\n" +
 27971  			"             │               └─ columns: [id kind]\n" +
 27972  			"             └─ InnerJoin\n" +
 27973  			"                 ├─ ((mi_idx1.movie_id = mc1.movie_id) AND (ml.movie_id = mc1.movie_id))\n" +
 27974  			"                 ├─ InnerJoin\n" +
 27975  			"                 │   ├─ ((ml.movie_id = mi_idx1.movie_id) AND (ml.linked_movie_id = mi_idx2.movie_id))\n" +
 27976  			"                 │   ├─ InnerJoin\n" +
 27977  			"                 │   │   ├─ (lt.id = ml.link_type_id)\n" +
 27978  			"                 │   │   ├─ TableAlias(ml)\n" +
 27979  			"                 │   │   │   └─ Table\n" +
 27980  			"                 │   │   │       ├─ name: movie_link\n" +
 27981  			"                 │   │   │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 27982  			"                 │   │   └─ Filter\n" +
 27983  			"                 │   │       ├─ (lt.link HASH IN ('sequel', 'follows', 'followed by'))\n" +
 27984  			"                 │   │       └─ TableAlias(lt)\n" +
 27985  			"                 │   │           └─ Table\n" +
 27986  			"                 │   │               ├─ name: link_type\n" +
 27987  			"                 │   │               └─ columns: [id link]\n" +
 27988  			"                 │   └─ CrossJoin\n" +
 27989  			"                 │       ├─ InnerJoin\n" +
 27990  			"                 │       │   ├─ (it2.id = mi_idx2.info_type_id)\n" +
 27991  			"                 │       │   ├─ Filter\n" +
 27992  			"                 │       │   │   ├─ (mi_idx2.info < '3.0')\n" +
 27993  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 27994  			"                 │       │   │       └─ Table\n" +
 27995  			"                 │       │   │           ├─ name: movie_info_idx\n" +
 27996  			"                 │       │   │           └─ columns: [movie_id info_type_id info]\n" +
 27997  			"                 │       │   └─ Filter\n" +
 27998  			"                 │       │       ├─ (it2.info = 'rating')\n" +
 27999  			"                 │       │       └─ TableAlias(it2)\n" +
 28000  			"                 │       │           └─ Table\n" +
 28001  			"                 │       │               ├─ name: info_type\n" +
 28002  			"                 │       │               └─ columns: [id info]\n" +
 28003  			"                 │       └─ CrossJoin\n" +
 28004  			"                 │           ├─ InnerJoin\n" +
 28005  			"                 │           │   ├─ (it1.id = mi_idx1.info_type_id)\n" +
 28006  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28007  			"                 │           │   │   └─ Table\n" +
 28008  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28009  			"                 │           │   │       └─ columns: [movie_id info_type_id info]\n" +
 28010  			"                 │           │   └─ Filter\n" +
 28011  			"                 │           │       ├─ (it1.info = 'rating')\n" +
 28012  			"                 │           │       └─ TableAlias(it1)\n" +
 28013  			"                 │           │           └─ Table\n" +
 28014  			"                 │           │               ├─ name: info_type\n" +
 28015  			"                 │           │               └─ columns: [id info]\n" +
 28016  			"                 │           └─ CrossJoin\n" +
 28017  			"                 │               ├─ InnerJoin\n" +
 28018  			"                 │               │   ├─ (cn2.id = mc2.company_id)\n" +
 28019  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28020  			"                 │               │   │   └─ Table\n" +
 28021  			"                 │               │   │       ├─ name: movie_companies\n" +
 28022  			"                 │               │   │       └─ columns: [movie_id company_id]\n" +
 28023  			"                 │               │   └─ TableAlias(cn2)\n" +
 28024  			"                 │               │       └─ Table\n" +
 28025  			"                 │               │           ├─ name: company_name\n" +
 28026  			"                 │               │           └─ columns: [id name]\n" +
 28027  			"                 │               └─ Filter\n" +
 28028  			"                 │                   ├─ (cn1.country_code = '[us]')\n" +
 28029  			"                 │                   └─ TableAlias(cn1)\n" +
 28030  			"                 │                       └─ Table\n" +
 28031  			"                 │                           ├─ name: company_name\n" +
 28032  			"                 │                           └─ columns: [id name country_code]\n" +
 28033  			"                 └─ TableAlias(mc1)\n" +
 28034  			"                     └─ Table\n" +
 28035  			"                         ├─ name: movie_companies\n" +
 28036  			"                         └─ columns: [movie_id company_id]\n" +
 28037  			"",
 28038  		ExpectedAnalysis: "Project\n" +
 28039  			" ├─ columns: [min(cn1.name) as first_company, min(cn2.name) as second_company, min(mi_idx1.info) as first_rating, min(mi_idx2.info) as second_rating, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 28040  			" └─ GroupBy\n" +
 28041  			"     ├─ SelectedExprs(MIN(cn1.name), MIN(cn2.name), MIN(mi_idx1.info), MIN(mi_idx2.info), MIN(t1.title), MIN(t2.title))\n" +
 28042  			"     ├─ Grouping()\n" +
 28043  			"     └─ InnerJoin\n" +
 28044  			"         ├─ (((t2.id = ml.linked_movie_id) AND (t2.id = mi_idx2.movie_id)) AND (t2.id = mc2.movie_id))\n" +
 28045  			"         ├─ InnerJoin\n" +
 28046  			"         │   ├─ (kt2.id = t2.kind_id)\n" +
 28047  			"         │   ├─ Filter\n" +
 28048  			"         │   │   ├─ ((t2.production_year >= 2005) AND (t2.production_year <= 2008))\n" +
 28049  			"         │   │   └─ TableAlias(t2)\n" +
 28050  			"         │   │       └─ Table\n" +
 28051  			"         │   │           ├─ name: title\n" +
 28052  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
 28053  			"         │   └─ Filter\n" +
 28054  			"         │       ├─ (kt2.kind HASH IN ('tv series'))\n" +
 28055  			"         │       └─ TableAlias(kt2)\n" +
 28056  			"         │           └─ Table\n" +
 28057  			"         │               ├─ name: kind_type\n" +
 28058  			"         │               └─ columns: [id kind]\n" +
 28059  			"         └─ InnerJoin\n" +
 28060  			"             ├─ (((t1.id = ml.movie_id) AND (t1.id = mi_idx1.movie_id)) AND (t1.id = mc1.movie_id))\n" +
 28061  			"             ├─ InnerJoin\n" +
 28062  			"             │   ├─ (kt1.id = t1.kind_id)\n" +
 28063  			"             │   ├─ TableAlias(t1)\n" +
 28064  			"             │   │   └─ Table\n" +
 28065  			"             │   │       ├─ name: title\n" +
 28066  			"             │   │       └─ columns: [id title kind_id]\n" +
 28067  			"             │   └─ Filter\n" +
 28068  			"             │       ├─ (kt1.kind HASH IN ('tv series'))\n" +
 28069  			"             │       └─ TableAlias(kt1)\n" +
 28070  			"             │           └─ Table\n" +
 28071  			"             │               ├─ name: kind_type\n" +
 28072  			"             │               └─ columns: [id kind]\n" +
 28073  			"             └─ InnerJoin\n" +
 28074  			"                 ├─ ((mi_idx1.movie_id = mc1.movie_id) AND (ml.movie_id = mc1.movie_id))\n" +
 28075  			"                 ├─ InnerJoin\n" +
 28076  			"                 │   ├─ ((ml.movie_id = mi_idx1.movie_id) AND (ml.linked_movie_id = mi_idx2.movie_id))\n" +
 28077  			"                 │   ├─ InnerJoin\n" +
 28078  			"                 │   │   ├─ (lt.id = ml.link_type_id)\n" +
 28079  			"                 │   │   ├─ TableAlias(ml)\n" +
 28080  			"                 │   │   │   └─ Table\n" +
 28081  			"                 │   │   │       ├─ name: movie_link\n" +
 28082  			"                 │   │   │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 28083  			"                 │   │   └─ Filter\n" +
 28084  			"                 │   │       ├─ (lt.link HASH IN ('sequel', 'follows', 'followed by'))\n" +
 28085  			"                 │   │       └─ TableAlias(lt)\n" +
 28086  			"                 │   │           └─ Table\n" +
 28087  			"                 │   │               ├─ name: link_type\n" +
 28088  			"                 │   │               └─ columns: [id link]\n" +
 28089  			"                 │   └─ CrossJoin\n" +
 28090  			"                 │       ├─ InnerJoin\n" +
 28091  			"                 │       │   ├─ (it2.id = mi_idx2.info_type_id)\n" +
 28092  			"                 │       │   ├─ Filter\n" +
 28093  			"                 │       │   │   ├─ (mi_idx2.info < '3.0')\n" +
 28094  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 28095  			"                 │       │   │       └─ Table\n" +
 28096  			"                 │       │   │           ├─ name: movie_info_idx\n" +
 28097  			"                 │       │   │           └─ columns: [movie_id info_type_id info]\n" +
 28098  			"                 │       │   └─ Filter\n" +
 28099  			"                 │       │       ├─ (it2.info = 'rating')\n" +
 28100  			"                 │       │       └─ TableAlias(it2)\n" +
 28101  			"                 │       │           └─ Table\n" +
 28102  			"                 │       │               ├─ name: info_type\n" +
 28103  			"                 │       │               └─ columns: [id info]\n" +
 28104  			"                 │       └─ CrossJoin\n" +
 28105  			"                 │           ├─ InnerJoin\n" +
 28106  			"                 │           │   ├─ (it1.id = mi_idx1.info_type_id)\n" +
 28107  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28108  			"                 │           │   │   └─ Table\n" +
 28109  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28110  			"                 │           │   │       └─ columns: [movie_id info_type_id info]\n" +
 28111  			"                 │           │   └─ Filter\n" +
 28112  			"                 │           │       ├─ (it1.info = 'rating')\n" +
 28113  			"                 │           │       └─ TableAlias(it1)\n" +
 28114  			"                 │           │           └─ Table\n" +
 28115  			"                 │           │               ├─ name: info_type\n" +
 28116  			"                 │           │               └─ columns: [id info]\n" +
 28117  			"                 │           └─ CrossJoin\n" +
 28118  			"                 │               ├─ InnerJoin\n" +
 28119  			"                 │               │   ├─ (cn2.id = mc2.company_id)\n" +
 28120  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28121  			"                 │               │   │   └─ Table\n" +
 28122  			"                 │               │   │       ├─ name: movie_companies\n" +
 28123  			"                 │               │   │       └─ columns: [movie_id company_id]\n" +
 28124  			"                 │               │   └─ TableAlias(cn2)\n" +
 28125  			"                 │               │       └─ Table\n" +
 28126  			"                 │               │           ├─ name: company_name\n" +
 28127  			"                 │               │           └─ columns: [id name]\n" +
 28128  			"                 │               └─ Filter\n" +
 28129  			"                 │                   ├─ (cn1.country_code = '[us]')\n" +
 28130  			"                 │                   └─ TableAlias(cn1)\n" +
 28131  			"                 │                       └─ Table\n" +
 28132  			"                 │                           ├─ name: company_name\n" +
 28133  			"                 │                           └─ columns: [id name country_code]\n" +
 28134  			"                 └─ TableAlias(mc1)\n" +
 28135  			"                     └─ Table\n" +
 28136  			"                         ├─ name: movie_companies\n" +
 28137  			"                         └─ columns: [movie_id company_id]\n" +
 28138  			"",
 28139  	},
 28140  	{
 28141  		Query: `
 28142  SELECT MIN(cn1.name) AS first_company,
 28143         MIN(cn2.name) AS second_company,
 28144         MIN(mi_idx1.info) AS first_rating,
 28145         MIN(mi_idx2.info) AS second_rating,
 28146         MIN(t1.title) AS first_movie,
 28147         MIN(t2.title) AS second_movie
 28148  FROM company_name AS cn1,
 28149       company_name AS cn2,
 28150       info_type AS it1,
 28151       info_type AS it2,
 28152       kind_type AS kt1,
 28153       kind_type AS kt2,
 28154       link_type AS lt,
 28155       movie_companies AS mc1,
 28156       movie_companies AS mc2,
 28157       movie_info_idx AS mi_idx1,
 28158       movie_info_idx AS mi_idx2,
 28159       movie_link AS ml,
 28160       title AS t1,
 28161       title AS t2
 28162  WHERE cn1.country_code = '[nl]'
 28163    AND it1.info = 'rating'
 28164    AND it2.info = 'rating'
 28165    AND kt1.kind IN ('tv series')
 28166    AND kt2.kind IN ('tv series')
 28167    AND lt.link LIKE '%follow%'
 28168    AND mi_idx2.info < '3.0'
 28169    AND t2.production_year = 2007
 28170    AND lt.id = ml.link_type_id
 28171    AND t1.id = ml.movie_id
 28172    AND t2.id = ml.linked_movie_id
 28173    AND it1.id = mi_idx1.info_type_id
 28174    AND t1.id = mi_idx1.movie_id
 28175    AND kt1.id = t1.kind_id
 28176    AND cn1.id = mc1.company_id
 28177    AND t1.id = mc1.movie_id
 28178    AND ml.movie_id = mi_idx1.movie_id
 28179    AND ml.movie_id = mc1.movie_id
 28180    AND mi_idx1.movie_id = mc1.movie_id
 28181    AND it2.id = mi_idx2.info_type_id
 28182    AND t2.id = mi_idx2.movie_id
 28183    AND kt2.id = t2.kind_id
 28184    AND cn2.id = mc2.company_id
 28185    AND t2.id = mc2.movie_id
 28186    AND ml.linked_movie_id = mi_idx2.movie_id
 28187    AND ml.linked_movie_id = mc2.movie_id
 28188    AND mi_idx2.movie_id = mc2.movie_id;
 28189  
 28190  `,
 28191  		ExpectedPlan: "Project\n" +
 28192  			" ├─ columns: [min(cn1.name):0!null as first_company, min(cn2.name):1!null as second_company, min(mi_idx1.info):2!null as first_rating, min(mi_idx2.info):3!null as second_rating, min(t1.title):4!null as first_movie, min(t2.title):5!null as second_movie]\n" +
 28193  			" └─ GroupBy\n" +
 28194  			"     ├─ select: MIN(cn1.name:31!null), MIN(cn2.name:29!null), MIN(mi_idx1.info:23!null), MIN(mi_idx2.info:18!null), MIN(t1.title:7!null), MIN(t2.title:1!null)\n" +
 28195  			"     ├─ group: \n" +
 28196  			"     └─ InnerJoin\n" +
 28197  			"         ├─ AND\n" +
 28198  			"         │   ├─ AND\n" +
 28199  			"         │   │   ├─ Eq\n" +
 28200  			"         │   │   │   ├─ t2.id:0!null\n" +
 28201  			"         │   │   │   └─ ml.linked_movie_id:12!null\n" +
 28202  			"         │   │   └─ Eq\n" +
 28203  			"         │   │       ├─ t2.id:0!null\n" +
 28204  			"         │   │       └─ mi_idx2.movie_id:16!null\n" +
 28205  			"         │   └─ Eq\n" +
 28206  			"         │       ├─ t2.id:0!null\n" +
 28207  			"         │       └─ mc2.movie_id:26!null\n" +
 28208  			"         ├─ InnerJoin\n" +
 28209  			"         │   ├─ Eq\n" +
 28210  			"         │   │   ├─ kt2.id:4!null\n" +
 28211  			"         │   │   └─ t2.kind_id:2!null\n" +
 28212  			"         │   ├─ Filter\n" +
 28213  			"         │   │   ├─ Eq\n" +
 28214  			"         │   │   │   ├─ t2.production_year:3\n" +
 28215  			"         │   │   │   └─ 2007 (smallint)\n" +
 28216  			"         │   │   └─ TableAlias(t2)\n" +
 28217  			"         │   │       └─ ProcessTable\n" +
 28218  			"         │   │           └─ Table\n" +
 28219  			"         │   │               ├─ name: title\n" +
 28220  			"         │   │               └─ columns: [id title kind_id production_year]\n" +
 28221  			"         │   └─ Filter\n" +
 28222  			"         │       ├─ HashIn\n" +
 28223  			"         │       │   ├─ kt2.kind:1!null\n" +
 28224  			"         │       │   └─ TUPLE(tv series (longtext))\n" +
 28225  			"         │       └─ TableAlias(kt2)\n" +
 28226  			"         │           └─ ProcessTable\n" +
 28227  			"         │               └─ Table\n" +
 28228  			"         │                   ├─ name: kind_type\n" +
 28229  			"         │                   └─ columns: [id kind]\n" +
 28230  			"         └─ InnerJoin\n" +
 28231  			"             ├─ AND\n" +
 28232  			"             │   ├─ AND\n" +
 28233  			"             │   │   ├─ Eq\n" +
 28234  			"             │   │   │   ├─ t1.id:6!null\n" +
 28235  			"             │   │   │   └─ ml.movie_id:11!null\n" +
 28236  			"             │   │   └─ Eq\n" +
 28237  			"             │   │       ├─ t1.id:6!null\n" +
 28238  			"             │   │       └─ mi_idx1.movie_id:21!null\n" +
 28239  			"             │   └─ Eq\n" +
 28240  			"             │       ├─ t1.id:6!null\n" +
 28241  			"             │       └─ mc1.movie_id:33!null\n" +
 28242  			"             ├─ InnerJoin\n" +
 28243  			"             │   ├─ Eq\n" +
 28244  			"             │   │   ├─ kt1.id:9!null\n" +
 28245  			"             │   │   └─ t1.kind_id:8!null\n" +
 28246  			"             │   ├─ TableAlias(t1)\n" +
 28247  			"             │   │   └─ Table\n" +
 28248  			"             │   │       ├─ name: title\n" +
 28249  			"             │   │       ├─ columns: [id title kind_id]\n" +
 28250  			"             │   │       ├─ colSet: (49-60)\n" +
 28251  			"             │   │       └─ tableId: 13\n" +
 28252  			"             │   └─ Filter\n" +
 28253  			"             │       ├─ HashIn\n" +
 28254  			"             │       │   ├─ kt1.kind:1!null\n" +
 28255  			"             │       │   └─ TUPLE(tv series (longtext))\n" +
 28256  			"             │       └─ TableAlias(kt1)\n" +
 28257  			"             │           └─ Table\n" +
 28258  			"             │               ├─ name: kind_type\n" +
 28259  			"             │               ├─ columns: [id kind]\n" +
 28260  			"             │               ├─ colSet: (19,20)\n" +
 28261  			"             │               └─ tableId: 5\n" +
 28262  			"             └─ InnerJoin\n" +
 28263  			"                 ├─ AND\n" +
 28264  			"                 │   ├─ Eq\n" +
 28265  			"                 │   │   ├─ mi_idx1.movie_id:21!null\n" +
 28266  			"                 │   │   └─ mc1.movie_id:33!null\n" +
 28267  			"                 │   └─ Eq\n" +
 28268  			"                 │       ├─ ml.movie_id:11!null\n" +
 28269  			"                 │       └─ mc1.movie_id:33!null\n" +
 28270  			"                 ├─ InnerJoin\n" +
 28271  			"                 │   ├─ AND\n" +
 28272  			"                 │   │   ├─ Eq\n" +
 28273  			"                 │   │   │   ├─ ml.movie_id:11!null\n" +
 28274  			"                 │   │   │   └─ mi_idx1.movie_id:21!null\n" +
 28275  			"                 │   │   └─ Eq\n" +
 28276  			"                 │   │       ├─ ml.linked_movie_id:12!null\n" +
 28277  			"                 │   │       └─ mi_idx2.movie_id:16!null\n" +
 28278  			"                 │   ├─ InnerJoin\n" +
 28279  			"                 │   │   ├─ Eq\n" +
 28280  			"                 │   │   │   ├─ lt.id:14!null\n" +
 28281  			"                 │   │   │   └─ ml.link_type_id:13!null\n" +
 28282  			"                 │   │   ├─ TableAlias(ml)\n" +
 28283  			"                 │   │   │   └─ ProcessTable\n" +
 28284  			"                 │   │   │       └─ Table\n" +
 28285  			"                 │   │   │           ├─ name: movie_link\n" +
 28286  			"                 │   │   │           └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 28287  			"                 │   │   └─ Filter\n" +
 28288  			"                 │   │       ├─ lt.link LIKE '%follow%'\n" +
 28289  			"                 │   │       └─ TableAlias(lt)\n" +
 28290  			"                 │   │           └─ ProcessTable\n" +
 28291  			"                 │   │               └─ Table\n" +
 28292  			"                 │   │                   ├─ name: link_type\n" +
 28293  			"                 │   │                   └─ columns: [id link]\n" +
 28294  			"                 │   └─ CrossJoin\n" +
 28295  			"                 │       ├─ InnerJoin\n" +
 28296  			"                 │       │   ├─ Eq\n" +
 28297  			"                 │       │   │   ├─ it2.id:19!null\n" +
 28298  			"                 │       │   │   └─ mi_idx2.info_type_id:17!null\n" +
 28299  			"                 │       │   ├─ Filter\n" +
 28300  			"                 │       │   │   ├─ LessThan\n" +
 28301  			"                 │       │   │   │   ├─ mi_idx2.info:2!null\n" +
 28302  			"                 │       │   │   │   └─ 3.0 (longtext)\n" +
 28303  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 28304  			"                 │       │   │       └─ ProcessTable\n" +
 28305  			"                 │       │   │           └─ Table\n" +
 28306  			"                 │       │   │               ├─ name: movie_info_idx\n" +
 28307  			"                 │       │   │               └─ columns: [movie_id info_type_id info]\n" +
 28308  			"                 │       │   └─ Filter\n" +
 28309  			"                 │       │       ├─ Eq\n" +
 28310  			"                 │       │       │   ├─ it2.info:1!null\n" +
 28311  			"                 │       │       │   └─ rating (longtext)\n" +
 28312  			"                 │       │       └─ TableAlias(it2)\n" +
 28313  			"                 │       │           └─ ProcessTable\n" +
 28314  			"                 │       │               └─ Table\n" +
 28315  			"                 │       │                   ├─ name: info_type\n" +
 28316  			"                 │       │                   └─ columns: [id info]\n" +
 28317  			"                 │       └─ CrossJoin\n" +
 28318  			"                 │           ├─ InnerJoin\n" +
 28319  			"                 │           │   ├─ Eq\n" +
 28320  			"                 │           │   │   ├─ it1.id:24!null\n" +
 28321  			"                 │           │   │   └─ mi_idx1.info_type_id:22!null\n" +
 28322  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28323  			"                 │           │   │   └─ Table\n" +
 28324  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28325  			"                 │           │   │       ├─ columns: [movie_id info_type_id info]\n" +
 28326  			"                 │           │   │       ├─ colSet: (35-39)\n" +
 28327  			"                 │           │   │       └─ tableId: 10\n" +
 28328  			"                 │           │   └─ Filter\n" +
 28329  			"                 │           │       ├─ Eq\n" +
 28330  			"                 │           │       │   ├─ it1.info:1!null\n" +
 28331  			"                 │           │       │   └─ rating (longtext)\n" +
 28332  			"                 │           │       └─ TableAlias(it1)\n" +
 28333  			"                 │           │           └─ Table\n" +
 28334  			"                 │           │               ├─ name: info_type\n" +
 28335  			"                 │           │               ├─ columns: [id info]\n" +
 28336  			"                 │           │               ├─ colSet: (15,16)\n" +
 28337  			"                 │           │               └─ tableId: 3\n" +
 28338  			"                 │           └─ CrossJoin\n" +
 28339  			"                 │               ├─ InnerJoin\n" +
 28340  			"                 │               │   ├─ Eq\n" +
 28341  			"                 │               │   │   ├─ cn2.id:28!null\n" +
 28342  			"                 │               │   │   └─ mc2.company_id:27!null\n" +
 28343  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28344  			"                 │               │   │   └─ ProcessTable\n" +
 28345  			"                 │               │   │       └─ Table\n" +
 28346  			"                 │               │   │           ├─ name: movie_companies\n" +
 28347  			"                 │               │   │           └─ columns: [movie_id company_id]\n" +
 28348  			"                 │               │   └─ TableAlias(cn2)\n" +
 28349  			"                 │               │       └─ ProcessTable\n" +
 28350  			"                 │               │           └─ Table\n" +
 28351  			"                 │               │               ├─ name: company_name\n" +
 28352  			"                 │               │               └─ columns: [id name]\n" +
 28353  			"                 │               └─ Filter\n" +
 28354  			"                 │                   ├─ Eq\n" +
 28355  			"                 │                   │   ├─ cn1.country_code:2\n" +
 28356  			"                 │                   │   └─ [nl] (longtext)\n" +
 28357  			"                 │                   └─ TableAlias(cn1)\n" +
 28358  			"                 │                       └─ Table\n" +
 28359  			"                 │                           ├─ name: company_name\n" +
 28360  			"                 │                           ├─ columns: [id name country_code]\n" +
 28361  			"                 │                           ├─ colSet: (1-7)\n" +
 28362  			"                 │                           └─ tableId: 1\n" +
 28363  			"                 └─ TableAlias(mc1)\n" +
 28364  			"                     └─ Table\n" +
 28365  			"                         ├─ name: movie_companies\n" +
 28366  			"                         ├─ columns: [movie_id company_id]\n" +
 28367  			"                         ├─ colSet: (25-29)\n" +
 28368  			"                         └─ tableId: 8\n" +
 28369  			"",
 28370  		ExpectedEstimates: "Project\n" +
 28371  			" ├─ columns: [min(cn1.name) as first_company, min(cn2.name) as second_company, min(mi_idx1.info) as first_rating, min(mi_idx2.info) as second_rating, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 28372  			" └─ GroupBy\n" +
 28373  			"     ├─ SelectedExprs(MIN(cn1.name), MIN(cn2.name), MIN(mi_idx1.info), MIN(mi_idx2.info), MIN(t1.title), MIN(t2.title))\n" +
 28374  			"     ├─ Grouping()\n" +
 28375  			"     └─ InnerJoin\n" +
 28376  			"         ├─ (((t2.id = ml.linked_movie_id) AND (t2.id = mi_idx2.movie_id)) AND (t2.id = mc2.movie_id))\n" +
 28377  			"         ├─ InnerJoin\n" +
 28378  			"         │   ├─ (kt2.id = t2.kind_id)\n" +
 28379  			"         │   ├─ Filter\n" +
 28380  			"         │   │   ├─ (t2.production_year = 2007)\n" +
 28381  			"         │   │   └─ TableAlias(t2)\n" +
 28382  			"         │   │       └─ Table\n" +
 28383  			"         │   │           ├─ name: title\n" +
 28384  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
 28385  			"         │   └─ Filter\n" +
 28386  			"         │       ├─ (kt2.kind HASH IN ('tv series'))\n" +
 28387  			"         │       └─ TableAlias(kt2)\n" +
 28388  			"         │           └─ Table\n" +
 28389  			"         │               ├─ name: kind_type\n" +
 28390  			"         │               └─ columns: [id kind]\n" +
 28391  			"         └─ InnerJoin\n" +
 28392  			"             ├─ (((t1.id = ml.movie_id) AND (t1.id = mi_idx1.movie_id)) AND (t1.id = mc1.movie_id))\n" +
 28393  			"             ├─ InnerJoin\n" +
 28394  			"             │   ├─ (kt1.id = t1.kind_id)\n" +
 28395  			"             │   ├─ TableAlias(t1)\n" +
 28396  			"             │   │   └─ Table\n" +
 28397  			"             │   │       ├─ name: title\n" +
 28398  			"             │   │       └─ columns: [id title kind_id]\n" +
 28399  			"             │   └─ Filter\n" +
 28400  			"             │       ├─ (kt1.kind HASH IN ('tv series'))\n" +
 28401  			"             │       └─ TableAlias(kt1)\n" +
 28402  			"             │           └─ Table\n" +
 28403  			"             │               ├─ name: kind_type\n" +
 28404  			"             │               └─ columns: [id kind]\n" +
 28405  			"             └─ InnerJoin\n" +
 28406  			"                 ├─ ((mi_idx1.movie_id = mc1.movie_id) AND (ml.movie_id = mc1.movie_id))\n" +
 28407  			"                 ├─ InnerJoin\n" +
 28408  			"                 │   ├─ ((ml.movie_id = mi_idx1.movie_id) AND (ml.linked_movie_id = mi_idx2.movie_id))\n" +
 28409  			"                 │   ├─ InnerJoin\n" +
 28410  			"                 │   │   ├─ (lt.id = ml.link_type_id)\n" +
 28411  			"                 │   │   ├─ TableAlias(ml)\n" +
 28412  			"                 │   │   │   └─ Table\n" +
 28413  			"                 │   │   │       ├─ name: movie_link\n" +
 28414  			"                 │   │   │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 28415  			"                 │   │   └─ Filter\n" +
 28416  			"                 │   │       ├─ lt.link LIKE '%follow%'\n" +
 28417  			"                 │   │       └─ TableAlias(lt)\n" +
 28418  			"                 │   │           └─ Table\n" +
 28419  			"                 │   │               ├─ name: link_type\n" +
 28420  			"                 │   │               └─ columns: [id link]\n" +
 28421  			"                 │   └─ CrossJoin\n" +
 28422  			"                 │       ├─ InnerJoin\n" +
 28423  			"                 │       │   ├─ (it2.id = mi_idx2.info_type_id)\n" +
 28424  			"                 │       │   ├─ Filter\n" +
 28425  			"                 │       │   │   ├─ (mi_idx2.info < '3.0')\n" +
 28426  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 28427  			"                 │       │   │       └─ Table\n" +
 28428  			"                 │       │   │           ├─ name: movie_info_idx\n" +
 28429  			"                 │       │   │           └─ columns: [movie_id info_type_id info]\n" +
 28430  			"                 │       │   └─ Filter\n" +
 28431  			"                 │       │       ├─ (it2.info = 'rating')\n" +
 28432  			"                 │       │       └─ TableAlias(it2)\n" +
 28433  			"                 │       │           └─ Table\n" +
 28434  			"                 │       │               ├─ name: info_type\n" +
 28435  			"                 │       │               └─ columns: [id info]\n" +
 28436  			"                 │       └─ CrossJoin\n" +
 28437  			"                 │           ├─ InnerJoin\n" +
 28438  			"                 │           │   ├─ (it1.id = mi_idx1.info_type_id)\n" +
 28439  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28440  			"                 │           │   │   └─ Table\n" +
 28441  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28442  			"                 │           │   │       └─ columns: [movie_id info_type_id info]\n" +
 28443  			"                 │           │   └─ Filter\n" +
 28444  			"                 │           │       ├─ (it1.info = 'rating')\n" +
 28445  			"                 │           │       └─ TableAlias(it1)\n" +
 28446  			"                 │           │           └─ Table\n" +
 28447  			"                 │           │               ├─ name: info_type\n" +
 28448  			"                 │           │               └─ columns: [id info]\n" +
 28449  			"                 │           └─ CrossJoin\n" +
 28450  			"                 │               ├─ InnerJoin\n" +
 28451  			"                 │               │   ├─ (cn2.id = mc2.company_id)\n" +
 28452  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28453  			"                 │               │   │   └─ Table\n" +
 28454  			"                 │               │   │       ├─ name: movie_companies\n" +
 28455  			"                 │               │   │       └─ columns: [movie_id company_id]\n" +
 28456  			"                 │               │   └─ TableAlias(cn2)\n" +
 28457  			"                 │               │       └─ Table\n" +
 28458  			"                 │               │           ├─ name: company_name\n" +
 28459  			"                 │               │           └─ columns: [id name]\n" +
 28460  			"                 │               └─ Filter\n" +
 28461  			"                 │                   ├─ (cn1.country_code = '[nl]')\n" +
 28462  			"                 │                   └─ TableAlias(cn1)\n" +
 28463  			"                 │                       └─ Table\n" +
 28464  			"                 │                           ├─ name: company_name\n" +
 28465  			"                 │                           └─ columns: [id name country_code]\n" +
 28466  			"                 └─ TableAlias(mc1)\n" +
 28467  			"                     └─ Table\n" +
 28468  			"                         ├─ name: movie_companies\n" +
 28469  			"                         └─ columns: [movie_id company_id]\n" +
 28470  			"",
 28471  		ExpectedAnalysis: "Project\n" +
 28472  			" ├─ columns: [min(cn1.name) as first_company, min(cn2.name) as second_company, min(mi_idx1.info) as first_rating, min(mi_idx2.info) as second_rating, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 28473  			" └─ GroupBy\n" +
 28474  			"     ├─ SelectedExprs(MIN(cn1.name), MIN(cn2.name), MIN(mi_idx1.info), MIN(mi_idx2.info), MIN(t1.title), MIN(t2.title))\n" +
 28475  			"     ├─ Grouping()\n" +
 28476  			"     └─ InnerJoin\n" +
 28477  			"         ├─ (((t2.id = ml.linked_movie_id) AND (t2.id = mi_idx2.movie_id)) AND (t2.id = mc2.movie_id))\n" +
 28478  			"         ├─ InnerJoin\n" +
 28479  			"         │   ├─ (kt2.id = t2.kind_id)\n" +
 28480  			"         │   ├─ Filter\n" +
 28481  			"         │   │   ├─ (t2.production_year = 2007)\n" +
 28482  			"         │   │   └─ TableAlias(t2)\n" +
 28483  			"         │   │       └─ Table\n" +
 28484  			"         │   │           ├─ name: title\n" +
 28485  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
 28486  			"         │   └─ Filter\n" +
 28487  			"         │       ├─ (kt2.kind HASH IN ('tv series'))\n" +
 28488  			"         │       └─ TableAlias(kt2)\n" +
 28489  			"         │           └─ Table\n" +
 28490  			"         │               ├─ name: kind_type\n" +
 28491  			"         │               └─ columns: [id kind]\n" +
 28492  			"         └─ InnerJoin\n" +
 28493  			"             ├─ (((t1.id = ml.movie_id) AND (t1.id = mi_idx1.movie_id)) AND (t1.id = mc1.movie_id))\n" +
 28494  			"             ├─ InnerJoin\n" +
 28495  			"             │   ├─ (kt1.id = t1.kind_id)\n" +
 28496  			"             │   ├─ TableAlias(t1)\n" +
 28497  			"             │   │   └─ Table\n" +
 28498  			"             │   │       ├─ name: title\n" +
 28499  			"             │   │       └─ columns: [id title kind_id]\n" +
 28500  			"             │   └─ Filter\n" +
 28501  			"             │       ├─ (kt1.kind HASH IN ('tv series'))\n" +
 28502  			"             │       └─ TableAlias(kt1)\n" +
 28503  			"             │           └─ Table\n" +
 28504  			"             │               ├─ name: kind_type\n" +
 28505  			"             │               └─ columns: [id kind]\n" +
 28506  			"             └─ InnerJoin\n" +
 28507  			"                 ├─ ((mi_idx1.movie_id = mc1.movie_id) AND (ml.movie_id = mc1.movie_id))\n" +
 28508  			"                 ├─ InnerJoin\n" +
 28509  			"                 │   ├─ ((ml.movie_id = mi_idx1.movie_id) AND (ml.linked_movie_id = mi_idx2.movie_id))\n" +
 28510  			"                 │   ├─ InnerJoin\n" +
 28511  			"                 │   │   ├─ (lt.id = ml.link_type_id)\n" +
 28512  			"                 │   │   ├─ TableAlias(ml)\n" +
 28513  			"                 │   │   │   └─ Table\n" +
 28514  			"                 │   │   │       ├─ name: movie_link\n" +
 28515  			"                 │   │   │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 28516  			"                 │   │   └─ Filter\n" +
 28517  			"                 │   │       ├─ lt.link LIKE '%follow%'\n" +
 28518  			"                 │   │       └─ TableAlias(lt)\n" +
 28519  			"                 │   │           └─ Table\n" +
 28520  			"                 │   │               ├─ name: link_type\n" +
 28521  			"                 │   │               └─ columns: [id link]\n" +
 28522  			"                 │   └─ CrossJoin\n" +
 28523  			"                 │       ├─ InnerJoin\n" +
 28524  			"                 │       │   ├─ (it2.id = mi_idx2.info_type_id)\n" +
 28525  			"                 │       │   ├─ Filter\n" +
 28526  			"                 │       │   │   ├─ (mi_idx2.info < '3.0')\n" +
 28527  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 28528  			"                 │       │   │       └─ Table\n" +
 28529  			"                 │       │   │           ├─ name: movie_info_idx\n" +
 28530  			"                 │       │   │           └─ columns: [movie_id info_type_id info]\n" +
 28531  			"                 │       │   └─ Filter\n" +
 28532  			"                 │       │       ├─ (it2.info = 'rating')\n" +
 28533  			"                 │       │       └─ TableAlias(it2)\n" +
 28534  			"                 │       │           └─ Table\n" +
 28535  			"                 │       │               ├─ name: info_type\n" +
 28536  			"                 │       │               └─ columns: [id info]\n" +
 28537  			"                 │       └─ CrossJoin\n" +
 28538  			"                 │           ├─ InnerJoin\n" +
 28539  			"                 │           │   ├─ (it1.id = mi_idx1.info_type_id)\n" +
 28540  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28541  			"                 │           │   │   └─ Table\n" +
 28542  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28543  			"                 │           │   │       └─ columns: [movie_id info_type_id info]\n" +
 28544  			"                 │           │   └─ Filter\n" +
 28545  			"                 │           │       ├─ (it1.info = 'rating')\n" +
 28546  			"                 │           │       └─ TableAlias(it1)\n" +
 28547  			"                 │           │           └─ Table\n" +
 28548  			"                 │           │               ├─ name: info_type\n" +
 28549  			"                 │           │               └─ columns: [id info]\n" +
 28550  			"                 │           └─ CrossJoin\n" +
 28551  			"                 │               ├─ InnerJoin\n" +
 28552  			"                 │               │   ├─ (cn2.id = mc2.company_id)\n" +
 28553  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28554  			"                 │               │   │   └─ Table\n" +
 28555  			"                 │               │   │       ├─ name: movie_companies\n" +
 28556  			"                 │               │   │       └─ columns: [movie_id company_id]\n" +
 28557  			"                 │               │   └─ TableAlias(cn2)\n" +
 28558  			"                 │               │       └─ Table\n" +
 28559  			"                 │               │           ├─ name: company_name\n" +
 28560  			"                 │               │           └─ columns: [id name]\n" +
 28561  			"                 │               └─ Filter\n" +
 28562  			"                 │                   ├─ (cn1.country_code = '[nl]')\n" +
 28563  			"                 │                   └─ TableAlias(cn1)\n" +
 28564  			"                 │                       └─ Table\n" +
 28565  			"                 │                           ├─ name: company_name\n" +
 28566  			"                 │                           └─ columns: [id name country_code]\n" +
 28567  			"                 └─ TableAlias(mc1)\n" +
 28568  			"                     └─ Table\n" +
 28569  			"                         ├─ name: movie_companies\n" +
 28570  			"                         └─ columns: [movie_id company_id]\n" +
 28571  			"",
 28572  	},
 28573  	{
 28574  		Query: `
 28575  SELECT MIN(cn1.name) AS first_company,
 28576         MIN(cn2.name) AS second_company,
 28577         MIN(mi_idx1.info) AS first_rating,
 28578         MIN(mi_idx2.info) AS second_rating,
 28579         MIN(t1.title) AS first_movie,
 28580         MIN(t2.title) AS second_movie
 28581  FROM company_name AS cn1,
 28582       company_name AS cn2,
 28583       info_type AS it1,
 28584       info_type AS it2,
 28585       kind_type AS kt1,
 28586       kind_type AS kt2,
 28587       link_type AS lt,
 28588       movie_companies AS mc1,
 28589       movie_companies AS mc2,
 28590       movie_info_idx AS mi_idx1,
 28591       movie_info_idx AS mi_idx2,
 28592       movie_link AS ml,
 28593       title AS t1,
 28594       title AS t2
 28595  WHERE cn1.country_code != '[us]'
 28596    AND it1.info = 'rating'
 28597    AND it2.info = 'rating'
 28598    AND kt1.kind IN ('tv series',
 28599                     'episode')
 28600    AND kt2.kind IN ('tv series',
 28601                     'episode')
 28602    AND lt.link IN ('sequel',
 28603                    'follows',
 28604                    'followed by')
 28605    AND mi_idx2.info < '3.5'
 28606    AND t2.production_year BETWEEN 2000 AND 2010
 28607    AND lt.id = ml.link_type_id
 28608    AND t1.id = ml.movie_id
 28609    AND t2.id = ml.linked_movie_id
 28610    AND it1.id = mi_idx1.info_type_id
 28611    AND t1.id = mi_idx1.movie_id
 28612    AND kt1.id = t1.kind_id
 28613    AND cn1.id = mc1.company_id
 28614    AND t1.id = mc1.movie_id
 28615    AND ml.movie_id = mi_idx1.movie_id
 28616    AND ml.movie_id = mc1.movie_id
 28617    AND mi_idx1.movie_id = mc1.movie_id
 28618    AND it2.id = mi_idx2.info_type_id
 28619    AND t2.id = mi_idx2.movie_id
 28620    AND kt2.id = t2.kind_id
 28621    AND cn2.id = mc2.company_id
 28622    AND t2.id = mc2.movie_id
 28623    AND ml.linked_movie_id = mi_idx2.movie_id
 28624    AND ml.linked_movie_id = mc2.movie_id
 28625    AND mi_idx2.movie_id = mc2.movie_id;
 28626  
 28627  `,
 28628  		ExpectedPlan: "Project\n" +
 28629  			" ├─ columns: [min(cn1.name):0!null as first_company, min(cn2.name):1!null as second_company, min(mi_idx1.info):2!null as first_rating, min(mi_idx2.info):3!null as second_rating, min(t1.title):4!null as first_movie, min(t2.title):5!null as second_movie]\n" +
 28630  			" └─ GroupBy\n" +
 28631  			"     ├─ select: MIN(cn1.name:31!null), MIN(cn2.name:29!null), MIN(mi_idx1.info:23!null), MIN(mi_idx2.info:18!null), MIN(t1.title:7!null), MIN(t2.title:1!null)\n" +
 28632  			"     ├─ group: \n" +
 28633  			"     └─ InnerJoin\n" +
 28634  			"         ├─ AND\n" +
 28635  			"         │   ├─ AND\n" +
 28636  			"         │   │   ├─ Eq\n" +
 28637  			"         │   │   │   ├─ t2.id:0!null\n" +
 28638  			"         │   │   │   └─ ml.linked_movie_id:12!null\n" +
 28639  			"         │   │   └─ Eq\n" +
 28640  			"         │   │       ├─ t2.id:0!null\n" +
 28641  			"         │   │       └─ mi_idx2.movie_id:16!null\n" +
 28642  			"         │   └─ Eq\n" +
 28643  			"         │       ├─ t2.id:0!null\n" +
 28644  			"         │       └─ mc2.movie_id:26!null\n" +
 28645  			"         ├─ InnerJoin\n" +
 28646  			"         │   ├─ Eq\n" +
 28647  			"         │   │   ├─ kt2.id:4!null\n" +
 28648  			"         │   │   └─ t2.kind_id:2!null\n" +
 28649  			"         │   ├─ Filter\n" +
 28650  			"         │   │   ├─ AND\n" +
 28651  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
 28652  			"         │   │   │   │   ├─ t2.production_year:3\n" +
 28653  			"         │   │   │   │   └─ 2000 (smallint)\n" +
 28654  			"         │   │   │   └─ LessThanOrEqual\n" +
 28655  			"         │   │   │       ├─ t2.production_year:3\n" +
 28656  			"         │   │   │       └─ 2010 (smallint)\n" +
 28657  			"         │   │   └─ TableAlias(t2)\n" +
 28658  			"         │   │       └─ ProcessTable\n" +
 28659  			"         │   │           └─ Table\n" +
 28660  			"         │   │               ├─ name: title\n" +
 28661  			"         │   │               └─ columns: [id title kind_id production_year]\n" +
 28662  			"         │   └─ Filter\n" +
 28663  			"         │       ├─ HashIn\n" +
 28664  			"         │       │   ├─ kt2.kind:1!null\n" +
 28665  			"         │       │   └─ TUPLE(tv series (longtext), episode (longtext))\n" +
 28666  			"         │       └─ TableAlias(kt2)\n" +
 28667  			"         │           └─ ProcessTable\n" +
 28668  			"         │               └─ Table\n" +
 28669  			"         │                   ├─ name: kind_type\n" +
 28670  			"         │                   └─ columns: [id kind]\n" +
 28671  			"         └─ InnerJoin\n" +
 28672  			"             ├─ AND\n" +
 28673  			"             │   ├─ AND\n" +
 28674  			"             │   │   ├─ Eq\n" +
 28675  			"             │   │   │   ├─ t1.id:6!null\n" +
 28676  			"             │   │   │   └─ ml.movie_id:11!null\n" +
 28677  			"             │   │   └─ Eq\n" +
 28678  			"             │   │       ├─ t1.id:6!null\n" +
 28679  			"             │   │       └─ mi_idx1.movie_id:21!null\n" +
 28680  			"             │   └─ Eq\n" +
 28681  			"             │       ├─ t1.id:6!null\n" +
 28682  			"             │       └─ mc1.movie_id:33!null\n" +
 28683  			"             ├─ InnerJoin\n" +
 28684  			"             │   ├─ Eq\n" +
 28685  			"             │   │   ├─ kt1.id:9!null\n" +
 28686  			"             │   │   └─ t1.kind_id:8!null\n" +
 28687  			"             │   ├─ TableAlias(t1)\n" +
 28688  			"             │   │   └─ Table\n" +
 28689  			"             │   │       ├─ name: title\n" +
 28690  			"             │   │       ├─ columns: [id title kind_id]\n" +
 28691  			"             │   │       ├─ colSet: (49-60)\n" +
 28692  			"             │   │       └─ tableId: 13\n" +
 28693  			"             │   └─ Filter\n" +
 28694  			"             │       ├─ HashIn\n" +
 28695  			"             │       │   ├─ kt1.kind:1!null\n" +
 28696  			"             │       │   └─ TUPLE(tv series (longtext), episode (longtext))\n" +
 28697  			"             │       └─ TableAlias(kt1)\n" +
 28698  			"             │           └─ Table\n" +
 28699  			"             │               ├─ name: kind_type\n" +
 28700  			"             │               ├─ columns: [id kind]\n" +
 28701  			"             │               ├─ colSet: (19,20)\n" +
 28702  			"             │               └─ tableId: 5\n" +
 28703  			"             └─ InnerJoin\n" +
 28704  			"                 ├─ AND\n" +
 28705  			"                 │   ├─ Eq\n" +
 28706  			"                 │   │   ├─ mi_idx1.movie_id:21!null\n" +
 28707  			"                 │   │   └─ mc1.movie_id:33!null\n" +
 28708  			"                 │   └─ Eq\n" +
 28709  			"                 │       ├─ ml.movie_id:11!null\n" +
 28710  			"                 │       └─ mc1.movie_id:33!null\n" +
 28711  			"                 ├─ InnerJoin\n" +
 28712  			"                 │   ├─ AND\n" +
 28713  			"                 │   │   ├─ Eq\n" +
 28714  			"                 │   │   │   ├─ ml.movie_id:11!null\n" +
 28715  			"                 │   │   │   └─ mi_idx1.movie_id:21!null\n" +
 28716  			"                 │   │   └─ Eq\n" +
 28717  			"                 │   │       ├─ ml.linked_movie_id:12!null\n" +
 28718  			"                 │   │       └─ mi_idx2.movie_id:16!null\n" +
 28719  			"                 │   ├─ InnerJoin\n" +
 28720  			"                 │   │   ├─ Eq\n" +
 28721  			"                 │   │   │   ├─ lt.id:14!null\n" +
 28722  			"                 │   │   │   └─ ml.link_type_id:13!null\n" +
 28723  			"                 │   │   ├─ TableAlias(ml)\n" +
 28724  			"                 │   │   │   └─ ProcessTable\n" +
 28725  			"                 │   │   │       └─ Table\n" +
 28726  			"                 │   │   │           ├─ name: movie_link\n" +
 28727  			"                 │   │   │           └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 28728  			"                 │   │   └─ Filter\n" +
 28729  			"                 │   │       ├─ HashIn\n" +
 28730  			"                 │   │       │   ├─ lt.link:1!null\n" +
 28731  			"                 │   │       │   └─ TUPLE(sequel (longtext), follows (longtext), followed by (longtext))\n" +
 28732  			"                 │   │       └─ TableAlias(lt)\n" +
 28733  			"                 │   │           └─ ProcessTable\n" +
 28734  			"                 │   │               └─ Table\n" +
 28735  			"                 │   │                   ├─ name: link_type\n" +
 28736  			"                 │   │                   └─ columns: [id link]\n" +
 28737  			"                 │   └─ CrossJoin\n" +
 28738  			"                 │       ├─ InnerJoin\n" +
 28739  			"                 │       │   ├─ Eq\n" +
 28740  			"                 │       │   │   ├─ it2.id:19!null\n" +
 28741  			"                 │       │   │   └─ mi_idx2.info_type_id:17!null\n" +
 28742  			"                 │       │   ├─ Filter\n" +
 28743  			"                 │       │   │   ├─ LessThan\n" +
 28744  			"                 │       │   │   │   ├─ mi_idx2.info:2!null\n" +
 28745  			"                 │       │   │   │   └─ 3.5 (longtext)\n" +
 28746  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 28747  			"                 │       │   │       └─ ProcessTable\n" +
 28748  			"                 │       │   │           └─ Table\n" +
 28749  			"                 │       │   │               ├─ name: movie_info_idx\n" +
 28750  			"                 │       │   │               └─ columns: [movie_id info_type_id info]\n" +
 28751  			"                 │       │   └─ Filter\n" +
 28752  			"                 │       │       ├─ Eq\n" +
 28753  			"                 │       │       │   ├─ it2.info:1!null\n" +
 28754  			"                 │       │       │   └─ rating (longtext)\n" +
 28755  			"                 │       │       └─ TableAlias(it2)\n" +
 28756  			"                 │       │           └─ ProcessTable\n" +
 28757  			"                 │       │               └─ Table\n" +
 28758  			"                 │       │                   ├─ name: info_type\n" +
 28759  			"                 │       │                   └─ columns: [id info]\n" +
 28760  			"                 │       └─ CrossJoin\n" +
 28761  			"                 │           ├─ InnerJoin\n" +
 28762  			"                 │           │   ├─ Eq\n" +
 28763  			"                 │           │   │   ├─ it1.id:24!null\n" +
 28764  			"                 │           │   │   └─ mi_idx1.info_type_id:22!null\n" +
 28765  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28766  			"                 │           │   │   └─ Table\n" +
 28767  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28768  			"                 │           │   │       ├─ columns: [movie_id info_type_id info]\n" +
 28769  			"                 │           │   │       ├─ colSet: (35-39)\n" +
 28770  			"                 │           │   │       └─ tableId: 10\n" +
 28771  			"                 │           │   └─ Filter\n" +
 28772  			"                 │           │       ├─ Eq\n" +
 28773  			"                 │           │       │   ├─ it1.info:1!null\n" +
 28774  			"                 │           │       │   └─ rating (longtext)\n" +
 28775  			"                 │           │       └─ TableAlias(it1)\n" +
 28776  			"                 │           │           └─ Table\n" +
 28777  			"                 │           │               ├─ name: info_type\n" +
 28778  			"                 │           │               ├─ columns: [id info]\n" +
 28779  			"                 │           │               ├─ colSet: (15,16)\n" +
 28780  			"                 │           │               └─ tableId: 3\n" +
 28781  			"                 │           └─ CrossJoin\n" +
 28782  			"                 │               ├─ InnerJoin\n" +
 28783  			"                 │               │   ├─ Eq\n" +
 28784  			"                 │               │   │   ├─ cn2.id:28!null\n" +
 28785  			"                 │               │   │   └─ mc2.company_id:27!null\n" +
 28786  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28787  			"                 │               │   │   └─ ProcessTable\n" +
 28788  			"                 │               │   │       └─ Table\n" +
 28789  			"                 │               │   │           ├─ name: movie_companies\n" +
 28790  			"                 │               │   │           └─ columns: [movie_id company_id]\n" +
 28791  			"                 │               │   └─ TableAlias(cn2)\n" +
 28792  			"                 │               │       └─ ProcessTable\n" +
 28793  			"                 │               │           └─ Table\n" +
 28794  			"                 │               │               ├─ name: company_name\n" +
 28795  			"                 │               │               └─ columns: [id name]\n" +
 28796  			"                 │               └─ Filter\n" +
 28797  			"                 │                   ├─ NOT\n" +
 28798  			"                 │                   │   └─ Eq\n" +
 28799  			"                 │                   │       ├─ cn1.country_code:2\n" +
 28800  			"                 │                   │       └─ [us] (longtext)\n" +
 28801  			"                 │                   └─ TableAlias(cn1)\n" +
 28802  			"                 │                       └─ Table\n" +
 28803  			"                 │                           ├─ name: company_name\n" +
 28804  			"                 │                           ├─ columns: [id name country_code]\n" +
 28805  			"                 │                           ├─ colSet: (1-7)\n" +
 28806  			"                 │                           └─ tableId: 1\n" +
 28807  			"                 └─ TableAlias(mc1)\n" +
 28808  			"                     └─ Table\n" +
 28809  			"                         ├─ name: movie_companies\n" +
 28810  			"                         ├─ columns: [movie_id company_id]\n" +
 28811  			"                         ├─ colSet: (25-29)\n" +
 28812  			"                         └─ tableId: 8\n" +
 28813  			"",
 28814  		ExpectedEstimates: "Project\n" +
 28815  			" ├─ columns: [min(cn1.name) as first_company, min(cn2.name) as second_company, min(mi_idx1.info) as first_rating, min(mi_idx2.info) as second_rating, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 28816  			" └─ GroupBy\n" +
 28817  			"     ├─ SelectedExprs(MIN(cn1.name), MIN(cn2.name), MIN(mi_idx1.info), MIN(mi_idx2.info), MIN(t1.title), MIN(t2.title))\n" +
 28818  			"     ├─ Grouping()\n" +
 28819  			"     └─ InnerJoin\n" +
 28820  			"         ├─ (((t2.id = ml.linked_movie_id) AND (t2.id = mi_idx2.movie_id)) AND (t2.id = mc2.movie_id))\n" +
 28821  			"         ├─ InnerJoin\n" +
 28822  			"         │   ├─ (kt2.id = t2.kind_id)\n" +
 28823  			"         │   ├─ Filter\n" +
 28824  			"         │   │   ├─ ((t2.production_year >= 2000) AND (t2.production_year <= 2010))\n" +
 28825  			"         │   │   └─ TableAlias(t2)\n" +
 28826  			"         │   │       └─ Table\n" +
 28827  			"         │   │           ├─ name: title\n" +
 28828  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
 28829  			"         │   └─ Filter\n" +
 28830  			"         │       ├─ (kt2.kind HASH IN ('tv series', 'episode'))\n" +
 28831  			"         │       └─ TableAlias(kt2)\n" +
 28832  			"         │           └─ Table\n" +
 28833  			"         │               ├─ name: kind_type\n" +
 28834  			"         │               └─ columns: [id kind]\n" +
 28835  			"         └─ InnerJoin\n" +
 28836  			"             ├─ (((t1.id = ml.movie_id) AND (t1.id = mi_idx1.movie_id)) AND (t1.id = mc1.movie_id))\n" +
 28837  			"             ├─ InnerJoin\n" +
 28838  			"             │   ├─ (kt1.id = t1.kind_id)\n" +
 28839  			"             │   ├─ TableAlias(t1)\n" +
 28840  			"             │   │   └─ Table\n" +
 28841  			"             │   │       ├─ name: title\n" +
 28842  			"             │   │       └─ columns: [id title kind_id]\n" +
 28843  			"             │   └─ Filter\n" +
 28844  			"             │       ├─ (kt1.kind HASH IN ('tv series', 'episode'))\n" +
 28845  			"             │       └─ TableAlias(kt1)\n" +
 28846  			"             │           └─ Table\n" +
 28847  			"             │               ├─ name: kind_type\n" +
 28848  			"             │               └─ columns: [id kind]\n" +
 28849  			"             └─ InnerJoin\n" +
 28850  			"                 ├─ ((mi_idx1.movie_id = mc1.movie_id) AND (ml.movie_id = mc1.movie_id))\n" +
 28851  			"                 ├─ InnerJoin\n" +
 28852  			"                 │   ├─ ((ml.movie_id = mi_idx1.movie_id) AND (ml.linked_movie_id = mi_idx2.movie_id))\n" +
 28853  			"                 │   ├─ InnerJoin\n" +
 28854  			"                 │   │   ├─ (lt.id = ml.link_type_id)\n" +
 28855  			"                 │   │   ├─ TableAlias(ml)\n" +
 28856  			"                 │   │   │   └─ Table\n" +
 28857  			"                 │   │   │       ├─ name: movie_link\n" +
 28858  			"                 │   │   │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 28859  			"                 │   │   └─ Filter\n" +
 28860  			"                 │   │       ├─ (lt.link HASH IN ('sequel', 'follows', 'followed by'))\n" +
 28861  			"                 │   │       └─ TableAlias(lt)\n" +
 28862  			"                 │   │           └─ Table\n" +
 28863  			"                 │   │               ├─ name: link_type\n" +
 28864  			"                 │   │               └─ columns: [id link]\n" +
 28865  			"                 │   └─ CrossJoin\n" +
 28866  			"                 │       ├─ InnerJoin\n" +
 28867  			"                 │       │   ├─ (it2.id = mi_idx2.info_type_id)\n" +
 28868  			"                 │       │   ├─ Filter\n" +
 28869  			"                 │       │   │   ├─ (mi_idx2.info < '3.5')\n" +
 28870  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 28871  			"                 │       │   │       └─ Table\n" +
 28872  			"                 │       │   │           ├─ name: movie_info_idx\n" +
 28873  			"                 │       │   │           └─ columns: [movie_id info_type_id info]\n" +
 28874  			"                 │       │   └─ Filter\n" +
 28875  			"                 │       │       ├─ (it2.info = 'rating')\n" +
 28876  			"                 │       │       └─ TableAlias(it2)\n" +
 28877  			"                 │       │           └─ Table\n" +
 28878  			"                 │       │               ├─ name: info_type\n" +
 28879  			"                 │       │               └─ columns: [id info]\n" +
 28880  			"                 │       └─ CrossJoin\n" +
 28881  			"                 │           ├─ InnerJoin\n" +
 28882  			"                 │           │   ├─ (it1.id = mi_idx1.info_type_id)\n" +
 28883  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28884  			"                 │           │   │   └─ Table\n" +
 28885  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28886  			"                 │           │   │       └─ columns: [movie_id info_type_id info]\n" +
 28887  			"                 │           │   └─ Filter\n" +
 28888  			"                 │           │       ├─ (it1.info = 'rating')\n" +
 28889  			"                 │           │       └─ TableAlias(it1)\n" +
 28890  			"                 │           │           └─ Table\n" +
 28891  			"                 │           │               ├─ name: info_type\n" +
 28892  			"                 │           │               └─ columns: [id info]\n" +
 28893  			"                 │           └─ CrossJoin\n" +
 28894  			"                 │               ├─ InnerJoin\n" +
 28895  			"                 │               │   ├─ (cn2.id = mc2.company_id)\n" +
 28896  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28897  			"                 │               │   │   └─ Table\n" +
 28898  			"                 │               │   │       ├─ name: movie_companies\n" +
 28899  			"                 │               │   │       └─ columns: [movie_id company_id]\n" +
 28900  			"                 │               │   └─ TableAlias(cn2)\n" +
 28901  			"                 │               │       └─ Table\n" +
 28902  			"                 │               │           ├─ name: company_name\n" +
 28903  			"                 │               │           └─ columns: [id name]\n" +
 28904  			"                 │               └─ Filter\n" +
 28905  			"                 │                   ├─ (NOT((cn1.country_code = '[us]')))\n" +
 28906  			"                 │                   └─ TableAlias(cn1)\n" +
 28907  			"                 │                       └─ Table\n" +
 28908  			"                 │                           ├─ name: company_name\n" +
 28909  			"                 │                           └─ columns: [id name country_code]\n" +
 28910  			"                 └─ TableAlias(mc1)\n" +
 28911  			"                     └─ Table\n" +
 28912  			"                         ├─ name: movie_companies\n" +
 28913  			"                         └─ columns: [movie_id company_id]\n" +
 28914  			"",
 28915  		ExpectedAnalysis: "Project\n" +
 28916  			" ├─ columns: [min(cn1.name) as first_company, min(cn2.name) as second_company, min(mi_idx1.info) as first_rating, min(mi_idx2.info) as second_rating, min(t1.title) as first_movie, min(t2.title) as second_movie]\n" +
 28917  			" └─ GroupBy\n" +
 28918  			"     ├─ SelectedExprs(MIN(cn1.name), MIN(cn2.name), MIN(mi_idx1.info), MIN(mi_idx2.info), MIN(t1.title), MIN(t2.title))\n" +
 28919  			"     ├─ Grouping()\n" +
 28920  			"     └─ InnerJoin\n" +
 28921  			"         ├─ (((t2.id = ml.linked_movie_id) AND (t2.id = mi_idx2.movie_id)) AND (t2.id = mc2.movie_id))\n" +
 28922  			"         ├─ InnerJoin\n" +
 28923  			"         │   ├─ (kt2.id = t2.kind_id)\n" +
 28924  			"         │   ├─ Filter\n" +
 28925  			"         │   │   ├─ ((t2.production_year >= 2000) AND (t2.production_year <= 2010))\n" +
 28926  			"         │   │   └─ TableAlias(t2)\n" +
 28927  			"         │   │       └─ Table\n" +
 28928  			"         │   │           ├─ name: title\n" +
 28929  			"         │   │           └─ columns: [id title kind_id production_year]\n" +
 28930  			"         │   └─ Filter\n" +
 28931  			"         │       ├─ (kt2.kind HASH IN ('tv series', 'episode'))\n" +
 28932  			"         │       └─ TableAlias(kt2)\n" +
 28933  			"         │           └─ Table\n" +
 28934  			"         │               ├─ name: kind_type\n" +
 28935  			"         │               └─ columns: [id kind]\n" +
 28936  			"         └─ InnerJoin\n" +
 28937  			"             ├─ (((t1.id = ml.movie_id) AND (t1.id = mi_idx1.movie_id)) AND (t1.id = mc1.movie_id))\n" +
 28938  			"             ├─ InnerJoin\n" +
 28939  			"             │   ├─ (kt1.id = t1.kind_id)\n" +
 28940  			"             │   ├─ TableAlias(t1)\n" +
 28941  			"             │   │   └─ Table\n" +
 28942  			"             │   │       ├─ name: title\n" +
 28943  			"             │   │       └─ columns: [id title kind_id]\n" +
 28944  			"             │   └─ Filter\n" +
 28945  			"             │       ├─ (kt1.kind HASH IN ('tv series', 'episode'))\n" +
 28946  			"             │       └─ TableAlias(kt1)\n" +
 28947  			"             │           └─ Table\n" +
 28948  			"             │               ├─ name: kind_type\n" +
 28949  			"             │               └─ columns: [id kind]\n" +
 28950  			"             └─ InnerJoin\n" +
 28951  			"                 ├─ ((mi_idx1.movie_id = mc1.movie_id) AND (ml.movie_id = mc1.movie_id))\n" +
 28952  			"                 ├─ InnerJoin\n" +
 28953  			"                 │   ├─ ((ml.movie_id = mi_idx1.movie_id) AND (ml.linked_movie_id = mi_idx2.movie_id))\n" +
 28954  			"                 │   ├─ InnerJoin\n" +
 28955  			"                 │   │   ├─ (lt.id = ml.link_type_id)\n" +
 28956  			"                 │   │   ├─ TableAlias(ml)\n" +
 28957  			"                 │   │   │   └─ Table\n" +
 28958  			"                 │   │   │       ├─ name: movie_link\n" +
 28959  			"                 │   │   │       └─ columns: [movie_id linked_movie_id link_type_id]\n" +
 28960  			"                 │   │   └─ Filter\n" +
 28961  			"                 │   │       ├─ (lt.link HASH IN ('sequel', 'follows', 'followed by'))\n" +
 28962  			"                 │   │       └─ TableAlias(lt)\n" +
 28963  			"                 │   │           └─ Table\n" +
 28964  			"                 │   │               ├─ name: link_type\n" +
 28965  			"                 │   │               └─ columns: [id link]\n" +
 28966  			"                 │   └─ CrossJoin\n" +
 28967  			"                 │       ├─ InnerJoin\n" +
 28968  			"                 │       │   ├─ (it2.id = mi_idx2.info_type_id)\n" +
 28969  			"                 │       │   ├─ Filter\n" +
 28970  			"                 │       │   │   ├─ (mi_idx2.info < '3.5')\n" +
 28971  			"                 │       │   │   └─ TableAlias(mi_idx2)\n" +
 28972  			"                 │       │   │       └─ Table\n" +
 28973  			"                 │       │   │           ├─ name: movie_info_idx\n" +
 28974  			"                 │       │   │           └─ columns: [movie_id info_type_id info]\n" +
 28975  			"                 │       │   └─ Filter\n" +
 28976  			"                 │       │       ├─ (it2.info = 'rating')\n" +
 28977  			"                 │       │       └─ TableAlias(it2)\n" +
 28978  			"                 │       │           └─ Table\n" +
 28979  			"                 │       │               ├─ name: info_type\n" +
 28980  			"                 │       │               └─ columns: [id info]\n" +
 28981  			"                 │       └─ CrossJoin\n" +
 28982  			"                 │           ├─ InnerJoin\n" +
 28983  			"                 │           │   ├─ (it1.id = mi_idx1.info_type_id)\n" +
 28984  			"                 │           │   ├─ TableAlias(mi_idx1)\n" +
 28985  			"                 │           │   │   └─ Table\n" +
 28986  			"                 │           │   │       ├─ name: movie_info_idx\n" +
 28987  			"                 │           │   │       └─ columns: [movie_id info_type_id info]\n" +
 28988  			"                 │           │   └─ Filter\n" +
 28989  			"                 │           │       ├─ (it1.info = 'rating')\n" +
 28990  			"                 │           │       └─ TableAlias(it1)\n" +
 28991  			"                 │           │           └─ Table\n" +
 28992  			"                 │           │               ├─ name: info_type\n" +
 28993  			"                 │           │               └─ columns: [id info]\n" +
 28994  			"                 │           └─ CrossJoin\n" +
 28995  			"                 │               ├─ InnerJoin\n" +
 28996  			"                 │               │   ├─ (cn2.id = mc2.company_id)\n" +
 28997  			"                 │               │   ├─ TableAlias(mc2)\n" +
 28998  			"                 │               │   │   └─ Table\n" +
 28999  			"                 │               │   │       ├─ name: movie_companies\n" +
 29000  			"                 │               │   │       └─ columns: [movie_id company_id]\n" +
 29001  			"                 │               │   └─ TableAlias(cn2)\n" +
 29002  			"                 │               │       └─ Table\n" +
 29003  			"                 │               │           ├─ name: company_name\n" +
 29004  			"                 │               │           └─ columns: [id name]\n" +
 29005  			"                 │               └─ Filter\n" +
 29006  			"                 │                   ├─ (NOT((cn1.country_code = '[us]')))\n" +
 29007  			"                 │                   └─ TableAlias(cn1)\n" +
 29008  			"                 │                       └─ Table\n" +
 29009  			"                 │                           ├─ name: company_name\n" +
 29010  			"                 │                           └─ columns: [id name country_code]\n" +
 29011  			"                 └─ TableAlias(mc1)\n" +
 29012  			"                     └─ Table\n" +
 29013  			"                         ├─ name: movie_companies\n" +
 29014  			"                         └─ columns: [movie_id company_id]\n" +
 29015  			"",
 29016  	},
 29017  	{
 29018  		Query: `
 29019  SELECT MIN(t.title) AS movie_title
 29020  FROM keyword AS k,
 29021       movie_info AS mi,
 29022       movie_keyword AS mk,
 29023       title AS t
 29024  WHERE k.keyword LIKE '%sequel%'
 29025    AND mi.info IN ('Sweden',
 29026                    'Norway',
 29027                    'Germany',
 29028                    'Denmark',
 29029                    'Swedish',
 29030                    'Denish',
 29031                    'Norwegian',
 29032                    'German')
 29033    AND t.production_year > 2005
 29034    AND t.id = mi.movie_id
 29035    AND t.id = mk.movie_id
 29036    AND mk.movie_id = mi.movie_id
 29037    AND k.id = mk.keyword_id;
 29038  
 29039  `,
 29040  		ExpectedPlan: "Project\n" +
 29041  			" ├─ columns: [min(t.title):0!null as movie_title]\n" +
 29042  			" └─ GroupBy\n" +
 29043  			"     ├─ select: MIN(t.title:1!null)\n" +
 29044  			"     ├─ group: \n" +
 29045  			"     └─ InnerJoin\n" +
 29046  			"         ├─ AND\n" +
 29047  			"         │   ├─ Eq\n" +
 29048  			"         │   │   ├─ mk.movie_id:5!null\n" +
 29049  			"         │   │   └─ mi.movie_id:3!null\n" +
 29050  			"         │   └─ Eq\n" +
 29051  			"         │       ├─ t.id:0!null\n" +
 29052  			"         │       └─ mk.movie_id:5!null\n" +
 29053  			"         ├─ InnerJoin\n" +
 29054  			"         │   ├─ Eq\n" +
 29055  			"         │   │   ├─ t.id:0!null\n" +
 29056  			"         │   │   └─ mi.movie_id:3!null\n" +
 29057  			"         │   ├─ Filter\n" +
 29058  			"         │   │   ├─ GreaterThan\n" +
 29059  			"         │   │   │   ├─ t.production_year:2\n" +
 29060  			"         │   │   │   └─ 2005 (smallint)\n" +
 29061  			"         │   │   └─ TableAlias(t)\n" +
 29062  			"         │   │       └─ ProcessTable\n" +
 29063  			"         │   │           └─ Table\n" +
 29064  			"         │   │               ├─ name: title\n" +
 29065  			"         │   │               └─ columns: [id title production_year]\n" +
 29066  			"         │   └─ Filter\n" +
 29067  			"         │       ├─ HashIn\n" +
 29068  			"         │       │   ├─ mi.info:1!null\n" +
 29069  			"         │       │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext))\n" +
 29070  			"         │       └─ TableAlias(mi)\n" +
 29071  			"         │           └─ ProcessTable\n" +
 29072  			"         │               └─ Table\n" +
 29073  			"         │                   ├─ name: movie_info\n" +
 29074  			"         │                   └─ columns: [movie_id info]\n" +
 29075  			"         └─ InnerJoin\n" +
 29076  			"             ├─ Eq\n" +
 29077  			"             │   ├─ k.id:7!null\n" +
 29078  			"             │   └─ mk.keyword_id:6!null\n" +
 29079  			"             ├─ TableAlias(mk)\n" +
 29080  			"             │   └─ ProcessTable\n" +
 29081  			"             │       └─ Table\n" +
 29082  			"             │           ├─ name: movie_keyword\n" +
 29083  			"             │           └─ columns: [movie_id keyword_id]\n" +
 29084  			"             └─ Filter\n" +
 29085  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29086  			"                 └─ TableAlias(k)\n" +
 29087  			"                     └─ ProcessTable\n" +
 29088  			"                         └─ Table\n" +
 29089  			"                             ├─ name: keyword\n" +
 29090  			"                             └─ columns: [id keyword]\n" +
 29091  			"",
 29092  		ExpectedEstimates: "Project\n" +
 29093  			" ├─ columns: [min(t.title) as movie_title]\n" +
 29094  			" └─ GroupBy\n" +
 29095  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 29096  			"     ├─ Grouping()\n" +
 29097  			"     └─ InnerJoin\n" +
 29098  			"         ├─ ((mk.movie_id = mi.movie_id) AND (t.id = mk.movie_id))\n" +
 29099  			"         ├─ InnerJoin\n" +
 29100  			"         │   ├─ (t.id = mi.movie_id)\n" +
 29101  			"         │   ├─ Filter\n" +
 29102  			"         │   │   ├─ (t.production_year > 2005)\n" +
 29103  			"         │   │   └─ TableAlias(t)\n" +
 29104  			"         │   │       └─ Table\n" +
 29105  			"         │   │           ├─ name: title\n" +
 29106  			"         │   │           └─ columns: [id title production_year]\n" +
 29107  			"         │   └─ Filter\n" +
 29108  			"         │       ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German'))\n" +
 29109  			"         │       └─ TableAlias(mi)\n" +
 29110  			"         │           └─ Table\n" +
 29111  			"         │               ├─ name: movie_info\n" +
 29112  			"         │               └─ columns: [movie_id info]\n" +
 29113  			"         └─ InnerJoin\n" +
 29114  			"             ├─ (k.id = mk.keyword_id)\n" +
 29115  			"             ├─ TableAlias(mk)\n" +
 29116  			"             │   └─ Table\n" +
 29117  			"             │       ├─ name: movie_keyword\n" +
 29118  			"             │       └─ columns: [movie_id keyword_id]\n" +
 29119  			"             └─ Filter\n" +
 29120  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29121  			"                 └─ TableAlias(k)\n" +
 29122  			"                     └─ Table\n" +
 29123  			"                         ├─ name: keyword\n" +
 29124  			"                         └─ columns: [id keyword]\n" +
 29125  			"",
 29126  		ExpectedAnalysis: "Project\n" +
 29127  			" ├─ columns: [min(t.title) as movie_title]\n" +
 29128  			" └─ GroupBy\n" +
 29129  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 29130  			"     ├─ Grouping()\n" +
 29131  			"     └─ InnerJoin\n" +
 29132  			"         ├─ ((mk.movie_id = mi.movie_id) AND (t.id = mk.movie_id))\n" +
 29133  			"         ├─ InnerJoin\n" +
 29134  			"         │   ├─ (t.id = mi.movie_id)\n" +
 29135  			"         │   ├─ Filter\n" +
 29136  			"         │   │   ├─ (t.production_year > 2005)\n" +
 29137  			"         │   │   └─ TableAlias(t)\n" +
 29138  			"         │   │       └─ Table\n" +
 29139  			"         │   │           ├─ name: title\n" +
 29140  			"         │   │           └─ columns: [id title production_year]\n" +
 29141  			"         │   └─ Filter\n" +
 29142  			"         │       ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German'))\n" +
 29143  			"         │       └─ TableAlias(mi)\n" +
 29144  			"         │           └─ Table\n" +
 29145  			"         │               ├─ name: movie_info\n" +
 29146  			"         │               └─ columns: [movie_id info]\n" +
 29147  			"         └─ InnerJoin\n" +
 29148  			"             ├─ (k.id = mk.keyword_id)\n" +
 29149  			"             ├─ TableAlias(mk)\n" +
 29150  			"             │   └─ Table\n" +
 29151  			"             │       ├─ name: movie_keyword\n" +
 29152  			"             │       └─ columns: [movie_id keyword_id]\n" +
 29153  			"             └─ Filter\n" +
 29154  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29155  			"                 └─ TableAlias(k)\n" +
 29156  			"                     └─ Table\n" +
 29157  			"                         ├─ name: keyword\n" +
 29158  			"                         └─ columns: [id keyword]\n" +
 29159  			"",
 29160  	},
 29161  	{
 29162  		Query: `
 29163  SELECT MIN(t.title) AS movie_title
 29164  FROM keyword AS k,
 29165       movie_info AS mi,
 29166       movie_keyword AS mk,
 29167       title AS t
 29168  WHERE k.keyword LIKE '%sequel%'
 29169    AND mi.info IN ('Bulgaria')
 29170    AND t.production_year > 2010
 29171    AND t.id = mi.movie_id
 29172    AND t.id = mk.movie_id
 29173    AND mk.movie_id = mi.movie_id
 29174    AND k.id = mk.keyword_id;
 29175  
 29176  `,
 29177  		ExpectedPlan: "Project\n" +
 29178  			" ├─ columns: [min(t.title):0!null as movie_title]\n" +
 29179  			" └─ GroupBy\n" +
 29180  			"     ├─ select: MIN(t.title:1!null)\n" +
 29181  			"     ├─ group: \n" +
 29182  			"     └─ InnerJoin\n" +
 29183  			"         ├─ AND\n" +
 29184  			"         │   ├─ Eq\n" +
 29185  			"         │   │   ├─ mk.movie_id:5!null\n" +
 29186  			"         │   │   └─ mi.movie_id:3!null\n" +
 29187  			"         │   └─ Eq\n" +
 29188  			"         │       ├─ t.id:0!null\n" +
 29189  			"         │       └─ mk.movie_id:5!null\n" +
 29190  			"         ├─ InnerJoin\n" +
 29191  			"         │   ├─ Eq\n" +
 29192  			"         │   │   ├─ t.id:0!null\n" +
 29193  			"         │   │   └─ mi.movie_id:3!null\n" +
 29194  			"         │   ├─ Filter\n" +
 29195  			"         │   │   ├─ GreaterThan\n" +
 29196  			"         │   │   │   ├─ t.production_year:2\n" +
 29197  			"         │   │   │   └─ 2010 (smallint)\n" +
 29198  			"         │   │   └─ TableAlias(t)\n" +
 29199  			"         │   │       └─ ProcessTable\n" +
 29200  			"         │   │           └─ Table\n" +
 29201  			"         │   │               ├─ name: title\n" +
 29202  			"         │   │               └─ columns: [id title production_year]\n" +
 29203  			"         │   └─ Filter\n" +
 29204  			"         │       ├─ HashIn\n" +
 29205  			"         │       │   ├─ mi.info:1!null\n" +
 29206  			"         │       │   └─ TUPLE(Bulgaria (longtext))\n" +
 29207  			"         │       └─ TableAlias(mi)\n" +
 29208  			"         │           └─ ProcessTable\n" +
 29209  			"         │               └─ Table\n" +
 29210  			"         │                   ├─ name: movie_info\n" +
 29211  			"         │                   └─ columns: [movie_id info]\n" +
 29212  			"         └─ InnerJoin\n" +
 29213  			"             ├─ Eq\n" +
 29214  			"             │   ├─ k.id:7!null\n" +
 29215  			"             │   └─ mk.keyword_id:6!null\n" +
 29216  			"             ├─ TableAlias(mk)\n" +
 29217  			"             │   └─ ProcessTable\n" +
 29218  			"             │       └─ Table\n" +
 29219  			"             │           ├─ name: movie_keyword\n" +
 29220  			"             │           └─ columns: [movie_id keyword_id]\n" +
 29221  			"             └─ Filter\n" +
 29222  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29223  			"                 └─ TableAlias(k)\n" +
 29224  			"                     └─ ProcessTable\n" +
 29225  			"                         └─ Table\n" +
 29226  			"                             ├─ name: keyword\n" +
 29227  			"                             └─ columns: [id keyword]\n" +
 29228  			"",
 29229  		ExpectedEstimates: "Project\n" +
 29230  			" ├─ columns: [min(t.title) as movie_title]\n" +
 29231  			" └─ GroupBy\n" +
 29232  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 29233  			"     ├─ Grouping()\n" +
 29234  			"     └─ InnerJoin\n" +
 29235  			"         ├─ ((mk.movie_id = mi.movie_id) AND (t.id = mk.movie_id))\n" +
 29236  			"         ├─ InnerJoin\n" +
 29237  			"         │   ├─ (t.id = mi.movie_id)\n" +
 29238  			"         │   ├─ Filter\n" +
 29239  			"         │   │   ├─ (t.production_year > 2010)\n" +
 29240  			"         │   │   └─ TableAlias(t)\n" +
 29241  			"         │   │       └─ Table\n" +
 29242  			"         │   │           ├─ name: title\n" +
 29243  			"         │   │           └─ columns: [id title production_year]\n" +
 29244  			"         │   └─ Filter\n" +
 29245  			"         │       ├─ (mi.info HASH IN ('Bulgaria'))\n" +
 29246  			"         │       └─ TableAlias(mi)\n" +
 29247  			"         │           └─ Table\n" +
 29248  			"         │               ├─ name: movie_info\n" +
 29249  			"         │               └─ columns: [movie_id info]\n" +
 29250  			"         └─ InnerJoin\n" +
 29251  			"             ├─ (k.id = mk.keyword_id)\n" +
 29252  			"             ├─ TableAlias(mk)\n" +
 29253  			"             │   └─ Table\n" +
 29254  			"             │       ├─ name: movie_keyword\n" +
 29255  			"             │       └─ columns: [movie_id keyword_id]\n" +
 29256  			"             └─ Filter\n" +
 29257  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29258  			"                 └─ TableAlias(k)\n" +
 29259  			"                     └─ Table\n" +
 29260  			"                         ├─ name: keyword\n" +
 29261  			"                         └─ columns: [id keyword]\n" +
 29262  			"",
 29263  		ExpectedAnalysis: "Project\n" +
 29264  			" ├─ columns: [min(t.title) as movie_title]\n" +
 29265  			" └─ GroupBy\n" +
 29266  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 29267  			"     ├─ Grouping()\n" +
 29268  			"     └─ InnerJoin\n" +
 29269  			"         ├─ ((mk.movie_id = mi.movie_id) AND (t.id = mk.movie_id))\n" +
 29270  			"         ├─ InnerJoin\n" +
 29271  			"         │   ├─ (t.id = mi.movie_id)\n" +
 29272  			"         │   ├─ Filter\n" +
 29273  			"         │   │   ├─ (t.production_year > 2010)\n" +
 29274  			"         │   │   └─ TableAlias(t)\n" +
 29275  			"         │   │       └─ Table\n" +
 29276  			"         │   │           ├─ name: title\n" +
 29277  			"         │   │           └─ columns: [id title production_year]\n" +
 29278  			"         │   └─ Filter\n" +
 29279  			"         │       ├─ (mi.info HASH IN ('Bulgaria'))\n" +
 29280  			"         │       └─ TableAlias(mi)\n" +
 29281  			"         │           └─ Table\n" +
 29282  			"         │               ├─ name: movie_info\n" +
 29283  			"         │               └─ columns: [movie_id info]\n" +
 29284  			"         └─ InnerJoin\n" +
 29285  			"             ├─ (k.id = mk.keyword_id)\n" +
 29286  			"             ├─ TableAlias(mk)\n" +
 29287  			"             │   └─ Table\n" +
 29288  			"             │       ├─ name: movie_keyword\n" +
 29289  			"             │       └─ columns: [movie_id keyword_id]\n" +
 29290  			"             └─ Filter\n" +
 29291  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29292  			"                 └─ TableAlias(k)\n" +
 29293  			"                     └─ Table\n" +
 29294  			"                         ├─ name: keyword\n" +
 29295  			"                         └─ columns: [id keyword]\n" +
 29296  			"",
 29297  	},
 29298  	{
 29299  		Query: `
 29300  SELECT MIN(t.title) AS movie_title
 29301  FROM keyword AS k,
 29302       movie_info AS mi,
 29303       movie_keyword AS mk,
 29304       title AS t
 29305  WHERE k.keyword LIKE '%sequel%'
 29306    AND mi.info IN ('Sweden',
 29307                    'Norway',
 29308                    'Germany',
 29309                    'Denmark',
 29310                    'Swedish',
 29311                    'Denish',
 29312                    'Norwegian',
 29313                    'German',
 29314                    'USA',
 29315                    'American')
 29316    AND t.production_year > 1990
 29317    AND t.id = mi.movie_id
 29318    AND t.id = mk.movie_id
 29319    AND mk.movie_id = mi.movie_id
 29320    AND k.id = mk.keyword_id;
 29321  
 29322  `,
 29323  		ExpectedPlan: "Project\n" +
 29324  			" ├─ columns: [min(t.title):0!null as movie_title]\n" +
 29325  			" └─ GroupBy\n" +
 29326  			"     ├─ select: MIN(t.title:1!null)\n" +
 29327  			"     ├─ group: \n" +
 29328  			"     └─ InnerJoin\n" +
 29329  			"         ├─ AND\n" +
 29330  			"         │   ├─ Eq\n" +
 29331  			"         │   │   ├─ mk.movie_id:5!null\n" +
 29332  			"         │   │   └─ mi.movie_id:3!null\n" +
 29333  			"         │   └─ Eq\n" +
 29334  			"         │       ├─ t.id:0!null\n" +
 29335  			"         │       └─ mk.movie_id:5!null\n" +
 29336  			"         ├─ InnerJoin\n" +
 29337  			"         │   ├─ Eq\n" +
 29338  			"         │   │   ├─ t.id:0!null\n" +
 29339  			"         │   │   └─ mi.movie_id:3!null\n" +
 29340  			"         │   ├─ Filter\n" +
 29341  			"         │   │   ├─ GreaterThan\n" +
 29342  			"         │   │   │   ├─ t.production_year:2\n" +
 29343  			"         │   │   │   └─ 1990 (smallint)\n" +
 29344  			"         │   │   └─ TableAlias(t)\n" +
 29345  			"         │   │       └─ ProcessTable\n" +
 29346  			"         │   │           └─ Table\n" +
 29347  			"         │   │               ├─ name: title\n" +
 29348  			"         │   │               └─ columns: [id title production_year]\n" +
 29349  			"         │   └─ Filter\n" +
 29350  			"         │       ├─ HashIn\n" +
 29351  			"         │       │   ├─ mi.info:1!null\n" +
 29352  			"         │       │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 29353  			"         │       └─ TableAlias(mi)\n" +
 29354  			"         │           └─ ProcessTable\n" +
 29355  			"         │               └─ Table\n" +
 29356  			"         │                   ├─ name: movie_info\n" +
 29357  			"         │                   └─ columns: [movie_id info]\n" +
 29358  			"         └─ InnerJoin\n" +
 29359  			"             ├─ Eq\n" +
 29360  			"             │   ├─ k.id:7!null\n" +
 29361  			"             │   └─ mk.keyword_id:6!null\n" +
 29362  			"             ├─ TableAlias(mk)\n" +
 29363  			"             │   └─ ProcessTable\n" +
 29364  			"             │       └─ Table\n" +
 29365  			"             │           ├─ name: movie_keyword\n" +
 29366  			"             │           └─ columns: [movie_id keyword_id]\n" +
 29367  			"             └─ Filter\n" +
 29368  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29369  			"                 └─ TableAlias(k)\n" +
 29370  			"                     └─ ProcessTable\n" +
 29371  			"                         └─ Table\n" +
 29372  			"                             ├─ name: keyword\n" +
 29373  			"                             └─ columns: [id keyword]\n" +
 29374  			"",
 29375  		ExpectedEstimates: "Project\n" +
 29376  			" ├─ columns: [min(t.title) as movie_title]\n" +
 29377  			" └─ GroupBy\n" +
 29378  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 29379  			"     ├─ Grouping()\n" +
 29380  			"     └─ InnerJoin\n" +
 29381  			"         ├─ ((mk.movie_id = mi.movie_id) AND (t.id = mk.movie_id))\n" +
 29382  			"         ├─ InnerJoin\n" +
 29383  			"         │   ├─ (t.id = mi.movie_id)\n" +
 29384  			"         │   ├─ Filter\n" +
 29385  			"         │   │   ├─ (t.production_year > 1990)\n" +
 29386  			"         │   │   └─ TableAlias(t)\n" +
 29387  			"         │   │       └─ Table\n" +
 29388  			"         │   │           ├─ name: title\n" +
 29389  			"         │   │           └─ columns: [id title production_year]\n" +
 29390  			"         │   └─ Filter\n" +
 29391  			"         │       ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 29392  			"         │       └─ TableAlias(mi)\n" +
 29393  			"         │           └─ Table\n" +
 29394  			"         │               ├─ name: movie_info\n" +
 29395  			"         │               └─ columns: [movie_id info]\n" +
 29396  			"         └─ InnerJoin\n" +
 29397  			"             ├─ (k.id = mk.keyword_id)\n" +
 29398  			"             ├─ TableAlias(mk)\n" +
 29399  			"             │   └─ Table\n" +
 29400  			"             │       ├─ name: movie_keyword\n" +
 29401  			"             │       └─ columns: [movie_id keyword_id]\n" +
 29402  			"             └─ Filter\n" +
 29403  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29404  			"                 └─ TableAlias(k)\n" +
 29405  			"                     └─ Table\n" +
 29406  			"                         ├─ name: keyword\n" +
 29407  			"                         └─ columns: [id keyword]\n" +
 29408  			"",
 29409  		ExpectedAnalysis: "Project\n" +
 29410  			" ├─ columns: [min(t.title) as movie_title]\n" +
 29411  			" └─ GroupBy\n" +
 29412  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 29413  			"     ├─ Grouping()\n" +
 29414  			"     └─ InnerJoin\n" +
 29415  			"         ├─ ((mk.movie_id = mi.movie_id) AND (t.id = mk.movie_id))\n" +
 29416  			"         ├─ InnerJoin\n" +
 29417  			"         │   ├─ (t.id = mi.movie_id)\n" +
 29418  			"         │   ├─ Filter\n" +
 29419  			"         │   │   ├─ (t.production_year > 1990)\n" +
 29420  			"         │   │   └─ TableAlias(t)\n" +
 29421  			"         │   │       └─ Table\n" +
 29422  			"         │   │           ├─ name: title\n" +
 29423  			"         │   │           └─ columns: [id title production_year]\n" +
 29424  			"         │   └─ Filter\n" +
 29425  			"         │       ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 29426  			"         │       └─ TableAlias(mi)\n" +
 29427  			"         │           └─ Table\n" +
 29428  			"         │               ├─ name: movie_info\n" +
 29429  			"         │               └─ columns: [movie_id info]\n" +
 29430  			"         └─ InnerJoin\n" +
 29431  			"             ├─ (k.id = mk.keyword_id)\n" +
 29432  			"             ├─ TableAlias(mk)\n" +
 29433  			"             │   └─ Table\n" +
 29434  			"             │       ├─ name: movie_keyword\n" +
 29435  			"             │       └─ columns: [movie_id keyword_id]\n" +
 29436  			"             └─ Filter\n" +
 29437  			"                 ├─ k.keyword LIKE '%sequel%'\n" +
 29438  			"                 └─ TableAlias(k)\n" +
 29439  			"                     └─ Table\n" +
 29440  			"                         ├─ name: keyword\n" +
 29441  			"                         └─ columns: [id keyword]\n" +
 29442  			"",
 29443  	},
 29444  	{
 29445  		Query: `
 29446  SELECT MIN(mi_idx.info) AS rating,
 29447         MIN(t.title) AS movie_title
 29448  FROM info_type AS it,
 29449       keyword AS k,
 29450       movie_info_idx AS mi_idx,
 29451       movie_keyword AS mk,
 29452       title AS t
 29453  WHERE it.info ='rating'
 29454    AND k.keyword LIKE '%sequel%'
 29455    AND mi_idx.info > '5.0'
 29456    AND t.production_year > 2005
 29457    AND t.id = mi_idx.movie_id
 29458    AND t.id = mk.movie_id
 29459    AND mk.movie_id = mi_idx.movie_id
 29460    AND k.id = mk.keyword_id
 29461    AND it.id = mi_idx.info_type_id;
 29462  
 29463  `,
 29464  		ExpectedPlan: "Project\n" +
 29465  			" ├─ columns: [min(mi_idx.info):0!null as rating, min(t.title):1!null as movie_title]\n" +
 29466  			" └─ GroupBy\n" +
 29467  			"     ├─ select: MIN(mi_idx.info:5!null), MIN(t.title:1!null)\n" +
 29468  			"     ├─ group: \n" +
 29469  			"     └─ InnerJoin\n" +
 29470  			"         ├─ AND\n" +
 29471  			"         │   ├─ AND\n" +
 29472  			"         │   │   ├─ Eq\n" +
 29473  			"         │   │   │   ├─ it.id:10!null\n" +
 29474  			"         │   │   │   └─ mi_idx.info_type_id:4!null\n" +
 29475  			"         │   │   └─ Eq\n" +
 29476  			"         │   │       ├─ mk.movie_id:6!null\n" +
 29477  			"         │   │       └─ mi_idx.movie_id:3!null\n" +
 29478  			"         │   └─ Eq\n" +
 29479  			"         │       ├─ t.id:0!null\n" +
 29480  			"         │       └─ mk.movie_id:6!null\n" +
 29481  			"         ├─ InnerJoin\n" +
 29482  			"         │   ├─ Eq\n" +
 29483  			"         │   │   ├─ t.id:0!null\n" +
 29484  			"         │   │   └─ mi_idx.movie_id:3!null\n" +
 29485  			"         │   ├─ Filter\n" +
 29486  			"         │   │   ├─ GreaterThan\n" +
 29487  			"         │   │   │   ├─ t.production_year:2\n" +
 29488  			"         │   │   │   └─ 2005 (smallint)\n" +
 29489  			"         │   │   └─ TableAlias(t)\n" +
 29490  			"         │   │       └─ ProcessTable\n" +
 29491  			"         │   │           └─ Table\n" +
 29492  			"         │   │               ├─ name: title\n" +
 29493  			"         │   │               └─ columns: [id title production_year]\n" +
 29494  			"         │   └─ Filter\n" +
 29495  			"         │       ├─ GreaterThan\n" +
 29496  			"         │       │   ├─ mi_idx.info:2!null\n" +
 29497  			"         │       │   └─ 5.0 (longtext)\n" +
 29498  			"         │       └─ TableAlias(mi_idx)\n" +
 29499  			"         │           └─ ProcessTable\n" +
 29500  			"         │               └─ Table\n" +
 29501  			"         │                   ├─ name: movie_info_idx\n" +
 29502  			"         │                   └─ columns: [movie_id info_type_id info]\n" +
 29503  			"         └─ CrossJoin\n" +
 29504  			"             ├─ InnerJoin\n" +
 29505  			"             │   ├─ Eq\n" +
 29506  			"             │   │   ├─ k.id:8!null\n" +
 29507  			"             │   │   └─ mk.keyword_id:7!null\n" +
 29508  			"             │   ├─ TableAlias(mk)\n" +
 29509  			"             │   │   └─ ProcessTable\n" +
 29510  			"             │   │       └─ Table\n" +
 29511  			"             │   │           ├─ name: movie_keyword\n" +
 29512  			"             │   │           └─ columns: [movie_id keyword_id]\n" +
 29513  			"             │   └─ Filter\n" +
 29514  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29515  			"             │       └─ TableAlias(k)\n" +
 29516  			"             │           └─ ProcessTable\n" +
 29517  			"             │               └─ Table\n" +
 29518  			"             │                   ├─ name: keyword\n" +
 29519  			"             │                   └─ columns: [id keyword]\n" +
 29520  			"             └─ Filter\n" +
 29521  			"                 ├─ Eq\n" +
 29522  			"                 │   ├─ it.info:1!null\n" +
 29523  			"                 │   └─ rating (longtext)\n" +
 29524  			"                 └─ TableAlias(it)\n" +
 29525  			"                     └─ ProcessTable\n" +
 29526  			"                         └─ Table\n" +
 29527  			"                             ├─ name: info_type\n" +
 29528  			"                             └─ columns: [id info]\n" +
 29529  			"",
 29530  		ExpectedEstimates: "Project\n" +
 29531  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as movie_title]\n" +
 29532  			" └─ GroupBy\n" +
 29533  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
 29534  			"     ├─ Grouping()\n" +
 29535  			"     └─ InnerJoin\n" +
 29536  			"         ├─ (((it.id = mi_idx.info_type_id) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 29537  			"         ├─ InnerJoin\n" +
 29538  			"         │   ├─ (t.id = mi_idx.movie_id)\n" +
 29539  			"         │   ├─ Filter\n" +
 29540  			"         │   │   ├─ (t.production_year > 2005)\n" +
 29541  			"         │   │   └─ TableAlias(t)\n" +
 29542  			"         │   │       └─ Table\n" +
 29543  			"         │   │           ├─ name: title\n" +
 29544  			"         │   │           └─ columns: [id title production_year]\n" +
 29545  			"         │   └─ Filter\n" +
 29546  			"         │       ├─ (mi_idx.info > '5.0')\n" +
 29547  			"         │       └─ TableAlias(mi_idx)\n" +
 29548  			"         │           └─ Table\n" +
 29549  			"         │               ├─ name: movie_info_idx\n" +
 29550  			"         │               └─ columns: [movie_id info_type_id info]\n" +
 29551  			"         └─ CrossJoin\n" +
 29552  			"             ├─ InnerJoin\n" +
 29553  			"             │   ├─ (k.id = mk.keyword_id)\n" +
 29554  			"             │   ├─ TableAlias(mk)\n" +
 29555  			"             │   │   └─ Table\n" +
 29556  			"             │   │       ├─ name: movie_keyword\n" +
 29557  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 29558  			"             │   └─ Filter\n" +
 29559  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29560  			"             │       └─ TableAlias(k)\n" +
 29561  			"             │           └─ Table\n" +
 29562  			"             │               ├─ name: keyword\n" +
 29563  			"             │               └─ columns: [id keyword]\n" +
 29564  			"             └─ Filter\n" +
 29565  			"                 ├─ (it.info = 'rating')\n" +
 29566  			"                 └─ TableAlias(it)\n" +
 29567  			"                     └─ Table\n" +
 29568  			"                         ├─ name: info_type\n" +
 29569  			"                         └─ columns: [id info]\n" +
 29570  			"",
 29571  		ExpectedAnalysis: "Project\n" +
 29572  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as movie_title]\n" +
 29573  			" └─ GroupBy\n" +
 29574  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
 29575  			"     ├─ Grouping()\n" +
 29576  			"     └─ InnerJoin\n" +
 29577  			"         ├─ (((it.id = mi_idx.info_type_id) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 29578  			"         ├─ InnerJoin\n" +
 29579  			"         │   ├─ (t.id = mi_idx.movie_id)\n" +
 29580  			"         │   ├─ Filter\n" +
 29581  			"         │   │   ├─ (t.production_year > 2005)\n" +
 29582  			"         │   │   └─ TableAlias(t)\n" +
 29583  			"         │   │       └─ Table\n" +
 29584  			"         │   │           ├─ name: title\n" +
 29585  			"         │   │           └─ columns: [id title production_year]\n" +
 29586  			"         │   └─ Filter\n" +
 29587  			"         │       ├─ (mi_idx.info > '5.0')\n" +
 29588  			"         │       └─ TableAlias(mi_idx)\n" +
 29589  			"         │           └─ Table\n" +
 29590  			"         │               ├─ name: movie_info_idx\n" +
 29591  			"         │               └─ columns: [movie_id info_type_id info]\n" +
 29592  			"         └─ CrossJoin\n" +
 29593  			"             ├─ InnerJoin\n" +
 29594  			"             │   ├─ (k.id = mk.keyword_id)\n" +
 29595  			"             │   ├─ TableAlias(mk)\n" +
 29596  			"             │   │   └─ Table\n" +
 29597  			"             │   │       ├─ name: movie_keyword\n" +
 29598  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 29599  			"             │   └─ Filter\n" +
 29600  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29601  			"             │       └─ TableAlias(k)\n" +
 29602  			"             │           └─ Table\n" +
 29603  			"             │               ├─ name: keyword\n" +
 29604  			"             │               └─ columns: [id keyword]\n" +
 29605  			"             └─ Filter\n" +
 29606  			"                 ├─ (it.info = 'rating')\n" +
 29607  			"                 └─ TableAlias(it)\n" +
 29608  			"                     └─ Table\n" +
 29609  			"                         ├─ name: info_type\n" +
 29610  			"                         └─ columns: [id info]\n" +
 29611  			"",
 29612  	},
 29613  	{
 29614  		Query: `
 29615  SELECT MIN(mi_idx.info) AS rating,
 29616         MIN(t.title) AS movie_title
 29617  FROM info_type AS it,
 29618       keyword AS k,
 29619       movie_info_idx AS mi_idx,
 29620       movie_keyword AS mk,
 29621       title AS t
 29622  WHERE it.info ='rating'
 29623    AND k.keyword LIKE '%sequel%'
 29624    AND mi_idx.info > '9.0'
 29625    AND t.production_year > 2010
 29626    AND t.id = mi_idx.movie_id
 29627    AND t.id = mk.movie_id
 29628    AND mk.movie_id = mi_idx.movie_id
 29629    AND k.id = mk.keyword_id
 29630    AND it.id = mi_idx.info_type_id;
 29631  
 29632  `,
 29633  		ExpectedPlan: "Project\n" +
 29634  			" ├─ columns: [min(mi_idx.info):0!null as rating, min(t.title):1!null as movie_title]\n" +
 29635  			" └─ GroupBy\n" +
 29636  			"     ├─ select: MIN(mi_idx.info:5!null), MIN(t.title:1!null)\n" +
 29637  			"     ├─ group: \n" +
 29638  			"     └─ InnerJoin\n" +
 29639  			"         ├─ AND\n" +
 29640  			"         │   ├─ AND\n" +
 29641  			"         │   │   ├─ Eq\n" +
 29642  			"         │   │   │   ├─ it.id:10!null\n" +
 29643  			"         │   │   │   └─ mi_idx.info_type_id:4!null\n" +
 29644  			"         │   │   └─ Eq\n" +
 29645  			"         │   │       ├─ mk.movie_id:6!null\n" +
 29646  			"         │   │       └─ mi_idx.movie_id:3!null\n" +
 29647  			"         │   └─ Eq\n" +
 29648  			"         │       ├─ t.id:0!null\n" +
 29649  			"         │       └─ mk.movie_id:6!null\n" +
 29650  			"         ├─ InnerJoin\n" +
 29651  			"         │   ├─ Eq\n" +
 29652  			"         │   │   ├─ t.id:0!null\n" +
 29653  			"         │   │   └─ mi_idx.movie_id:3!null\n" +
 29654  			"         │   ├─ Filter\n" +
 29655  			"         │   │   ├─ GreaterThan\n" +
 29656  			"         │   │   │   ├─ t.production_year:2\n" +
 29657  			"         │   │   │   └─ 2010 (smallint)\n" +
 29658  			"         │   │   └─ TableAlias(t)\n" +
 29659  			"         │   │       └─ ProcessTable\n" +
 29660  			"         │   │           └─ Table\n" +
 29661  			"         │   │               ├─ name: title\n" +
 29662  			"         │   │               └─ columns: [id title production_year]\n" +
 29663  			"         │   └─ Filter\n" +
 29664  			"         │       ├─ GreaterThan\n" +
 29665  			"         │       │   ├─ mi_idx.info:2!null\n" +
 29666  			"         │       │   └─ 9.0 (longtext)\n" +
 29667  			"         │       └─ TableAlias(mi_idx)\n" +
 29668  			"         │           └─ ProcessTable\n" +
 29669  			"         │               └─ Table\n" +
 29670  			"         │                   ├─ name: movie_info_idx\n" +
 29671  			"         │                   └─ columns: [movie_id info_type_id info]\n" +
 29672  			"         └─ CrossJoin\n" +
 29673  			"             ├─ InnerJoin\n" +
 29674  			"             │   ├─ Eq\n" +
 29675  			"             │   │   ├─ k.id:8!null\n" +
 29676  			"             │   │   └─ mk.keyword_id:7!null\n" +
 29677  			"             │   ├─ TableAlias(mk)\n" +
 29678  			"             │   │   └─ ProcessTable\n" +
 29679  			"             │   │       └─ Table\n" +
 29680  			"             │   │           ├─ name: movie_keyword\n" +
 29681  			"             │   │           └─ columns: [movie_id keyword_id]\n" +
 29682  			"             │   └─ Filter\n" +
 29683  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29684  			"             │       └─ TableAlias(k)\n" +
 29685  			"             │           └─ ProcessTable\n" +
 29686  			"             │               └─ Table\n" +
 29687  			"             │                   ├─ name: keyword\n" +
 29688  			"             │                   └─ columns: [id keyword]\n" +
 29689  			"             └─ Filter\n" +
 29690  			"                 ├─ Eq\n" +
 29691  			"                 │   ├─ it.info:1!null\n" +
 29692  			"                 │   └─ rating (longtext)\n" +
 29693  			"                 └─ TableAlias(it)\n" +
 29694  			"                     └─ ProcessTable\n" +
 29695  			"                         └─ Table\n" +
 29696  			"                             ├─ name: info_type\n" +
 29697  			"                             └─ columns: [id info]\n" +
 29698  			"",
 29699  		ExpectedEstimates: "Project\n" +
 29700  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as movie_title]\n" +
 29701  			" └─ GroupBy\n" +
 29702  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
 29703  			"     ├─ Grouping()\n" +
 29704  			"     └─ InnerJoin\n" +
 29705  			"         ├─ (((it.id = mi_idx.info_type_id) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 29706  			"         ├─ InnerJoin\n" +
 29707  			"         │   ├─ (t.id = mi_idx.movie_id)\n" +
 29708  			"         │   ├─ Filter\n" +
 29709  			"         │   │   ├─ (t.production_year > 2010)\n" +
 29710  			"         │   │   └─ TableAlias(t)\n" +
 29711  			"         │   │       └─ Table\n" +
 29712  			"         │   │           ├─ name: title\n" +
 29713  			"         │   │           └─ columns: [id title production_year]\n" +
 29714  			"         │   └─ Filter\n" +
 29715  			"         │       ├─ (mi_idx.info > '9.0')\n" +
 29716  			"         │       └─ TableAlias(mi_idx)\n" +
 29717  			"         │           └─ Table\n" +
 29718  			"         │               ├─ name: movie_info_idx\n" +
 29719  			"         │               └─ columns: [movie_id info_type_id info]\n" +
 29720  			"         └─ CrossJoin\n" +
 29721  			"             ├─ InnerJoin\n" +
 29722  			"             │   ├─ (k.id = mk.keyword_id)\n" +
 29723  			"             │   ├─ TableAlias(mk)\n" +
 29724  			"             │   │   └─ Table\n" +
 29725  			"             │   │       ├─ name: movie_keyword\n" +
 29726  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 29727  			"             │   └─ Filter\n" +
 29728  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29729  			"             │       └─ TableAlias(k)\n" +
 29730  			"             │           └─ Table\n" +
 29731  			"             │               ├─ name: keyword\n" +
 29732  			"             │               └─ columns: [id keyword]\n" +
 29733  			"             └─ Filter\n" +
 29734  			"                 ├─ (it.info = 'rating')\n" +
 29735  			"                 └─ TableAlias(it)\n" +
 29736  			"                     └─ Table\n" +
 29737  			"                         ├─ name: info_type\n" +
 29738  			"                         └─ columns: [id info]\n" +
 29739  			"",
 29740  		ExpectedAnalysis: "Project\n" +
 29741  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as movie_title]\n" +
 29742  			" └─ GroupBy\n" +
 29743  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
 29744  			"     ├─ Grouping()\n" +
 29745  			"     └─ InnerJoin\n" +
 29746  			"         ├─ (((it.id = mi_idx.info_type_id) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 29747  			"         ├─ InnerJoin\n" +
 29748  			"         │   ├─ (t.id = mi_idx.movie_id)\n" +
 29749  			"         │   ├─ Filter\n" +
 29750  			"         │   │   ├─ (t.production_year > 2010)\n" +
 29751  			"         │   │   └─ TableAlias(t)\n" +
 29752  			"         │   │       └─ Table\n" +
 29753  			"         │   │           ├─ name: title\n" +
 29754  			"         │   │           └─ columns: [id title production_year]\n" +
 29755  			"         │   └─ Filter\n" +
 29756  			"         │       ├─ (mi_idx.info > '9.0')\n" +
 29757  			"         │       └─ TableAlias(mi_idx)\n" +
 29758  			"         │           └─ Table\n" +
 29759  			"         │               ├─ name: movie_info_idx\n" +
 29760  			"         │               └─ columns: [movie_id info_type_id info]\n" +
 29761  			"         └─ CrossJoin\n" +
 29762  			"             ├─ InnerJoin\n" +
 29763  			"             │   ├─ (k.id = mk.keyword_id)\n" +
 29764  			"             │   ├─ TableAlias(mk)\n" +
 29765  			"             │   │   └─ Table\n" +
 29766  			"             │   │       ├─ name: movie_keyword\n" +
 29767  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 29768  			"             │   └─ Filter\n" +
 29769  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29770  			"             │       └─ TableAlias(k)\n" +
 29771  			"             │           └─ Table\n" +
 29772  			"             │               ├─ name: keyword\n" +
 29773  			"             │               └─ columns: [id keyword]\n" +
 29774  			"             └─ Filter\n" +
 29775  			"                 ├─ (it.info = 'rating')\n" +
 29776  			"                 └─ TableAlias(it)\n" +
 29777  			"                     └─ Table\n" +
 29778  			"                         ├─ name: info_type\n" +
 29779  			"                         └─ columns: [id info]\n" +
 29780  			"",
 29781  	},
 29782  	{
 29783  		Query: `
 29784  SELECT MIN(mi_idx.info) AS rating,
 29785         MIN(t.title) AS movie_title
 29786  FROM info_type AS it,
 29787       keyword AS k,
 29788       movie_info_idx AS mi_idx,
 29789       movie_keyword AS mk,
 29790       title AS t
 29791  WHERE it.info ='rating'
 29792    AND k.keyword LIKE '%sequel%'
 29793    AND mi_idx.info > '2.0'
 29794    AND t.production_year > 1990
 29795    AND t.id = mi_idx.movie_id
 29796    AND t.id = mk.movie_id
 29797    AND mk.movie_id = mi_idx.movie_id
 29798    AND k.id = mk.keyword_id
 29799    AND it.id = mi_idx.info_type_id;
 29800  
 29801  `,
 29802  		ExpectedPlan: "Project\n" +
 29803  			" ├─ columns: [min(mi_idx.info):0!null as rating, min(t.title):1!null as movie_title]\n" +
 29804  			" └─ GroupBy\n" +
 29805  			"     ├─ select: MIN(mi_idx.info:5!null), MIN(t.title:1!null)\n" +
 29806  			"     ├─ group: \n" +
 29807  			"     └─ InnerJoin\n" +
 29808  			"         ├─ AND\n" +
 29809  			"         │   ├─ AND\n" +
 29810  			"         │   │   ├─ Eq\n" +
 29811  			"         │   │   │   ├─ it.id:10!null\n" +
 29812  			"         │   │   │   └─ mi_idx.info_type_id:4!null\n" +
 29813  			"         │   │   └─ Eq\n" +
 29814  			"         │   │       ├─ mk.movie_id:6!null\n" +
 29815  			"         │   │       └─ mi_idx.movie_id:3!null\n" +
 29816  			"         │   └─ Eq\n" +
 29817  			"         │       ├─ t.id:0!null\n" +
 29818  			"         │       └─ mk.movie_id:6!null\n" +
 29819  			"         ├─ InnerJoin\n" +
 29820  			"         │   ├─ Eq\n" +
 29821  			"         │   │   ├─ t.id:0!null\n" +
 29822  			"         │   │   └─ mi_idx.movie_id:3!null\n" +
 29823  			"         │   ├─ Filter\n" +
 29824  			"         │   │   ├─ GreaterThan\n" +
 29825  			"         │   │   │   ├─ t.production_year:2\n" +
 29826  			"         │   │   │   └─ 1990 (smallint)\n" +
 29827  			"         │   │   └─ TableAlias(t)\n" +
 29828  			"         │   │       └─ ProcessTable\n" +
 29829  			"         │   │           └─ Table\n" +
 29830  			"         │   │               ├─ name: title\n" +
 29831  			"         │   │               └─ columns: [id title production_year]\n" +
 29832  			"         │   └─ Filter\n" +
 29833  			"         │       ├─ GreaterThan\n" +
 29834  			"         │       │   ├─ mi_idx.info:2!null\n" +
 29835  			"         │       │   └─ 2.0 (longtext)\n" +
 29836  			"         │       └─ TableAlias(mi_idx)\n" +
 29837  			"         │           └─ ProcessTable\n" +
 29838  			"         │               └─ Table\n" +
 29839  			"         │                   ├─ name: movie_info_idx\n" +
 29840  			"         │                   └─ columns: [movie_id info_type_id info]\n" +
 29841  			"         └─ CrossJoin\n" +
 29842  			"             ├─ InnerJoin\n" +
 29843  			"             │   ├─ Eq\n" +
 29844  			"             │   │   ├─ k.id:8!null\n" +
 29845  			"             │   │   └─ mk.keyword_id:7!null\n" +
 29846  			"             │   ├─ TableAlias(mk)\n" +
 29847  			"             │   │   └─ ProcessTable\n" +
 29848  			"             │   │       └─ Table\n" +
 29849  			"             │   │           ├─ name: movie_keyword\n" +
 29850  			"             │   │           └─ columns: [movie_id keyword_id]\n" +
 29851  			"             │   └─ Filter\n" +
 29852  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29853  			"             │       └─ TableAlias(k)\n" +
 29854  			"             │           └─ ProcessTable\n" +
 29855  			"             │               └─ Table\n" +
 29856  			"             │                   ├─ name: keyword\n" +
 29857  			"             │                   └─ columns: [id keyword]\n" +
 29858  			"             └─ Filter\n" +
 29859  			"                 ├─ Eq\n" +
 29860  			"                 │   ├─ it.info:1!null\n" +
 29861  			"                 │   └─ rating (longtext)\n" +
 29862  			"                 └─ TableAlias(it)\n" +
 29863  			"                     └─ ProcessTable\n" +
 29864  			"                         └─ Table\n" +
 29865  			"                             ├─ name: info_type\n" +
 29866  			"                             └─ columns: [id info]\n" +
 29867  			"",
 29868  		ExpectedEstimates: "Project\n" +
 29869  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as movie_title]\n" +
 29870  			" └─ GroupBy\n" +
 29871  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
 29872  			"     ├─ Grouping()\n" +
 29873  			"     └─ InnerJoin\n" +
 29874  			"         ├─ (((it.id = mi_idx.info_type_id) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 29875  			"         ├─ InnerJoin\n" +
 29876  			"         │   ├─ (t.id = mi_idx.movie_id)\n" +
 29877  			"         │   ├─ Filter\n" +
 29878  			"         │   │   ├─ (t.production_year > 1990)\n" +
 29879  			"         │   │   └─ TableAlias(t)\n" +
 29880  			"         │   │       └─ Table\n" +
 29881  			"         │   │           ├─ name: title\n" +
 29882  			"         │   │           └─ columns: [id title production_year]\n" +
 29883  			"         │   └─ Filter\n" +
 29884  			"         │       ├─ (mi_idx.info > '2.0')\n" +
 29885  			"         │       └─ TableAlias(mi_idx)\n" +
 29886  			"         │           └─ Table\n" +
 29887  			"         │               ├─ name: movie_info_idx\n" +
 29888  			"         │               └─ columns: [movie_id info_type_id info]\n" +
 29889  			"         └─ CrossJoin\n" +
 29890  			"             ├─ InnerJoin\n" +
 29891  			"             │   ├─ (k.id = mk.keyword_id)\n" +
 29892  			"             │   ├─ TableAlias(mk)\n" +
 29893  			"             │   │   └─ Table\n" +
 29894  			"             │   │       ├─ name: movie_keyword\n" +
 29895  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 29896  			"             │   └─ Filter\n" +
 29897  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29898  			"             │       └─ TableAlias(k)\n" +
 29899  			"             │           └─ Table\n" +
 29900  			"             │               ├─ name: keyword\n" +
 29901  			"             │               └─ columns: [id keyword]\n" +
 29902  			"             └─ Filter\n" +
 29903  			"                 ├─ (it.info = 'rating')\n" +
 29904  			"                 └─ TableAlias(it)\n" +
 29905  			"                     └─ Table\n" +
 29906  			"                         ├─ name: info_type\n" +
 29907  			"                         └─ columns: [id info]\n" +
 29908  			"",
 29909  		ExpectedAnalysis: "Project\n" +
 29910  			" ├─ columns: [min(mi_idx.info) as rating, min(t.title) as movie_title]\n" +
 29911  			" └─ GroupBy\n" +
 29912  			"     ├─ SelectedExprs(MIN(mi_idx.info), MIN(t.title))\n" +
 29913  			"     ├─ Grouping()\n" +
 29914  			"     └─ InnerJoin\n" +
 29915  			"         ├─ (((it.id = mi_idx.info_type_id) AND (mk.movie_id = mi_idx.movie_id)) AND (t.id = mk.movie_id))\n" +
 29916  			"         ├─ InnerJoin\n" +
 29917  			"         │   ├─ (t.id = mi_idx.movie_id)\n" +
 29918  			"         │   ├─ Filter\n" +
 29919  			"         │   │   ├─ (t.production_year > 1990)\n" +
 29920  			"         │   │   └─ TableAlias(t)\n" +
 29921  			"         │   │       └─ Table\n" +
 29922  			"         │   │           ├─ name: title\n" +
 29923  			"         │   │           └─ columns: [id title production_year]\n" +
 29924  			"         │   └─ Filter\n" +
 29925  			"         │       ├─ (mi_idx.info > '2.0')\n" +
 29926  			"         │       └─ TableAlias(mi_idx)\n" +
 29927  			"         │           └─ Table\n" +
 29928  			"         │               ├─ name: movie_info_idx\n" +
 29929  			"         │               └─ columns: [movie_id info_type_id info]\n" +
 29930  			"         └─ CrossJoin\n" +
 29931  			"             ├─ InnerJoin\n" +
 29932  			"             │   ├─ (k.id = mk.keyword_id)\n" +
 29933  			"             │   ├─ TableAlias(mk)\n" +
 29934  			"             │   │   └─ Table\n" +
 29935  			"             │   │       ├─ name: movie_keyword\n" +
 29936  			"             │   │       └─ columns: [movie_id keyword_id]\n" +
 29937  			"             │   └─ Filter\n" +
 29938  			"             │       ├─ k.keyword LIKE '%sequel%'\n" +
 29939  			"             │       └─ TableAlias(k)\n" +
 29940  			"             │           └─ Table\n" +
 29941  			"             │               ├─ name: keyword\n" +
 29942  			"             │               └─ columns: [id keyword]\n" +
 29943  			"             └─ Filter\n" +
 29944  			"                 ├─ (it.info = 'rating')\n" +
 29945  			"                 └─ TableAlias(it)\n" +
 29946  			"                     └─ Table\n" +
 29947  			"                         ├─ name: info_type\n" +
 29948  			"                         └─ columns: [id info]\n" +
 29949  			"",
 29950  	},
 29951  	{
 29952  		Query: `
 29953  SELECT MIN(t.title) AS typical_european_movie
 29954  FROM company_type AS ct,
 29955       info_type AS it,
 29956       movie_companies AS mc,
 29957       movie_info AS mi,
 29958       title AS t
 29959  WHERE ct.kind = 'production companies'
 29960    AND mc.note LIKE '%(theatrical)%'
 29961    AND mc.note LIKE '%(France)%'
 29962    AND mi.info IN ('Sweden',
 29963                    'Norway',
 29964                    'Germany',
 29965                    'Denmark',
 29966                    'Swedish',
 29967                    'Denish',
 29968                    'Norwegian',
 29969                    'German')
 29970    AND t.production_year > 2005
 29971    AND t.id = mi.movie_id
 29972    AND t.id = mc.movie_id
 29973    AND mc.movie_id = mi.movie_id
 29974    AND ct.id = mc.company_type_id
 29975    AND it.id = mi.info_type_id;
 29976  
 29977  `,
 29978  		ExpectedPlan: "Project\n" +
 29979  			" ├─ columns: [min(t.title):0!null as typical_european_movie]\n" +
 29980  			" └─ GroupBy\n" +
 29981  			"     ├─ select: MIN(t.title:1!null)\n" +
 29982  			"     ├─ group: \n" +
 29983  			"     └─ InnerJoin\n" +
 29984  			"         ├─ AND\n" +
 29985  			"         │   ├─ AND\n" +
 29986  			"         │   │   ├─ Eq\n" +
 29987  			"         │   │   │   ├─ ct.id:10!null\n" +
 29988  			"         │   │   │   └─ mc.company_type_id:4!null\n" +
 29989  			"         │   │   └─ Eq\n" +
 29990  			"         │   │       ├─ mc.movie_id:3!null\n" +
 29991  			"         │   │       └─ mi.movie_id:6!null\n" +
 29992  			"         │   └─ Eq\n" +
 29993  			"         │       ├─ t.id:0!null\n" +
 29994  			"         │       └─ mi.movie_id:6!null\n" +
 29995  			"         ├─ InnerJoin\n" +
 29996  			"         │   ├─ Eq\n" +
 29997  			"         │   │   ├─ t.id:0!null\n" +
 29998  			"         │   │   └─ mc.movie_id:3!null\n" +
 29999  			"         │   ├─ Filter\n" +
 30000  			"         │   │   ├─ GreaterThan\n" +
 30001  			"         │   │   │   ├─ t.production_year:2\n" +
 30002  			"         │   │   │   └─ 2005 (smallint)\n" +
 30003  			"         │   │   └─ TableAlias(t)\n" +
 30004  			"         │   │       └─ ProcessTable\n" +
 30005  			"         │   │           └─ Table\n" +
 30006  			"         │   │               ├─ name: title\n" +
 30007  			"         │   │               └─ columns: [id title production_year]\n" +
 30008  			"         │   └─ Filter\n" +
 30009  			"         │       ├─ AND\n" +
 30010  			"         │       │   ├─ mc.note LIKE '%(theatrical)%'\n" +
 30011  			"         │       │   └─ mc.note LIKE '%(France)%'\n" +
 30012  			"         │       └─ TableAlias(mc)\n" +
 30013  			"         │           └─ ProcessTable\n" +
 30014  			"         │               └─ Table\n" +
 30015  			"         │                   ├─ name: movie_companies\n" +
 30016  			"         │                   └─ columns: [movie_id company_type_id note]\n" +
 30017  			"         └─ CrossJoin\n" +
 30018  			"             ├─ InnerJoin\n" +
 30019  			"             │   ├─ Eq\n" +
 30020  			"             │   │   ├─ it.id:9!null\n" +
 30021  			"             │   │   └─ mi.info_type_id:7!null\n" +
 30022  			"             │   ├─ Filter\n" +
 30023  			"             │   │   ├─ HashIn\n" +
 30024  			"             │   │   │   ├─ mi.info:2!null\n" +
 30025  			"             │   │   │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext))\n" +
 30026  			"             │   │   └─ TableAlias(mi)\n" +
 30027  			"             │   │       └─ ProcessTable\n" +
 30028  			"             │   │           └─ Table\n" +
 30029  			"             │   │               ├─ name: movie_info\n" +
 30030  			"             │   │               └─ columns: [movie_id info_type_id info]\n" +
 30031  			"             │   └─ TableAlias(it)\n" +
 30032  			"             │       └─ ProcessTable\n" +
 30033  			"             │           └─ Table\n" +
 30034  			"             │               ├─ name: info_type\n" +
 30035  			"             │               └─ columns: [id]\n" +
 30036  			"             └─ Filter\n" +
 30037  			"                 ├─ Eq\n" +
 30038  			"                 │   ├─ ct.kind:1!null\n" +
 30039  			"                 │   └─ production companies (longtext)\n" +
 30040  			"                 └─ TableAlias(ct)\n" +
 30041  			"                     └─ ProcessTable\n" +
 30042  			"                         └─ Table\n" +
 30043  			"                             ├─ name: company_type\n" +
 30044  			"                             └─ columns: [id kind]\n" +
 30045  			"",
 30046  		ExpectedEstimates: "Project\n" +
 30047  			" ├─ columns: [min(t.title) as typical_european_movie]\n" +
 30048  			" └─ GroupBy\n" +
 30049  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 30050  			"     ├─ Grouping()\n" +
 30051  			"     └─ InnerJoin\n" +
 30052  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi.movie_id)) AND (t.id = mi.movie_id))\n" +
 30053  			"         ├─ InnerJoin\n" +
 30054  			"         │   ├─ (t.id = mc.movie_id)\n" +
 30055  			"         │   ├─ Filter\n" +
 30056  			"         │   │   ├─ (t.production_year > 2005)\n" +
 30057  			"         │   │   └─ TableAlias(t)\n" +
 30058  			"         │   │       └─ Table\n" +
 30059  			"         │   │           ├─ name: title\n" +
 30060  			"         │   │           └─ columns: [id title production_year]\n" +
 30061  			"         │   └─ Filter\n" +
 30062  			"         │       ├─ (mc.note LIKE '%(theatrical)%' AND mc.note LIKE '%(France)%')\n" +
 30063  			"         │       └─ TableAlias(mc)\n" +
 30064  			"         │           └─ Table\n" +
 30065  			"         │               ├─ name: movie_companies\n" +
 30066  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 30067  			"         └─ CrossJoin\n" +
 30068  			"             ├─ InnerJoin\n" +
 30069  			"             │   ├─ (it.id = mi.info_type_id)\n" +
 30070  			"             │   ├─ Filter\n" +
 30071  			"             │   │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German'))\n" +
 30072  			"             │   │   └─ TableAlias(mi)\n" +
 30073  			"             │   │       └─ Table\n" +
 30074  			"             │   │           ├─ name: movie_info\n" +
 30075  			"             │   │           └─ columns: [movie_id info_type_id info]\n" +
 30076  			"             │   └─ TableAlias(it)\n" +
 30077  			"             │       └─ Table\n" +
 30078  			"             │           ├─ name: info_type\n" +
 30079  			"             │           └─ columns: [id]\n" +
 30080  			"             └─ Filter\n" +
 30081  			"                 ├─ (ct.kind = 'production companies')\n" +
 30082  			"                 └─ TableAlias(ct)\n" +
 30083  			"                     └─ Table\n" +
 30084  			"                         ├─ name: company_type\n" +
 30085  			"                         └─ columns: [id kind]\n" +
 30086  			"",
 30087  		ExpectedAnalysis: "Project\n" +
 30088  			" ├─ columns: [min(t.title) as typical_european_movie]\n" +
 30089  			" └─ GroupBy\n" +
 30090  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 30091  			"     ├─ Grouping()\n" +
 30092  			"     └─ InnerJoin\n" +
 30093  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi.movie_id)) AND (t.id = mi.movie_id))\n" +
 30094  			"         ├─ InnerJoin\n" +
 30095  			"         │   ├─ (t.id = mc.movie_id)\n" +
 30096  			"         │   ├─ Filter\n" +
 30097  			"         │   │   ├─ (t.production_year > 2005)\n" +
 30098  			"         │   │   └─ TableAlias(t)\n" +
 30099  			"         │   │       └─ Table\n" +
 30100  			"         │   │           ├─ name: title\n" +
 30101  			"         │   │           └─ columns: [id title production_year]\n" +
 30102  			"         │   └─ Filter\n" +
 30103  			"         │       ├─ (mc.note LIKE '%(theatrical)%' AND mc.note LIKE '%(France)%')\n" +
 30104  			"         │       └─ TableAlias(mc)\n" +
 30105  			"         │           └─ Table\n" +
 30106  			"         │               ├─ name: movie_companies\n" +
 30107  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 30108  			"         └─ CrossJoin\n" +
 30109  			"             ├─ InnerJoin\n" +
 30110  			"             │   ├─ (it.id = mi.info_type_id)\n" +
 30111  			"             │   ├─ Filter\n" +
 30112  			"             │   │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German'))\n" +
 30113  			"             │   │   └─ TableAlias(mi)\n" +
 30114  			"             │   │       └─ Table\n" +
 30115  			"             │   │           ├─ name: movie_info\n" +
 30116  			"             │   │           └─ columns: [movie_id info_type_id info]\n" +
 30117  			"             │   └─ TableAlias(it)\n" +
 30118  			"             │       └─ Table\n" +
 30119  			"             │           ├─ name: info_type\n" +
 30120  			"             │           └─ columns: [id]\n" +
 30121  			"             └─ Filter\n" +
 30122  			"                 ├─ (ct.kind = 'production companies')\n" +
 30123  			"                 └─ TableAlias(ct)\n" +
 30124  			"                     └─ Table\n" +
 30125  			"                         ├─ name: company_type\n" +
 30126  			"                         └─ columns: [id kind]\n" +
 30127  			"",
 30128  	},
 30129  	{
 30130  		Query: `
 30131  SELECT MIN(t.title) AS american_vhs_movie
 30132  FROM company_type AS ct,
 30133       info_type AS it,
 30134       movie_companies AS mc,
 30135       movie_info AS mi,
 30136       title AS t
 30137  WHERE ct.kind = 'production companies'
 30138    AND mc.note LIKE '%(VHS)%'
 30139    AND mc.note LIKE '%(USA)%'
 30140    AND mc.note LIKE '%(1994)%'
 30141    AND mi.info IN ('USA',
 30142                    'America')
 30143    AND t.production_year > 2010
 30144    AND t.id = mi.movie_id
 30145    AND t.id = mc.movie_id
 30146    AND mc.movie_id = mi.movie_id
 30147    AND ct.id = mc.company_type_id
 30148    AND it.id = mi.info_type_id;
 30149  
 30150  `,
 30151  		ExpectedPlan: "Project\n" +
 30152  			" ├─ columns: [min(t.title):0!null as american_vhs_movie]\n" +
 30153  			" └─ GroupBy\n" +
 30154  			"     ├─ select: MIN(t.title:1!null)\n" +
 30155  			"     ├─ group: \n" +
 30156  			"     └─ InnerJoin\n" +
 30157  			"         ├─ AND\n" +
 30158  			"         │   ├─ AND\n" +
 30159  			"         │   │   ├─ Eq\n" +
 30160  			"         │   │   │   ├─ ct.id:10!null\n" +
 30161  			"         │   │   │   └─ mc.company_type_id:4!null\n" +
 30162  			"         │   │   └─ Eq\n" +
 30163  			"         │   │       ├─ mc.movie_id:3!null\n" +
 30164  			"         │   │       └─ mi.movie_id:6!null\n" +
 30165  			"         │   └─ Eq\n" +
 30166  			"         │       ├─ t.id:0!null\n" +
 30167  			"         │       └─ mi.movie_id:6!null\n" +
 30168  			"         ├─ InnerJoin\n" +
 30169  			"         │   ├─ Eq\n" +
 30170  			"         │   │   ├─ t.id:0!null\n" +
 30171  			"         │   │   └─ mc.movie_id:3!null\n" +
 30172  			"         │   ├─ Filter\n" +
 30173  			"         │   │   ├─ GreaterThan\n" +
 30174  			"         │   │   │   ├─ t.production_year:2\n" +
 30175  			"         │   │   │   └─ 2010 (smallint)\n" +
 30176  			"         │   │   └─ TableAlias(t)\n" +
 30177  			"         │   │       └─ ProcessTable\n" +
 30178  			"         │   │           └─ Table\n" +
 30179  			"         │   │               ├─ name: title\n" +
 30180  			"         │   │               └─ columns: [id title production_year]\n" +
 30181  			"         │   └─ Filter\n" +
 30182  			"         │       ├─ AND\n" +
 30183  			"         │       │   ├─ AND\n" +
 30184  			"         │       │   │   ├─ mc.note LIKE '%(VHS)%'\n" +
 30185  			"         │       │   │   └─ mc.note LIKE '%(USA)%'\n" +
 30186  			"         │       │   └─ mc.note LIKE '%(1994)%'\n" +
 30187  			"         │       └─ TableAlias(mc)\n" +
 30188  			"         │           └─ ProcessTable\n" +
 30189  			"         │               └─ Table\n" +
 30190  			"         │                   ├─ name: movie_companies\n" +
 30191  			"         │                   └─ columns: [movie_id company_type_id note]\n" +
 30192  			"         └─ CrossJoin\n" +
 30193  			"             ├─ InnerJoin\n" +
 30194  			"             │   ├─ Eq\n" +
 30195  			"             │   │   ├─ it.id:9!null\n" +
 30196  			"             │   │   └─ mi.info_type_id:7!null\n" +
 30197  			"             │   ├─ Filter\n" +
 30198  			"             │   │   ├─ HashIn\n" +
 30199  			"             │   │   │   ├─ mi.info:2!null\n" +
 30200  			"             │   │   │   └─ TUPLE(USA (longtext), America (longtext))\n" +
 30201  			"             │   │   └─ TableAlias(mi)\n" +
 30202  			"             │   │       └─ ProcessTable\n" +
 30203  			"             │   │           └─ Table\n" +
 30204  			"             │   │               ├─ name: movie_info\n" +
 30205  			"             │   │               └─ columns: [movie_id info_type_id info]\n" +
 30206  			"             │   └─ TableAlias(it)\n" +
 30207  			"             │       └─ ProcessTable\n" +
 30208  			"             │           └─ Table\n" +
 30209  			"             │               ├─ name: info_type\n" +
 30210  			"             │               └─ columns: [id]\n" +
 30211  			"             └─ Filter\n" +
 30212  			"                 ├─ Eq\n" +
 30213  			"                 │   ├─ ct.kind:1!null\n" +
 30214  			"                 │   └─ production companies (longtext)\n" +
 30215  			"                 └─ TableAlias(ct)\n" +
 30216  			"                     └─ ProcessTable\n" +
 30217  			"                         └─ Table\n" +
 30218  			"                             ├─ name: company_type\n" +
 30219  			"                             └─ columns: [id kind]\n" +
 30220  			"",
 30221  		ExpectedEstimates: "Project\n" +
 30222  			" ├─ columns: [min(t.title) as american_vhs_movie]\n" +
 30223  			" └─ GroupBy\n" +
 30224  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 30225  			"     ├─ Grouping()\n" +
 30226  			"     └─ InnerJoin\n" +
 30227  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi.movie_id)) AND (t.id = mi.movie_id))\n" +
 30228  			"         ├─ InnerJoin\n" +
 30229  			"         │   ├─ (t.id = mc.movie_id)\n" +
 30230  			"         │   ├─ Filter\n" +
 30231  			"         │   │   ├─ (t.production_year > 2010)\n" +
 30232  			"         │   │   └─ TableAlias(t)\n" +
 30233  			"         │   │       └─ Table\n" +
 30234  			"         │   │           ├─ name: title\n" +
 30235  			"         │   │           └─ columns: [id title production_year]\n" +
 30236  			"         │   └─ Filter\n" +
 30237  			"         │       ├─ ((mc.note LIKE '%(VHS)%' AND mc.note LIKE '%(USA)%') AND mc.note LIKE '%(1994)%')\n" +
 30238  			"         │       └─ TableAlias(mc)\n" +
 30239  			"         │           └─ Table\n" +
 30240  			"         │               ├─ name: movie_companies\n" +
 30241  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 30242  			"         └─ CrossJoin\n" +
 30243  			"             ├─ InnerJoin\n" +
 30244  			"             │   ├─ (it.id = mi.info_type_id)\n" +
 30245  			"             │   ├─ Filter\n" +
 30246  			"             │   │   ├─ (mi.info HASH IN ('USA', 'America'))\n" +
 30247  			"             │   │   └─ TableAlias(mi)\n" +
 30248  			"             │   │       └─ Table\n" +
 30249  			"             │   │           ├─ name: movie_info\n" +
 30250  			"             │   │           └─ columns: [movie_id info_type_id info]\n" +
 30251  			"             │   └─ TableAlias(it)\n" +
 30252  			"             │       └─ Table\n" +
 30253  			"             │           ├─ name: info_type\n" +
 30254  			"             │           └─ columns: [id]\n" +
 30255  			"             └─ Filter\n" +
 30256  			"                 ├─ (ct.kind = 'production companies')\n" +
 30257  			"                 └─ TableAlias(ct)\n" +
 30258  			"                     └─ Table\n" +
 30259  			"                         ├─ name: company_type\n" +
 30260  			"                         └─ columns: [id kind]\n" +
 30261  			"",
 30262  		ExpectedAnalysis: "Project\n" +
 30263  			" ├─ columns: [min(t.title) as american_vhs_movie]\n" +
 30264  			" └─ GroupBy\n" +
 30265  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 30266  			"     ├─ Grouping()\n" +
 30267  			"     └─ InnerJoin\n" +
 30268  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi.movie_id)) AND (t.id = mi.movie_id))\n" +
 30269  			"         ├─ InnerJoin\n" +
 30270  			"         │   ├─ (t.id = mc.movie_id)\n" +
 30271  			"         │   ├─ Filter\n" +
 30272  			"         │   │   ├─ (t.production_year > 2010)\n" +
 30273  			"         │   │   └─ TableAlias(t)\n" +
 30274  			"         │   │       └─ Table\n" +
 30275  			"         │   │           ├─ name: title\n" +
 30276  			"         │   │           └─ columns: [id title production_year]\n" +
 30277  			"         │   └─ Filter\n" +
 30278  			"         │       ├─ ((mc.note LIKE '%(VHS)%' AND mc.note LIKE '%(USA)%') AND mc.note LIKE '%(1994)%')\n" +
 30279  			"         │       └─ TableAlias(mc)\n" +
 30280  			"         │           └─ Table\n" +
 30281  			"         │               ├─ name: movie_companies\n" +
 30282  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 30283  			"         └─ CrossJoin\n" +
 30284  			"             ├─ InnerJoin\n" +
 30285  			"             │   ├─ (it.id = mi.info_type_id)\n" +
 30286  			"             │   ├─ Filter\n" +
 30287  			"             │   │   ├─ (mi.info HASH IN ('USA', 'America'))\n" +
 30288  			"             │   │   └─ TableAlias(mi)\n" +
 30289  			"             │   │       └─ Table\n" +
 30290  			"             │   │           ├─ name: movie_info\n" +
 30291  			"             │   │           └─ columns: [movie_id info_type_id info]\n" +
 30292  			"             │   └─ TableAlias(it)\n" +
 30293  			"             │       └─ Table\n" +
 30294  			"             │           ├─ name: info_type\n" +
 30295  			"             │           └─ columns: [id]\n" +
 30296  			"             └─ Filter\n" +
 30297  			"                 ├─ (ct.kind = 'production companies')\n" +
 30298  			"                 └─ TableAlias(ct)\n" +
 30299  			"                     └─ Table\n" +
 30300  			"                         ├─ name: company_type\n" +
 30301  			"                         └─ columns: [id kind]\n" +
 30302  			"",
 30303  	},
 30304  	{
 30305  		Query: `
 30306  SELECT MIN(t.title) AS american_movie
 30307  FROM company_type AS ct,
 30308       info_type AS it,
 30309       movie_companies AS mc,
 30310       movie_info AS mi,
 30311       title AS t
 30312  WHERE ct.kind = 'production companies'
 30313    AND mc.note NOT LIKE '%(TV)%'
 30314    AND mc.note LIKE '%(USA)%'
 30315    AND mi.info IN ('Sweden',
 30316                    'Norway',
 30317                    'Germany',
 30318                    'Denmark',
 30319                    'Swedish',
 30320                    'Denish',
 30321                    'Norwegian',
 30322                    'German',
 30323                    'USA',
 30324                    'American')
 30325    AND t.production_year > 1990
 30326    AND t.id = mi.movie_id
 30327    AND t.id = mc.movie_id
 30328    AND mc.movie_id = mi.movie_id
 30329    AND ct.id = mc.company_type_id
 30330    AND it.id = mi.info_type_id;
 30331  
 30332  `,
 30333  		ExpectedPlan: "Project\n" +
 30334  			" ├─ columns: [min(t.title):0!null as american_movie]\n" +
 30335  			" └─ GroupBy\n" +
 30336  			"     ├─ select: MIN(t.title:1!null)\n" +
 30337  			"     ├─ group: \n" +
 30338  			"     └─ InnerJoin\n" +
 30339  			"         ├─ AND\n" +
 30340  			"         │   ├─ AND\n" +
 30341  			"         │   │   ├─ Eq\n" +
 30342  			"         │   │   │   ├─ ct.id:10!null\n" +
 30343  			"         │   │   │   └─ mc.company_type_id:4!null\n" +
 30344  			"         │   │   └─ Eq\n" +
 30345  			"         │   │       ├─ mc.movie_id:3!null\n" +
 30346  			"         │   │       └─ mi.movie_id:6!null\n" +
 30347  			"         │   └─ Eq\n" +
 30348  			"         │       ├─ t.id:0!null\n" +
 30349  			"         │       └─ mi.movie_id:6!null\n" +
 30350  			"         ├─ InnerJoin\n" +
 30351  			"         │   ├─ Eq\n" +
 30352  			"         │   │   ├─ t.id:0!null\n" +
 30353  			"         │   │   └─ mc.movie_id:3!null\n" +
 30354  			"         │   ├─ Filter\n" +
 30355  			"         │   │   ├─ GreaterThan\n" +
 30356  			"         │   │   │   ├─ t.production_year:2\n" +
 30357  			"         │   │   │   └─ 1990 (smallint)\n" +
 30358  			"         │   │   └─ TableAlias(t)\n" +
 30359  			"         │   │       └─ ProcessTable\n" +
 30360  			"         │   │           └─ Table\n" +
 30361  			"         │   │               ├─ name: title\n" +
 30362  			"         │   │               └─ columns: [id title production_year]\n" +
 30363  			"         │   └─ Filter\n" +
 30364  			"         │       ├─ AND\n" +
 30365  			"         │       │   ├─ NOT\n" +
 30366  			"         │       │   │   └─ mc.note LIKE '%(TV)%'\n" +
 30367  			"         │       │   └─ mc.note LIKE '%(USA)%'\n" +
 30368  			"         │       └─ TableAlias(mc)\n" +
 30369  			"         │           └─ ProcessTable\n" +
 30370  			"         │               └─ Table\n" +
 30371  			"         │                   ├─ name: movie_companies\n" +
 30372  			"         │                   └─ columns: [movie_id company_type_id note]\n" +
 30373  			"         └─ CrossJoin\n" +
 30374  			"             ├─ InnerJoin\n" +
 30375  			"             │   ├─ Eq\n" +
 30376  			"             │   │   ├─ it.id:9!null\n" +
 30377  			"             │   │   └─ mi.info_type_id:7!null\n" +
 30378  			"             │   ├─ Filter\n" +
 30379  			"             │   │   ├─ HashIn\n" +
 30380  			"             │   │   │   ├─ mi.info:2!null\n" +
 30381  			"             │   │   │   └─ TUPLE(Sweden (longtext), Norway (longtext), Germany (longtext), Denmark (longtext), Swedish (longtext), Denish (longtext), Norwegian (longtext), German (longtext), USA (longtext), American (longtext))\n" +
 30382  			"             │   │   └─ TableAlias(mi)\n" +
 30383  			"             │   │       └─ ProcessTable\n" +
 30384  			"             │   │           └─ Table\n" +
 30385  			"             │   │               ├─ name: movie_info\n" +
 30386  			"             │   │               └─ columns: [movie_id info_type_id info]\n" +
 30387  			"             │   └─ TableAlias(it)\n" +
 30388  			"             │       └─ ProcessTable\n" +
 30389  			"             │           └─ Table\n" +
 30390  			"             │               ├─ name: info_type\n" +
 30391  			"             │               └─ columns: [id]\n" +
 30392  			"             └─ Filter\n" +
 30393  			"                 ├─ Eq\n" +
 30394  			"                 │   ├─ ct.kind:1!null\n" +
 30395  			"                 │   └─ production companies (longtext)\n" +
 30396  			"                 └─ TableAlias(ct)\n" +
 30397  			"                     └─ ProcessTable\n" +
 30398  			"                         └─ Table\n" +
 30399  			"                             ├─ name: company_type\n" +
 30400  			"                             └─ columns: [id kind]\n" +
 30401  			"",
 30402  		ExpectedEstimates: "Project\n" +
 30403  			" ├─ columns: [min(t.title) as american_movie]\n" +
 30404  			" └─ GroupBy\n" +
 30405  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 30406  			"     ├─ Grouping()\n" +
 30407  			"     └─ InnerJoin\n" +
 30408  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi.movie_id)) AND (t.id = mi.movie_id))\n" +
 30409  			"         ├─ InnerJoin\n" +
 30410  			"         │   ├─ (t.id = mc.movie_id)\n" +
 30411  			"         │   ├─ Filter\n" +
 30412  			"         │   │   ├─ (t.production_year > 1990)\n" +
 30413  			"         │   │   └─ TableAlias(t)\n" +
 30414  			"         │   │       └─ Table\n" +
 30415  			"         │   │           ├─ name: title\n" +
 30416  			"         │   │           └─ columns: [id title production_year]\n" +
 30417  			"         │   └─ Filter\n" +
 30418  			"         │       ├─ ((NOT(mc.note LIKE '%(TV)%')) AND mc.note LIKE '%(USA)%')\n" +
 30419  			"         │       └─ TableAlias(mc)\n" +
 30420  			"         │           └─ Table\n" +
 30421  			"         │               ├─ name: movie_companies\n" +
 30422  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 30423  			"         └─ CrossJoin\n" +
 30424  			"             ├─ InnerJoin\n" +
 30425  			"             │   ├─ (it.id = mi.info_type_id)\n" +
 30426  			"             │   ├─ Filter\n" +
 30427  			"             │   │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 30428  			"             │   │   └─ TableAlias(mi)\n" +
 30429  			"             │   │       └─ Table\n" +
 30430  			"             │   │           ├─ name: movie_info\n" +
 30431  			"             │   │           └─ columns: [movie_id info_type_id info]\n" +
 30432  			"             │   └─ TableAlias(it)\n" +
 30433  			"             │       └─ Table\n" +
 30434  			"             │           ├─ name: info_type\n" +
 30435  			"             │           └─ columns: [id]\n" +
 30436  			"             └─ Filter\n" +
 30437  			"                 ├─ (ct.kind = 'production companies')\n" +
 30438  			"                 └─ TableAlias(ct)\n" +
 30439  			"                     └─ Table\n" +
 30440  			"                         ├─ name: company_type\n" +
 30441  			"                         └─ columns: [id kind]\n" +
 30442  			"",
 30443  		ExpectedAnalysis: "Project\n" +
 30444  			" ├─ columns: [min(t.title) as american_movie]\n" +
 30445  			" └─ GroupBy\n" +
 30446  			"     ├─ SelectedExprs(MIN(t.title))\n" +
 30447  			"     ├─ Grouping()\n" +
 30448  			"     └─ InnerJoin\n" +
 30449  			"         ├─ (((ct.id = mc.company_type_id) AND (mc.movie_id = mi.movie_id)) AND (t.id = mi.movie_id))\n" +
 30450  			"         ├─ InnerJoin\n" +
 30451  			"         │   ├─ (t.id = mc.movie_id)\n" +
 30452  			"         │   ├─ Filter\n" +
 30453  			"         │   │   ├─ (t.production_year > 1990)\n" +
 30454  			"         │   │   └─ TableAlias(t)\n" +
 30455  			"         │   │       └─ Table\n" +
 30456  			"         │   │           ├─ name: title\n" +
 30457  			"         │   │           └─ columns: [id title production_year]\n" +
 30458  			"         │   └─ Filter\n" +
 30459  			"         │       ├─ ((NOT(mc.note LIKE '%(TV)%')) AND mc.note LIKE '%(USA)%')\n" +
 30460  			"         │       └─ TableAlias(mc)\n" +
 30461  			"         │           └─ Table\n" +
 30462  			"         │               ├─ name: movie_companies\n" +
 30463  			"         │               └─ columns: [movie_id company_type_id note]\n" +
 30464  			"         └─ CrossJoin\n" +
 30465  			"             ├─ InnerJoin\n" +
 30466  			"             │   ├─ (it.id = mi.info_type_id)\n" +
 30467  			"             │   ├─ Filter\n" +
 30468  			"             │   │   ├─ (mi.info HASH IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German', 'USA', 'American'))\n" +
 30469  			"             │   │   └─ TableAlias(mi)\n" +
 30470  			"             │   │       └─ Table\n" +
 30471  			"             │   │           ├─ name: movie_info\n" +
 30472  			"             │   │           └─ columns: [movie_id info_type_id info]\n" +
 30473  			"             │   └─ TableAlias(it)\n" +
 30474  			"             │       └─ Table\n" +
 30475  			"             │           ├─ name: info_type\n" +
 30476  			"             │           └─ columns: [id]\n" +
 30477  			"             └─ Filter\n" +
 30478  			"                 ├─ (ct.kind = 'production companies')\n" +
 30479  			"                 └─ TableAlias(ct)\n" +
 30480  			"                     └─ Table\n" +
 30481  			"                         ├─ name: company_type\n" +
 30482  			"                         └─ columns: [id kind]\n" +
 30483  			"",
 30484  	},
 30485  	{
 30486  		Query: `
 30487  SELECT MIN(k.keyword) AS movie_keyword,
 30488         MIN(n.name) AS actor_name,
 30489         MIN(t.title) AS marvel_movie
 30490  FROM cast_info AS ci,
 30491       keyword AS k,
 30492       movie_keyword AS mk,
 30493       name AS n,
 30494       title AS t
 30495  WHERE k.keyword = 'marvel-cinematic-universe'
 30496    AND n.name LIKE '%Downey%Robert%'
 30497    AND t.production_year > 2010
 30498    AND k.id = mk.keyword_id
 30499    AND t.id = mk.movie_id
 30500    AND t.id = ci.movie_id
 30501    AND ci.movie_id = mk.movie_id
 30502    AND n.id = ci.person_id;
 30503  
 30504  `,
 30505  		ExpectedPlan: "Project\n" +
 30506  			" ├─ columns: [min(k.keyword):0!null as movie_keyword, min(n.name):1!null as actor_name, min(t.title):2!null as marvel_movie]\n" +
 30507  			" └─ GroupBy\n" +
 30508  			"     ├─ select: MIN(k.keyword:6!null), MIN(n.name:8!null), MIN(t.title:1!null)\n" +
 30509  			"     ├─ group: \n" +
 30510  			"     └─ InnerJoin\n" +
 30511  			"         ├─ AND\n" +
 30512  			"         │   ├─ Eq\n" +
 30513  			"         │   │   ├─ ci.movie_id:10!null\n" +
 30514  			"         │   │   └─ mk.movie_id:3!null\n" +
 30515  			"         │   └─ Eq\n" +
 30516  			"         │       ├─ t.id:0!null\n" +
 30517  			"         │       └─ ci.movie_id:10!null\n" +
 30518  			"         ├─ InnerJoin\n" +
 30519  			"         │   ├─ Eq\n" +
 30520  			"         │   │   ├─ t.id:0!null\n" +
 30521  			"         │   │   └─ mk.movie_id:3!null\n" +
 30522  			"         │   ├─ Filter\n" +
 30523  			"         │   │   ├─ GreaterThan\n" +
 30524  			"         │   │   │   ├─ t.production_year:2\n" +
 30525  			"         │   │   │   └─ 2010 (smallint)\n" +
 30526  			"         │   │   └─ TableAlias(t)\n" +
 30527  			"         │   │       └─ ProcessTable\n" +
 30528  			"         │   │           └─ Table\n" +
 30529  			"         │   │               ├─ name: title\n" +
 30530  			"         │   │               └─ columns: [id title production_year]\n" +
 30531  			"         │   └─ InnerJoin\n" +
 30532  			"         │       ├─ Eq\n" +
 30533  			"         │       │   ├─ k.id:5!null\n" +
 30534  			"         │       │   └─ mk.keyword_id:4!null\n" +
 30535  			"         │       ├─ TableAlias(mk)\n" +
 30536  			"         │       │   └─ ProcessTable\n" +
 30537  			"         │       │       └─ Table\n" +
 30538  			"         │       │           ├─ name: movie_keyword\n" +
 30539  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 30540  			"         │       └─ Filter\n" +
 30541  			"         │           ├─ Eq\n" +
 30542  			"         │           │   ├─ k.keyword:1!null\n" +
 30543  			"         │           │   └─ marvel-cinematic-universe (longtext)\n" +
 30544  			"         │           └─ TableAlias(k)\n" +
 30545  			"         │               └─ ProcessTable\n" +
 30546  			"         │                   └─ Table\n" +
 30547  			"         │                       ├─ name: keyword\n" +
 30548  			"         │                       └─ columns: [id keyword]\n" +
 30549  			"         └─ InnerJoin\n" +
 30550  			"             ├─ Eq\n" +
 30551  			"             │   ├─ n.id:7!null\n" +
 30552  			"             │   └─ ci.person_id:9!null\n" +
 30553  			"             ├─ Filter\n" +
 30554  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30555  			"             │   └─ TableAlias(n)\n" +
 30556  			"             │       └─ ProcessTable\n" +
 30557  			"             │           └─ Table\n" +
 30558  			"             │               ├─ name: name\n" +
 30559  			"             │               └─ columns: [id name]\n" +
 30560  			"             └─ TableAlias(ci)\n" +
 30561  			"                 └─ ProcessTable\n" +
 30562  			"                     └─ Table\n" +
 30563  			"                         ├─ name: cast_info\n" +
 30564  			"                         └─ columns: [person_id movie_id]\n" +
 30565  			"",
 30566  		ExpectedEstimates: "Project\n" +
 30567  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as marvel_movie]\n" +
 30568  			" └─ GroupBy\n" +
 30569  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 30570  			"     ├─ Grouping()\n" +
 30571  			"     └─ InnerJoin\n" +
 30572  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 30573  			"         ├─ InnerJoin\n" +
 30574  			"         │   ├─ (t.id = mk.movie_id)\n" +
 30575  			"         │   ├─ Filter\n" +
 30576  			"         │   │   ├─ (t.production_year > 2010)\n" +
 30577  			"         │   │   └─ TableAlias(t)\n" +
 30578  			"         │   │       └─ Table\n" +
 30579  			"         │   │           ├─ name: title\n" +
 30580  			"         │   │           └─ columns: [id title production_year]\n" +
 30581  			"         │   └─ InnerJoin\n" +
 30582  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 30583  			"         │       ├─ TableAlias(mk)\n" +
 30584  			"         │       │   └─ Table\n" +
 30585  			"         │       │       ├─ name: movie_keyword\n" +
 30586  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 30587  			"         │       └─ Filter\n" +
 30588  			"         │           ├─ (k.keyword = 'marvel-cinematic-universe')\n" +
 30589  			"         │           └─ TableAlias(k)\n" +
 30590  			"         │               └─ Table\n" +
 30591  			"         │                   ├─ name: keyword\n" +
 30592  			"         │                   └─ columns: [id keyword]\n" +
 30593  			"         └─ InnerJoin\n" +
 30594  			"             ├─ (n.id = ci.person_id)\n" +
 30595  			"             ├─ Filter\n" +
 30596  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30597  			"             │   └─ TableAlias(n)\n" +
 30598  			"             │       └─ Table\n" +
 30599  			"             │           ├─ name: name\n" +
 30600  			"             │           └─ columns: [id name]\n" +
 30601  			"             └─ TableAlias(ci)\n" +
 30602  			"                 └─ Table\n" +
 30603  			"                     ├─ name: cast_info\n" +
 30604  			"                     └─ columns: [person_id movie_id]\n" +
 30605  			"",
 30606  		ExpectedAnalysis: "Project\n" +
 30607  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as marvel_movie]\n" +
 30608  			" └─ GroupBy\n" +
 30609  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 30610  			"     ├─ Grouping()\n" +
 30611  			"     └─ InnerJoin\n" +
 30612  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 30613  			"         ├─ InnerJoin\n" +
 30614  			"         │   ├─ (t.id = mk.movie_id)\n" +
 30615  			"         │   ├─ Filter\n" +
 30616  			"         │   │   ├─ (t.production_year > 2010)\n" +
 30617  			"         │   │   └─ TableAlias(t)\n" +
 30618  			"         │   │       └─ Table\n" +
 30619  			"         │   │           ├─ name: title\n" +
 30620  			"         │   │           └─ columns: [id title production_year]\n" +
 30621  			"         │   └─ InnerJoin\n" +
 30622  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 30623  			"         │       ├─ TableAlias(mk)\n" +
 30624  			"         │       │   └─ Table\n" +
 30625  			"         │       │       ├─ name: movie_keyword\n" +
 30626  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 30627  			"         │       └─ Filter\n" +
 30628  			"         │           ├─ (k.keyword = 'marvel-cinematic-universe')\n" +
 30629  			"         │           └─ TableAlias(k)\n" +
 30630  			"         │               └─ Table\n" +
 30631  			"         │                   ├─ name: keyword\n" +
 30632  			"         │                   └─ columns: [id keyword]\n" +
 30633  			"         └─ InnerJoin\n" +
 30634  			"             ├─ (n.id = ci.person_id)\n" +
 30635  			"             ├─ Filter\n" +
 30636  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30637  			"             │   └─ TableAlias(n)\n" +
 30638  			"             │       └─ Table\n" +
 30639  			"             │           ├─ name: name\n" +
 30640  			"             │           └─ columns: [id name]\n" +
 30641  			"             └─ TableAlias(ci)\n" +
 30642  			"                 └─ Table\n" +
 30643  			"                     ├─ name: cast_info\n" +
 30644  			"                     └─ columns: [person_id movie_id]\n" +
 30645  			"",
 30646  	},
 30647  	{
 30648  		Query: `
 30649  SELECT MIN(k.keyword) AS movie_keyword,
 30650         MIN(n.name) AS actor_name,
 30651         MIN(t.title) AS hero_movie
 30652  FROM cast_info AS ci,
 30653       keyword AS k,
 30654       movie_keyword AS mk,
 30655       name AS n,
 30656       title AS t
 30657  WHERE k.keyword IN ('superhero',
 30658                      'sequel',
 30659                      'second-part',
 30660                      'marvel-comics',
 30661                      'based-on-comic',
 30662                      'tv-special',
 30663                      'fight',
 30664                      'violence')
 30665    AND n.name LIKE '%Downey%Robert%'
 30666    AND t.production_year > 2014
 30667    AND k.id = mk.keyword_id
 30668    AND t.id = mk.movie_id
 30669    AND t.id = ci.movie_id
 30670    AND ci.movie_id = mk.movie_id
 30671    AND n.id = ci.person_id;
 30672  
 30673  `,
 30674  		ExpectedPlan: "Project\n" +
 30675  			" ├─ columns: [min(k.keyword):0!null as movie_keyword, min(n.name):1!null as actor_name, min(t.title):2!null as hero_movie]\n" +
 30676  			" └─ GroupBy\n" +
 30677  			"     ├─ select: MIN(k.keyword:6!null), MIN(n.name:8!null), MIN(t.title:1!null)\n" +
 30678  			"     ├─ group: \n" +
 30679  			"     └─ InnerJoin\n" +
 30680  			"         ├─ AND\n" +
 30681  			"         │   ├─ Eq\n" +
 30682  			"         │   │   ├─ ci.movie_id:10!null\n" +
 30683  			"         │   │   └─ mk.movie_id:3!null\n" +
 30684  			"         │   └─ Eq\n" +
 30685  			"         │       ├─ t.id:0!null\n" +
 30686  			"         │       └─ ci.movie_id:10!null\n" +
 30687  			"         ├─ InnerJoin\n" +
 30688  			"         │   ├─ Eq\n" +
 30689  			"         │   │   ├─ t.id:0!null\n" +
 30690  			"         │   │   └─ mk.movie_id:3!null\n" +
 30691  			"         │   ├─ Filter\n" +
 30692  			"         │   │   ├─ GreaterThan\n" +
 30693  			"         │   │   │   ├─ t.production_year:2\n" +
 30694  			"         │   │   │   └─ 2014 (smallint)\n" +
 30695  			"         │   │   └─ TableAlias(t)\n" +
 30696  			"         │   │       └─ ProcessTable\n" +
 30697  			"         │   │           └─ Table\n" +
 30698  			"         │   │               ├─ name: title\n" +
 30699  			"         │   │               └─ columns: [id title production_year]\n" +
 30700  			"         │   └─ InnerJoin\n" +
 30701  			"         │       ├─ Eq\n" +
 30702  			"         │       │   ├─ k.id:5!null\n" +
 30703  			"         │       │   └─ mk.keyword_id:4!null\n" +
 30704  			"         │       ├─ TableAlias(mk)\n" +
 30705  			"         │       │   └─ ProcessTable\n" +
 30706  			"         │       │       └─ Table\n" +
 30707  			"         │       │           ├─ name: movie_keyword\n" +
 30708  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 30709  			"         │       └─ Filter\n" +
 30710  			"         │           ├─ HashIn\n" +
 30711  			"         │           │   ├─ k.keyword:1!null\n" +
 30712  			"         │           │   └─ TUPLE(superhero (longtext), sequel (longtext), second-part (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext))\n" +
 30713  			"         │           └─ TableAlias(k)\n" +
 30714  			"         │               └─ ProcessTable\n" +
 30715  			"         │                   └─ Table\n" +
 30716  			"         │                       ├─ name: keyword\n" +
 30717  			"         │                       └─ columns: [id keyword]\n" +
 30718  			"         └─ InnerJoin\n" +
 30719  			"             ├─ Eq\n" +
 30720  			"             │   ├─ n.id:7!null\n" +
 30721  			"             │   └─ ci.person_id:9!null\n" +
 30722  			"             ├─ Filter\n" +
 30723  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30724  			"             │   └─ TableAlias(n)\n" +
 30725  			"             │       └─ ProcessTable\n" +
 30726  			"             │           └─ Table\n" +
 30727  			"             │               ├─ name: name\n" +
 30728  			"             │               └─ columns: [id name]\n" +
 30729  			"             └─ TableAlias(ci)\n" +
 30730  			"                 └─ ProcessTable\n" +
 30731  			"                     └─ Table\n" +
 30732  			"                         ├─ name: cast_info\n" +
 30733  			"                         └─ columns: [person_id movie_id]\n" +
 30734  			"",
 30735  		ExpectedEstimates: "Project\n" +
 30736  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as hero_movie]\n" +
 30737  			" └─ GroupBy\n" +
 30738  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 30739  			"     ├─ Grouping()\n" +
 30740  			"     └─ InnerJoin\n" +
 30741  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 30742  			"         ├─ InnerJoin\n" +
 30743  			"         │   ├─ (t.id = mk.movie_id)\n" +
 30744  			"         │   ├─ Filter\n" +
 30745  			"         │   │   ├─ (t.production_year > 2014)\n" +
 30746  			"         │   │   └─ TableAlias(t)\n" +
 30747  			"         │   │       └─ Table\n" +
 30748  			"         │   │           ├─ name: title\n" +
 30749  			"         │   │           └─ columns: [id title production_year]\n" +
 30750  			"         │   └─ InnerJoin\n" +
 30751  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 30752  			"         │       ├─ TableAlias(mk)\n" +
 30753  			"         │       │   └─ Table\n" +
 30754  			"         │       │       ├─ name: movie_keyword\n" +
 30755  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 30756  			"         │       └─ Filter\n" +
 30757  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 30758  			"         │           └─ TableAlias(k)\n" +
 30759  			"         │               └─ Table\n" +
 30760  			"         │                   ├─ name: keyword\n" +
 30761  			"         │                   └─ columns: [id keyword]\n" +
 30762  			"         └─ InnerJoin\n" +
 30763  			"             ├─ (n.id = ci.person_id)\n" +
 30764  			"             ├─ Filter\n" +
 30765  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30766  			"             │   └─ TableAlias(n)\n" +
 30767  			"             │       └─ Table\n" +
 30768  			"             │           ├─ name: name\n" +
 30769  			"             │           └─ columns: [id name]\n" +
 30770  			"             └─ TableAlias(ci)\n" +
 30771  			"                 └─ Table\n" +
 30772  			"                     ├─ name: cast_info\n" +
 30773  			"                     └─ columns: [person_id movie_id]\n" +
 30774  			"",
 30775  		ExpectedAnalysis: "Project\n" +
 30776  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as hero_movie]\n" +
 30777  			" └─ GroupBy\n" +
 30778  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 30779  			"     ├─ Grouping()\n" +
 30780  			"     └─ InnerJoin\n" +
 30781  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 30782  			"         ├─ InnerJoin\n" +
 30783  			"         │   ├─ (t.id = mk.movie_id)\n" +
 30784  			"         │   ├─ Filter\n" +
 30785  			"         │   │   ├─ (t.production_year > 2014)\n" +
 30786  			"         │   │   └─ TableAlias(t)\n" +
 30787  			"         │   │       └─ Table\n" +
 30788  			"         │   │           ├─ name: title\n" +
 30789  			"         │   │           └─ columns: [id title production_year]\n" +
 30790  			"         │   └─ InnerJoin\n" +
 30791  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 30792  			"         │       ├─ TableAlias(mk)\n" +
 30793  			"         │       │   └─ Table\n" +
 30794  			"         │       │       ├─ name: movie_keyword\n" +
 30795  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 30796  			"         │       └─ Filter\n" +
 30797  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 30798  			"         │           └─ TableAlias(k)\n" +
 30799  			"         │               └─ Table\n" +
 30800  			"         │                   ├─ name: keyword\n" +
 30801  			"         │                   └─ columns: [id keyword]\n" +
 30802  			"         └─ InnerJoin\n" +
 30803  			"             ├─ (n.id = ci.person_id)\n" +
 30804  			"             ├─ Filter\n" +
 30805  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30806  			"             │   └─ TableAlias(n)\n" +
 30807  			"             │       └─ Table\n" +
 30808  			"             │           ├─ name: name\n" +
 30809  			"             │           └─ columns: [id name]\n" +
 30810  			"             └─ TableAlias(ci)\n" +
 30811  			"                 └─ Table\n" +
 30812  			"                     ├─ name: cast_info\n" +
 30813  			"                     └─ columns: [person_id movie_id]\n" +
 30814  			"",
 30815  	},
 30816  	{
 30817  		Query: `
 30818  SELECT MIN(k.keyword) AS movie_keyword,
 30819         MIN(n.name) AS actor_name,
 30820         MIN(t.title) AS marvel_movie
 30821  FROM cast_info AS ci,
 30822       keyword AS k,
 30823       movie_keyword AS mk,
 30824       name AS n,
 30825       title AS t
 30826  WHERE k.keyword = 'marvel-cinematic-universe'
 30827    AND n.name LIKE '%Downey%Robert%'
 30828    AND t.production_year > 2014
 30829    AND k.id = mk.keyword_id
 30830    AND t.id = mk.movie_id
 30831    AND t.id = ci.movie_id
 30832    AND ci.movie_id = mk.movie_id
 30833    AND n.id = ci.person_id;
 30834  
 30835  `,
 30836  		ExpectedPlan: "Project\n" +
 30837  			" ├─ columns: [min(k.keyword):0!null as movie_keyword, min(n.name):1!null as actor_name, min(t.title):2!null as marvel_movie]\n" +
 30838  			" └─ GroupBy\n" +
 30839  			"     ├─ select: MIN(k.keyword:6!null), MIN(n.name:8!null), MIN(t.title:1!null)\n" +
 30840  			"     ├─ group: \n" +
 30841  			"     └─ InnerJoin\n" +
 30842  			"         ├─ AND\n" +
 30843  			"         │   ├─ Eq\n" +
 30844  			"         │   │   ├─ ci.movie_id:10!null\n" +
 30845  			"         │   │   └─ mk.movie_id:3!null\n" +
 30846  			"         │   └─ Eq\n" +
 30847  			"         │       ├─ t.id:0!null\n" +
 30848  			"         │       └─ ci.movie_id:10!null\n" +
 30849  			"         ├─ InnerJoin\n" +
 30850  			"         │   ├─ Eq\n" +
 30851  			"         │   │   ├─ t.id:0!null\n" +
 30852  			"         │   │   └─ mk.movie_id:3!null\n" +
 30853  			"         │   ├─ Filter\n" +
 30854  			"         │   │   ├─ GreaterThan\n" +
 30855  			"         │   │   │   ├─ t.production_year:2\n" +
 30856  			"         │   │   │   └─ 2014 (smallint)\n" +
 30857  			"         │   │   └─ TableAlias(t)\n" +
 30858  			"         │   │       └─ ProcessTable\n" +
 30859  			"         │   │           └─ Table\n" +
 30860  			"         │   │               ├─ name: title\n" +
 30861  			"         │   │               └─ columns: [id title production_year]\n" +
 30862  			"         │   └─ InnerJoin\n" +
 30863  			"         │       ├─ Eq\n" +
 30864  			"         │       │   ├─ k.id:5!null\n" +
 30865  			"         │       │   └─ mk.keyword_id:4!null\n" +
 30866  			"         │       ├─ TableAlias(mk)\n" +
 30867  			"         │       │   └─ ProcessTable\n" +
 30868  			"         │       │       └─ Table\n" +
 30869  			"         │       │           ├─ name: movie_keyword\n" +
 30870  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 30871  			"         │       └─ Filter\n" +
 30872  			"         │           ├─ Eq\n" +
 30873  			"         │           │   ├─ k.keyword:1!null\n" +
 30874  			"         │           │   └─ marvel-cinematic-universe (longtext)\n" +
 30875  			"         │           └─ TableAlias(k)\n" +
 30876  			"         │               └─ ProcessTable\n" +
 30877  			"         │                   └─ Table\n" +
 30878  			"         │                       ├─ name: keyword\n" +
 30879  			"         │                       └─ columns: [id keyword]\n" +
 30880  			"         └─ InnerJoin\n" +
 30881  			"             ├─ Eq\n" +
 30882  			"             │   ├─ n.id:7!null\n" +
 30883  			"             │   └─ ci.person_id:9!null\n" +
 30884  			"             ├─ Filter\n" +
 30885  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30886  			"             │   └─ TableAlias(n)\n" +
 30887  			"             │       └─ ProcessTable\n" +
 30888  			"             │           └─ Table\n" +
 30889  			"             │               ├─ name: name\n" +
 30890  			"             │               └─ columns: [id name]\n" +
 30891  			"             └─ TableAlias(ci)\n" +
 30892  			"                 └─ ProcessTable\n" +
 30893  			"                     └─ Table\n" +
 30894  			"                         ├─ name: cast_info\n" +
 30895  			"                         └─ columns: [person_id movie_id]\n" +
 30896  			"",
 30897  		ExpectedEstimates: "Project\n" +
 30898  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as marvel_movie]\n" +
 30899  			" └─ GroupBy\n" +
 30900  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 30901  			"     ├─ Grouping()\n" +
 30902  			"     └─ InnerJoin\n" +
 30903  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 30904  			"         ├─ InnerJoin\n" +
 30905  			"         │   ├─ (t.id = mk.movie_id)\n" +
 30906  			"         │   ├─ Filter\n" +
 30907  			"         │   │   ├─ (t.production_year > 2014)\n" +
 30908  			"         │   │   └─ TableAlias(t)\n" +
 30909  			"         │   │       └─ Table\n" +
 30910  			"         │   │           ├─ name: title\n" +
 30911  			"         │   │           └─ columns: [id title production_year]\n" +
 30912  			"         │   └─ InnerJoin\n" +
 30913  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 30914  			"         │       ├─ TableAlias(mk)\n" +
 30915  			"         │       │   └─ Table\n" +
 30916  			"         │       │       ├─ name: movie_keyword\n" +
 30917  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 30918  			"         │       └─ Filter\n" +
 30919  			"         │           ├─ (k.keyword = 'marvel-cinematic-universe')\n" +
 30920  			"         │           └─ TableAlias(k)\n" +
 30921  			"         │               └─ Table\n" +
 30922  			"         │                   ├─ name: keyword\n" +
 30923  			"         │                   └─ columns: [id keyword]\n" +
 30924  			"         └─ InnerJoin\n" +
 30925  			"             ├─ (n.id = ci.person_id)\n" +
 30926  			"             ├─ Filter\n" +
 30927  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30928  			"             │   └─ TableAlias(n)\n" +
 30929  			"             │       └─ Table\n" +
 30930  			"             │           ├─ name: name\n" +
 30931  			"             │           └─ columns: [id name]\n" +
 30932  			"             └─ TableAlias(ci)\n" +
 30933  			"                 └─ Table\n" +
 30934  			"                     ├─ name: cast_info\n" +
 30935  			"                     └─ columns: [person_id movie_id]\n" +
 30936  			"",
 30937  		ExpectedAnalysis: "Project\n" +
 30938  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as marvel_movie]\n" +
 30939  			" └─ GroupBy\n" +
 30940  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 30941  			"     ├─ Grouping()\n" +
 30942  			"     └─ InnerJoin\n" +
 30943  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 30944  			"         ├─ InnerJoin\n" +
 30945  			"         │   ├─ (t.id = mk.movie_id)\n" +
 30946  			"         │   ├─ Filter\n" +
 30947  			"         │   │   ├─ (t.production_year > 2014)\n" +
 30948  			"         │   │   └─ TableAlias(t)\n" +
 30949  			"         │   │       └─ Table\n" +
 30950  			"         │   │           ├─ name: title\n" +
 30951  			"         │   │           └─ columns: [id title production_year]\n" +
 30952  			"         │   └─ InnerJoin\n" +
 30953  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 30954  			"         │       ├─ TableAlias(mk)\n" +
 30955  			"         │       │   └─ Table\n" +
 30956  			"         │       │       ├─ name: movie_keyword\n" +
 30957  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 30958  			"         │       └─ Filter\n" +
 30959  			"         │           ├─ (k.keyword = 'marvel-cinematic-universe')\n" +
 30960  			"         │           └─ TableAlias(k)\n" +
 30961  			"         │               └─ Table\n" +
 30962  			"         │                   ├─ name: keyword\n" +
 30963  			"         │                   └─ columns: [id keyword]\n" +
 30964  			"         └─ InnerJoin\n" +
 30965  			"             ├─ (n.id = ci.person_id)\n" +
 30966  			"             ├─ Filter\n" +
 30967  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 30968  			"             │   └─ TableAlias(n)\n" +
 30969  			"             │       └─ Table\n" +
 30970  			"             │           ├─ name: name\n" +
 30971  			"             │           └─ columns: [id name]\n" +
 30972  			"             └─ TableAlias(ci)\n" +
 30973  			"                 └─ Table\n" +
 30974  			"                     ├─ name: cast_info\n" +
 30975  			"                     └─ columns: [person_id movie_id]\n" +
 30976  			"",
 30977  	},
 30978  	{
 30979  		Query: `
 30980  SELECT MIN(k.keyword) AS movie_keyword,
 30981         MIN(n.name) AS actor_name,
 30982         MIN(t.title) AS hero_movie
 30983  FROM cast_info AS ci,
 30984       keyword AS k,
 30985       movie_keyword AS mk,
 30986       name AS n,
 30987       title AS t
 30988  WHERE k.keyword IN ('superhero',
 30989                      'sequel',
 30990                      'second-part',
 30991                      'marvel-comics',
 30992                      'based-on-comic',
 30993                      'tv-special',
 30994                      'fight',
 30995                      'violence')
 30996    AND n.name LIKE '%Downey%Robert%'
 30997    AND t.production_year > 2000
 30998    AND k.id = mk.keyword_id
 30999    AND t.id = mk.movie_id
 31000    AND t.id = ci.movie_id
 31001    AND ci.movie_id = mk.movie_id
 31002    AND n.id = ci.person_id;
 31003  
 31004  `,
 31005  		ExpectedPlan: "Project\n" +
 31006  			" ├─ columns: [min(k.keyword):0!null as movie_keyword, min(n.name):1!null as actor_name, min(t.title):2!null as hero_movie]\n" +
 31007  			" └─ GroupBy\n" +
 31008  			"     ├─ select: MIN(k.keyword:6!null), MIN(n.name:8!null), MIN(t.title:1!null)\n" +
 31009  			"     ├─ group: \n" +
 31010  			"     └─ InnerJoin\n" +
 31011  			"         ├─ AND\n" +
 31012  			"         │   ├─ Eq\n" +
 31013  			"         │   │   ├─ ci.movie_id:10!null\n" +
 31014  			"         │   │   └─ mk.movie_id:3!null\n" +
 31015  			"         │   └─ Eq\n" +
 31016  			"         │       ├─ t.id:0!null\n" +
 31017  			"         │       └─ ci.movie_id:10!null\n" +
 31018  			"         ├─ InnerJoin\n" +
 31019  			"         │   ├─ Eq\n" +
 31020  			"         │   │   ├─ t.id:0!null\n" +
 31021  			"         │   │   └─ mk.movie_id:3!null\n" +
 31022  			"         │   ├─ Filter\n" +
 31023  			"         │   │   ├─ GreaterThan\n" +
 31024  			"         │   │   │   ├─ t.production_year:2\n" +
 31025  			"         │   │   │   └─ 2000 (smallint)\n" +
 31026  			"         │   │   └─ TableAlias(t)\n" +
 31027  			"         │   │       └─ ProcessTable\n" +
 31028  			"         │   │           └─ Table\n" +
 31029  			"         │   │               ├─ name: title\n" +
 31030  			"         │   │               └─ columns: [id title production_year]\n" +
 31031  			"         │   └─ InnerJoin\n" +
 31032  			"         │       ├─ Eq\n" +
 31033  			"         │       │   ├─ k.id:5!null\n" +
 31034  			"         │       │   └─ mk.keyword_id:4!null\n" +
 31035  			"         │       ├─ TableAlias(mk)\n" +
 31036  			"         │       │   └─ ProcessTable\n" +
 31037  			"         │       │       └─ Table\n" +
 31038  			"         │       │           ├─ name: movie_keyword\n" +
 31039  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 31040  			"         │       └─ Filter\n" +
 31041  			"         │           ├─ HashIn\n" +
 31042  			"         │           │   ├─ k.keyword:1!null\n" +
 31043  			"         │           │   └─ TUPLE(superhero (longtext), sequel (longtext), second-part (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext))\n" +
 31044  			"         │           └─ TableAlias(k)\n" +
 31045  			"         │               └─ ProcessTable\n" +
 31046  			"         │                   └─ Table\n" +
 31047  			"         │                       ├─ name: keyword\n" +
 31048  			"         │                       └─ columns: [id keyword]\n" +
 31049  			"         └─ InnerJoin\n" +
 31050  			"             ├─ Eq\n" +
 31051  			"             │   ├─ n.id:7!null\n" +
 31052  			"             │   └─ ci.person_id:9!null\n" +
 31053  			"             ├─ Filter\n" +
 31054  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 31055  			"             │   └─ TableAlias(n)\n" +
 31056  			"             │       └─ ProcessTable\n" +
 31057  			"             │           └─ Table\n" +
 31058  			"             │               ├─ name: name\n" +
 31059  			"             │               └─ columns: [id name]\n" +
 31060  			"             └─ TableAlias(ci)\n" +
 31061  			"                 └─ ProcessTable\n" +
 31062  			"                     └─ Table\n" +
 31063  			"                         ├─ name: cast_info\n" +
 31064  			"                         └─ columns: [person_id movie_id]\n" +
 31065  			"",
 31066  		ExpectedEstimates: "Project\n" +
 31067  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as hero_movie]\n" +
 31068  			" └─ GroupBy\n" +
 31069  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 31070  			"     ├─ Grouping()\n" +
 31071  			"     └─ InnerJoin\n" +
 31072  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 31073  			"         ├─ InnerJoin\n" +
 31074  			"         │   ├─ (t.id = mk.movie_id)\n" +
 31075  			"         │   ├─ Filter\n" +
 31076  			"         │   │   ├─ (t.production_year > 2000)\n" +
 31077  			"         │   │   └─ TableAlias(t)\n" +
 31078  			"         │   │       └─ Table\n" +
 31079  			"         │   │           ├─ name: title\n" +
 31080  			"         │   │           └─ columns: [id title production_year]\n" +
 31081  			"         │   └─ InnerJoin\n" +
 31082  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 31083  			"         │       ├─ TableAlias(mk)\n" +
 31084  			"         │       │   └─ Table\n" +
 31085  			"         │       │       ├─ name: movie_keyword\n" +
 31086  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 31087  			"         │       └─ Filter\n" +
 31088  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 31089  			"         │           └─ TableAlias(k)\n" +
 31090  			"         │               └─ Table\n" +
 31091  			"         │                   ├─ name: keyword\n" +
 31092  			"         │                   └─ columns: [id keyword]\n" +
 31093  			"         └─ InnerJoin\n" +
 31094  			"             ├─ (n.id = ci.person_id)\n" +
 31095  			"             ├─ Filter\n" +
 31096  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 31097  			"             │   └─ TableAlias(n)\n" +
 31098  			"             │       └─ Table\n" +
 31099  			"             │           ├─ name: name\n" +
 31100  			"             │           └─ columns: [id name]\n" +
 31101  			"             └─ TableAlias(ci)\n" +
 31102  			"                 └─ Table\n" +
 31103  			"                     ├─ name: cast_info\n" +
 31104  			"                     └─ columns: [person_id movie_id]\n" +
 31105  			"",
 31106  		ExpectedAnalysis: "Project\n" +
 31107  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as hero_movie]\n" +
 31108  			" └─ GroupBy\n" +
 31109  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 31110  			"     ├─ Grouping()\n" +
 31111  			"     └─ InnerJoin\n" +
 31112  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 31113  			"         ├─ InnerJoin\n" +
 31114  			"         │   ├─ (t.id = mk.movie_id)\n" +
 31115  			"         │   ├─ Filter\n" +
 31116  			"         │   │   ├─ (t.production_year > 2000)\n" +
 31117  			"         │   │   └─ TableAlias(t)\n" +
 31118  			"         │   │       └─ Table\n" +
 31119  			"         │   │           ├─ name: title\n" +
 31120  			"         │   │           └─ columns: [id title production_year]\n" +
 31121  			"         │   └─ InnerJoin\n" +
 31122  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 31123  			"         │       ├─ TableAlias(mk)\n" +
 31124  			"         │       │   └─ Table\n" +
 31125  			"         │       │       ├─ name: movie_keyword\n" +
 31126  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 31127  			"         │       └─ Filter\n" +
 31128  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 31129  			"         │           └─ TableAlias(k)\n" +
 31130  			"         │               └─ Table\n" +
 31131  			"         │                   ├─ name: keyword\n" +
 31132  			"         │                   └─ columns: [id keyword]\n" +
 31133  			"         └─ InnerJoin\n" +
 31134  			"             ├─ (n.id = ci.person_id)\n" +
 31135  			"             ├─ Filter\n" +
 31136  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 31137  			"             │   └─ TableAlias(n)\n" +
 31138  			"             │       └─ Table\n" +
 31139  			"             │           ├─ name: name\n" +
 31140  			"             │           └─ columns: [id name]\n" +
 31141  			"             └─ TableAlias(ci)\n" +
 31142  			"                 └─ Table\n" +
 31143  			"                     ├─ name: cast_info\n" +
 31144  			"                     └─ columns: [person_id movie_id]\n" +
 31145  			"",
 31146  	},
 31147  	{
 31148  		Query: `
 31149  SELECT MIN(k.keyword) AS movie_keyword,
 31150         MIN(n.name) AS actor_name,
 31151         MIN(t.title) AS marvel_movie
 31152  FROM cast_info AS ci,
 31153       keyword AS k,
 31154       movie_keyword AS mk,
 31155       name AS n,
 31156       title AS t
 31157  WHERE k.keyword = 'marvel-cinematic-universe'
 31158    AND n.name LIKE '%Downey%Robert%'
 31159    AND t.production_year > 2000
 31160    AND k.id = mk.keyword_id
 31161    AND t.id = mk.movie_id
 31162    AND t.id = ci.movie_id
 31163    AND ci.movie_id = mk.movie_id
 31164    AND n.id = ci.person_id;
 31165  
 31166  `,
 31167  		ExpectedPlan: "Project\n" +
 31168  			" ├─ columns: [min(k.keyword):0!null as movie_keyword, min(n.name):1!null as actor_name, min(t.title):2!null as marvel_movie]\n" +
 31169  			" └─ GroupBy\n" +
 31170  			"     ├─ select: MIN(k.keyword:6!null), MIN(n.name:8!null), MIN(t.title:1!null)\n" +
 31171  			"     ├─ group: \n" +
 31172  			"     └─ InnerJoin\n" +
 31173  			"         ├─ AND\n" +
 31174  			"         │   ├─ Eq\n" +
 31175  			"         │   │   ├─ ci.movie_id:10!null\n" +
 31176  			"         │   │   └─ mk.movie_id:3!null\n" +
 31177  			"         │   └─ Eq\n" +
 31178  			"         │       ├─ t.id:0!null\n" +
 31179  			"         │       └─ ci.movie_id:10!null\n" +
 31180  			"         ├─ InnerJoin\n" +
 31181  			"         │   ├─ Eq\n" +
 31182  			"         │   │   ├─ t.id:0!null\n" +
 31183  			"         │   │   └─ mk.movie_id:3!null\n" +
 31184  			"         │   ├─ Filter\n" +
 31185  			"         │   │   ├─ GreaterThan\n" +
 31186  			"         │   │   │   ├─ t.production_year:2\n" +
 31187  			"         │   │   │   └─ 2000 (smallint)\n" +
 31188  			"         │   │   └─ TableAlias(t)\n" +
 31189  			"         │   │       └─ ProcessTable\n" +
 31190  			"         │   │           └─ Table\n" +
 31191  			"         │   │               ├─ name: title\n" +
 31192  			"         │   │               └─ columns: [id title production_year]\n" +
 31193  			"         │   └─ InnerJoin\n" +
 31194  			"         │       ├─ Eq\n" +
 31195  			"         │       │   ├─ k.id:5!null\n" +
 31196  			"         │       │   └─ mk.keyword_id:4!null\n" +
 31197  			"         │       ├─ TableAlias(mk)\n" +
 31198  			"         │       │   └─ ProcessTable\n" +
 31199  			"         │       │       └─ Table\n" +
 31200  			"         │       │           ├─ name: movie_keyword\n" +
 31201  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 31202  			"         │       └─ Filter\n" +
 31203  			"         │           ├─ Eq\n" +
 31204  			"         │           │   ├─ k.keyword:1!null\n" +
 31205  			"         │           │   └─ marvel-cinematic-universe (longtext)\n" +
 31206  			"         │           └─ TableAlias(k)\n" +
 31207  			"         │               └─ ProcessTable\n" +
 31208  			"         │                   └─ Table\n" +
 31209  			"         │                       ├─ name: keyword\n" +
 31210  			"         │                       └─ columns: [id keyword]\n" +
 31211  			"         └─ InnerJoin\n" +
 31212  			"             ├─ Eq\n" +
 31213  			"             │   ├─ n.id:7!null\n" +
 31214  			"             │   └─ ci.person_id:9!null\n" +
 31215  			"             ├─ Filter\n" +
 31216  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 31217  			"             │   └─ TableAlias(n)\n" +
 31218  			"             │       └─ ProcessTable\n" +
 31219  			"             │           └─ Table\n" +
 31220  			"             │               ├─ name: name\n" +
 31221  			"             │               └─ columns: [id name]\n" +
 31222  			"             └─ TableAlias(ci)\n" +
 31223  			"                 └─ ProcessTable\n" +
 31224  			"                     └─ Table\n" +
 31225  			"                         ├─ name: cast_info\n" +
 31226  			"                         └─ columns: [person_id movie_id]\n" +
 31227  			"",
 31228  		ExpectedEstimates: "Project\n" +
 31229  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as marvel_movie]\n" +
 31230  			" └─ GroupBy\n" +
 31231  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 31232  			"     ├─ Grouping()\n" +
 31233  			"     └─ InnerJoin\n" +
 31234  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 31235  			"         ├─ InnerJoin\n" +
 31236  			"         │   ├─ (t.id = mk.movie_id)\n" +
 31237  			"         │   ├─ Filter\n" +
 31238  			"         │   │   ├─ (t.production_year > 2000)\n" +
 31239  			"         │   │   └─ TableAlias(t)\n" +
 31240  			"         │   │       └─ Table\n" +
 31241  			"         │   │           ├─ name: title\n" +
 31242  			"         │   │           └─ columns: [id title production_year]\n" +
 31243  			"         │   └─ InnerJoin\n" +
 31244  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 31245  			"         │       ├─ TableAlias(mk)\n" +
 31246  			"         │       │   └─ Table\n" +
 31247  			"         │       │       ├─ name: movie_keyword\n" +
 31248  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 31249  			"         │       └─ Filter\n" +
 31250  			"         │           ├─ (k.keyword = 'marvel-cinematic-universe')\n" +
 31251  			"         │           └─ TableAlias(k)\n" +
 31252  			"         │               └─ Table\n" +
 31253  			"         │                   ├─ name: keyword\n" +
 31254  			"         │                   └─ columns: [id keyword]\n" +
 31255  			"         └─ InnerJoin\n" +
 31256  			"             ├─ (n.id = ci.person_id)\n" +
 31257  			"             ├─ Filter\n" +
 31258  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 31259  			"             │   └─ TableAlias(n)\n" +
 31260  			"             │       └─ Table\n" +
 31261  			"             │           ├─ name: name\n" +
 31262  			"             │           └─ columns: [id name]\n" +
 31263  			"             └─ TableAlias(ci)\n" +
 31264  			"                 └─ Table\n" +
 31265  			"                     ├─ name: cast_info\n" +
 31266  			"                     └─ columns: [person_id movie_id]\n" +
 31267  			"",
 31268  		ExpectedAnalysis: "Project\n" +
 31269  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as marvel_movie]\n" +
 31270  			" └─ GroupBy\n" +
 31271  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 31272  			"     ├─ Grouping()\n" +
 31273  			"     └─ InnerJoin\n" +
 31274  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 31275  			"         ├─ InnerJoin\n" +
 31276  			"         │   ├─ (t.id = mk.movie_id)\n" +
 31277  			"         │   ├─ Filter\n" +
 31278  			"         │   │   ├─ (t.production_year > 2000)\n" +
 31279  			"         │   │   └─ TableAlias(t)\n" +
 31280  			"         │   │       └─ Table\n" +
 31281  			"         │   │           ├─ name: title\n" +
 31282  			"         │   │           └─ columns: [id title production_year]\n" +
 31283  			"         │   └─ InnerJoin\n" +
 31284  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 31285  			"         │       ├─ TableAlias(mk)\n" +
 31286  			"         │       │   └─ Table\n" +
 31287  			"         │       │       ├─ name: movie_keyword\n" +
 31288  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 31289  			"         │       └─ Filter\n" +
 31290  			"         │           ├─ (k.keyword = 'marvel-cinematic-universe')\n" +
 31291  			"         │           └─ TableAlias(k)\n" +
 31292  			"         │               └─ Table\n" +
 31293  			"         │                   ├─ name: keyword\n" +
 31294  			"         │                   └─ columns: [id keyword]\n" +
 31295  			"         └─ InnerJoin\n" +
 31296  			"             ├─ (n.id = ci.person_id)\n" +
 31297  			"             ├─ Filter\n" +
 31298  			"             │   ├─ n.name LIKE '%Downey%Robert%'\n" +
 31299  			"             │   └─ TableAlias(n)\n" +
 31300  			"             │       └─ Table\n" +
 31301  			"             │           ├─ name: name\n" +
 31302  			"             │           └─ columns: [id name]\n" +
 31303  			"             └─ TableAlias(ci)\n" +
 31304  			"                 └─ Table\n" +
 31305  			"                     ├─ name: cast_info\n" +
 31306  			"                     └─ columns: [person_id movie_id]\n" +
 31307  			"",
 31308  	},
 31309  	{
 31310  		Query: `
 31311  SELECT MIN(k.keyword) AS movie_keyword,
 31312         MIN(n.name) AS actor_name,
 31313         MIN(t.title) AS hero_movie
 31314  FROM cast_info AS ci,
 31315       keyword AS k,
 31316       movie_keyword AS mk,
 31317       name AS n,
 31318       title AS t
 31319  WHERE k.keyword IN ('superhero',
 31320                      'sequel',
 31321                      'second-part',
 31322                      'marvel-comics',
 31323                      'based-on-comic',
 31324                      'tv-special',
 31325                      'fight',
 31326                      'violence')
 31327    AND t.production_year > 2000
 31328    AND k.id = mk.keyword_id
 31329    AND t.id = mk.movie_id
 31330    AND t.id = ci.movie_id
 31331    AND ci.movie_id = mk.movie_id
 31332    AND n.id = ci.person_id;
 31333  
 31334  `,
 31335  		ExpectedPlan: "Project\n" +
 31336  			" ├─ columns: [min(k.keyword):0!null as movie_keyword, min(n.name):1!null as actor_name, min(t.title):2!null as hero_movie]\n" +
 31337  			" └─ GroupBy\n" +
 31338  			"     ├─ select: MIN(k.keyword:6!null), MIN(n.name:8!null), MIN(t.title:1!null)\n" +
 31339  			"     ├─ group: \n" +
 31340  			"     └─ InnerJoin\n" +
 31341  			"         ├─ AND\n" +
 31342  			"         │   ├─ Eq\n" +
 31343  			"         │   │   ├─ ci.movie_id:10!null\n" +
 31344  			"         │   │   └─ mk.movie_id:3!null\n" +
 31345  			"         │   └─ Eq\n" +
 31346  			"         │       ├─ t.id:0!null\n" +
 31347  			"         │       └─ ci.movie_id:10!null\n" +
 31348  			"         ├─ InnerJoin\n" +
 31349  			"         │   ├─ Eq\n" +
 31350  			"         │   │   ├─ t.id:0!null\n" +
 31351  			"         │   │   └─ mk.movie_id:3!null\n" +
 31352  			"         │   ├─ Filter\n" +
 31353  			"         │   │   ├─ GreaterThan\n" +
 31354  			"         │   │   │   ├─ t.production_year:2\n" +
 31355  			"         │   │   │   └─ 2000 (smallint)\n" +
 31356  			"         │   │   └─ TableAlias(t)\n" +
 31357  			"         │   │       └─ ProcessTable\n" +
 31358  			"         │   │           └─ Table\n" +
 31359  			"         │   │               ├─ name: title\n" +
 31360  			"         │   │               └─ columns: [id title production_year]\n" +
 31361  			"         │   └─ InnerJoin\n" +
 31362  			"         │       ├─ Eq\n" +
 31363  			"         │       │   ├─ k.id:5!null\n" +
 31364  			"         │       │   └─ mk.keyword_id:4!null\n" +
 31365  			"         │       ├─ TableAlias(mk)\n" +
 31366  			"         │       │   └─ ProcessTable\n" +
 31367  			"         │       │       └─ Table\n" +
 31368  			"         │       │           ├─ name: movie_keyword\n" +
 31369  			"         │       │           └─ columns: [movie_id keyword_id]\n" +
 31370  			"         │       └─ Filter\n" +
 31371  			"         │           ├─ HashIn\n" +
 31372  			"         │           │   ├─ k.keyword:1!null\n" +
 31373  			"         │           │   └─ TUPLE(superhero (longtext), sequel (longtext), second-part (longtext), marvel-comics (longtext), based-on-comic (longtext), tv-special (longtext), fight (longtext), violence (longtext))\n" +
 31374  			"         │           └─ TableAlias(k)\n" +
 31375  			"         │               └─ ProcessTable\n" +
 31376  			"         │                   └─ Table\n" +
 31377  			"         │                       ├─ name: keyword\n" +
 31378  			"         │                       └─ columns: [id keyword]\n" +
 31379  			"         └─ InnerJoin\n" +
 31380  			"             ├─ Eq\n" +
 31381  			"             │   ├─ n.id:7!null\n" +
 31382  			"             │   └─ ci.person_id:9!null\n" +
 31383  			"             ├─ TableAlias(n)\n" +
 31384  			"             │   └─ ProcessTable\n" +
 31385  			"             │       └─ Table\n" +
 31386  			"             │           ├─ name: name\n" +
 31387  			"             │           └─ columns: [id name]\n" +
 31388  			"             └─ TableAlias(ci)\n" +
 31389  			"                 └─ ProcessTable\n" +
 31390  			"                     └─ Table\n" +
 31391  			"                         ├─ name: cast_info\n" +
 31392  			"                         └─ columns: [person_id movie_id]\n" +
 31393  			"",
 31394  		ExpectedEstimates: "Project\n" +
 31395  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as hero_movie]\n" +
 31396  			" └─ GroupBy\n" +
 31397  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 31398  			"     ├─ Grouping()\n" +
 31399  			"     └─ InnerJoin\n" +
 31400  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 31401  			"         ├─ InnerJoin\n" +
 31402  			"         │   ├─ (t.id = mk.movie_id)\n" +
 31403  			"         │   ├─ Filter\n" +
 31404  			"         │   │   ├─ (t.production_year > 2000)\n" +
 31405  			"         │   │   └─ TableAlias(t)\n" +
 31406  			"         │   │       └─ Table\n" +
 31407  			"         │   │           ├─ name: title\n" +
 31408  			"         │   │           └─ columns: [id title production_year]\n" +
 31409  			"         │   └─ InnerJoin\n" +
 31410  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 31411  			"         │       ├─ TableAlias(mk)\n" +
 31412  			"         │       │   └─ Table\n" +
 31413  			"         │       │       ├─ name: movie_keyword\n" +
 31414  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 31415  			"         │       └─ Filter\n" +
 31416  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 31417  			"         │           └─ TableAlias(k)\n" +
 31418  			"         │               └─ Table\n" +
 31419  			"         │                   ├─ name: keyword\n" +
 31420  			"         │                   └─ columns: [id keyword]\n" +
 31421  			"         └─ InnerJoin\n" +
 31422  			"             ├─ (n.id = ci.person_id)\n" +
 31423  			"             ├─ TableAlias(n)\n" +
 31424  			"             │   └─ Table\n" +
 31425  			"             │       ├─ name: name\n" +
 31426  			"             │       └─ columns: [id name]\n" +
 31427  			"             └─ TableAlias(ci)\n" +
 31428  			"                 └─ Table\n" +
 31429  			"                     ├─ name: cast_info\n" +
 31430  			"                     └─ columns: [person_id movie_id]\n" +
 31431  			"",
 31432  		ExpectedAnalysis: "Project\n" +
 31433  			" ├─ columns: [min(k.keyword) as movie_keyword, min(n.name) as actor_name, min(t.title) as hero_movie]\n" +
 31434  			" └─ GroupBy\n" +
 31435  			"     ├─ SelectedExprs(MIN(k.keyword), MIN(n.name), MIN(t.title))\n" +
 31436  			"     ├─ Grouping()\n" +
 31437  			"     └─ InnerJoin\n" +
 31438  			"         ├─ ((ci.movie_id = mk.movie_id) AND (t.id = ci.movie_id))\n" +
 31439  			"         ├─ InnerJoin\n" +
 31440  			"         │   ├─ (t.id = mk.movie_id)\n" +
 31441  			"         │   ├─ Filter\n" +
 31442  			"         │   │   ├─ (t.production_year > 2000)\n" +
 31443  			"         │   │   └─ TableAlias(t)\n" +
 31444  			"         │   │       └─ Table\n" +
 31445  			"         │   │           ├─ name: title\n" +
 31446  			"         │   │           └─ columns: [id title production_year]\n" +
 31447  			"         │   └─ InnerJoin\n" +
 31448  			"         │       ├─ (k.id = mk.keyword_id)\n" +
 31449  			"         │       ├─ TableAlias(mk)\n" +
 31450  			"         │       │   └─ Table\n" +
 31451  			"         │       │       ├─ name: movie_keyword\n" +
 31452  			"         │       │       └─ columns: [movie_id keyword_id]\n" +
 31453  			"         │       └─ Filter\n" +
 31454  			"         │           ├─ (k.keyword HASH IN ('superhero', 'sequel', 'second-part', 'marvel-comics', 'based-on-comic', 'tv-special', 'fight', 'violence'))\n" +
 31455  			"         │           └─ TableAlias(k)\n" +
 31456  			"         │               └─ Table\n" +
 31457  			"         │                   ├─ name: keyword\n" +
 31458  			"         │                   └─ columns: [id keyword]\n" +
 31459  			"         └─ InnerJoin\n" +
 31460  			"             ├─ (n.id = ci.person_id)\n" +
 31461  			"             ├─ TableAlias(n)\n" +
 31462  			"             │   └─ Table\n" +
 31463  			"             │       ├─ name: name\n" +
 31464  			"             │       └─ columns: [id name]\n" +
 31465  			"             └─ TableAlias(ci)\n" +
 31466  			"                 └─ Table\n" +
 31467  			"                     ├─ name: cast_info\n" +
 31468  			"                     └─ columns: [person_id movie_id]\n" +
 31469  			"",
 31470  	},
 31471  	{
 31472  		Query: `
 31473  SELECT MIN(n.name) AS of_person,
 31474         MIN(t.title) AS biography_movie
 31475  FROM aka_name AS an,
 31476       cast_info AS ci,
 31477       info_type AS it,
 31478       link_type AS lt,
 31479       movie_link AS ml,
 31480       name AS n,
 31481       person_info AS pi,
 31482       title AS t
 31483  WHERE an.name LIKE '%a%'
 31484    AND it.info ='mini biography'
 31485    AND lt.link ='features'
 31486    AND n.name_pcode_cf BETWEEN 'A' AND 'F'
 31487    AND (n.gender='m'
 31488         OR (n.gender = 'f'
 31489             AND n.name LIKE 'B%'))
 31490    AND pi.note ='Volker Boehm'
 31491    AND t.production_year BETWEEN 1980 AND 1995
 31492    AND n.id = an.person_id
 31493    AND n.id = pi.person_id
 31494    AND ci.person_id = n.id
 31495    AND t.id = ci.movie_id
 31496    AND ml.linked_movie_id = t.id
 31497    AND lt.id = ml.link_type_id
 31498    AND it.id = pi.info_type_id
 31499    AND pi.person_id = an.person_id
 31500    AND pi.person_id = ci.person_id
 31501    AND an.person_id = ci.person_id
 31502    AND ci.movie_id = ml.linked_movie_id;
 31503  
 31504  `,
 31505  		ExpectedPlan: "Project\n" +
 31506  			" ├─ columns: [min(n.name):0!null as of_person, min(t.title):1!null as biography_movie]\n" +
 31507  			" └─ GroupBy\n" +
 31508  			"     ├─ select: MIN(n.name:9!null), MIN(t.title:1!null)\n" +
 31509  			"     ├─ group: \n" +
 31510  			"     └─ InnerJoin\n" +
 31511  			"         ├─ AND\n" +
 31512  			"         │   ├─ Eq\n" +
 31513  			"         │   │   ├─ t.id:0!null\n" +
 31514  			"         │   │   └─ ci.movie_id:13!null\n" +
 31515  			"         │   └─ Eq\n" +
 31516  			"         │       ├─ ml.linked_movie_id:16!null\n" +
 31517  			"         │       └─ t.id:0!null\n" +
 31518  			"         ├─ Filter\n" +
 31519  			"         │   ├─ AND\n" +
 31520  			"         │   │   ├─ GreaterThanOrEqual\n" +
 31521  			"         │   │   │   ├─ t.production_year:2\n" +
 31522  			"         │   │   │   └─ 1980 (smallint)\n" +
 31523  			"         │   │   └─ LessThanOrEqual\n" +
 31524  			"         │   │       ├─ t.production_year:2\n" +
 31525  			"         │   │       └─ 1995 (smallint)\n" +
 31526  			"         │   └─ TableAlias(t)\n" +
 31527  			"         │       └─ ProcessTable\n" +
 31528  			"         │           └─ Table\n" +
 31529  			"         │               ├─ name: title\n" +
 31530  			"         │               └─ columns: [id title production_year]\n" +
 31531  			"         └─ InnerJoin\n" +
 31532  			"             ├─ AND\n" +
 31533  			"             │   ├─ AND\n" +
 31534  			"             │   │   ├─ Eq\n" +
 31535  			"             │   │   │   ├─ n.id:8!null\n" +
 31536  			"             │   │   │   └─ pi.person_id:3!null\n" +
 31537  			"             │   │   └─ Eq\n" +
 31538  			"             │   │       ├─ pi.person_id:3!null\n" +
 31539  			"             │   │       └─ an.person_id:14!null\n" +
 31540  			"             │   └─ Eq\n" +
 31541  			"             │       ├─ pi.person_id:3!null\n" +
 31542  			"             │       └─ ci.person_id:12!null\n" +
 31543  			"             ├─ InnerJoin\n" +
 31544  			"             │   ├─ Eq\n" +
 31545  			"             │   │   ├─ it.id:6!null\n" +
 31546  			"             │   │   └─ pi.info_type_id:4!null\n" +
 31547  			"             │   ├─ Filter\n" +
 31548  			"             │   │   ├─ Eq\n" +
 31549  			"             │   │   │   ├─ pi.note:2\n" +
 31550  			"             │   │   │   └─ Volker Boehm (longtext)\n" +
 31551  			"             │   │   └─ TableAlias(pi)\n" +
 31552  			"             │   │       └─ ProcessTable\n" +
 31553  			"             │   │           └─ Table\n" +
 31554  			"             │   │               ├─ name: person_info\n" +
 31555  			"             │   │               └─ columns: [person_id info_type_id note]\n" +
 31556  			"             │   └─ Filter\n" +
 31557  			"             │       ├─ Eq\n" +
 31558  			"             │       │   ├─ it.info:1!null\n" +
 31559  			"             │       │   └─ mini biography (longtext)\n" +
 31560  			"             │       └─ TableAlias(it)\n" +
 31561  			"             │           └─ ProcessTable\n" +
 31562  			"             │               └─ Table\n" +
 31563  			"             │                   ├─ name: info_type\n" +
 31564  			"             │                   └─ columns: [id info]\n" +
 31565  			"             └─ InnerJoin\n" +
 31566  			"                 ├─ Eq\n" +
 31567  			"                 │   ├─ lt.id:18!null\n" +
 31568  			"                 │   └─ ml.link_type_id:17!null\n" +
 31569  			"                 ├─ InnerJoin\n" +
 31570  			"                 │   ├─ Eq\n" +
 31571  			"                 │   │   ├─ ci.movie_id:13!null\n" +
 31572  			"                 │   │   └─ ml.linked_movie_id:16!null\n" +
 31573  			"                 │   ├─ LookupJoin\n" +
 31574  			"                 │   │   ├─ Eq\n" +
 31575  			"                 │   │   │   ├─ n.id:8!null\n" +
 31576  			"                 │   │   │   └─ an.person_id:14!null\n" +
 31577  			"                 │   │   ├─ InnerJoin\n" +
 31578  			"                 │   │   │   ├─ Eq\n" +
 31579  			"                 │   │   │   │   ├─ ci.person_id:12!null\n" +
 31580  			"                 │   │   │   │   └─ n.id:8!null\n" +
 31581  			"                 │   │   │   ├─ Filter\n" +
 31582  			"                 │   │   │   │   ├─ AND\n" +
 31583  			"                 │   │   │   │   │   ├─ AND\n" +
 31584  			"                 │   │   │   │   │   │   ├─ GreaterThanOrEqual\n" +
 31585  			"                 │   │   │   │   │   │   │   ├─ n.name_pcode_cf:3\n" +
 31586  			"                 │   │   │   │   │   │   │   └─ A (longtext)\n" +
 31587  			"                 │   │   │   │   │   │   └─ LessThanOrEqual\n" +
 31588  			"                 │   │   │   │   │   │       ├─ n.name_pcode_cf:3\n" +
 31589  			"                 │   │   │   │   │   │       └─ F (longtext)\n" +
 31590  			"                 │   │   │   │   │   └─ Or\n" +
 31591  			"                 │   │   │   │   │       ├─ Eq\n" +
 31592  			"                 │   │   │   │   │       │   ├─ n.gender:2\n" +
 31593  			"                 │   │   │   │   │       │   └─ m (longtext)\n" +
 31594  			"                 │   │   │   │   │       └─ AND\n" +
 31595  			"                 │   │   │   │   │           ├─ Eq\n" +
 31596  			"                 │   │   │   │   │           │   ├─ n.gender:2\n" +
 31597  			"                 │   │   │   │   │           │   └─ f (longtext)\n" +
 31598  			"                 │   │   │   │   │           └─ AND\n" +
 31599  			"                 │   │   │   │   │               ├─ GreaterThanOrEqual\n" +
 31600  			"                 │   │   │   │   │               │   ├─ n.name:1!null\n" +
 31601  			"                 │   │   │   │   │               │   └─ B (longtext)\n" +
 31602  			"                 │   │   │   │   │               └─ LessThanOrEqual\n" +
 31603  			"                 │   │   │   │   │                   ├─ n.name:1!null\n" +
 31604  			"                 │   │   │   │   │                   └─ Bÿ (longtext)\n" +
 31605  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 31606  			"                 │   │   │   │       └─ ProcessTable\n" +
 31607  			"                 │   │   │   │           └─ Table\n" +
 31608  			"                 │   │   │   │               ├─ name: name\n" +
 31609  			"                 │   │   │   │               └─ columns: [id name gender name_pcode_cf]\n" +
 31610  			"                 │   │   │   └─ TableAlias(ci)\n" +
 31611  			"                 │   │   │       └─ ProcessTable\n" +
 31612  			"                 │   │   │           └─ Table\n" +
 31613  			"                 │   │   │               ├─ name: cast_info\n" +
 31614  			"                 │   │   │               └─ columns: [person_id movie_id]\n" +
 31615  			"                 │   │   └─ Filter\n" +
 31616  			"                 │   │       ├─ an.name LIKE '%a%'\n" +
 31617  			"                 │   │       └─ TableAlias(an)\n" +
 31618  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 31619  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 31620  			"                 │   │               ├─ keys: [ci.person_id:12!null]\n" +
 31621  			"                 │   │               ├─ colSet: (1-8)\n" +
 31622  			"                 │   │               ├─ tableId: 1\n" +
 31623  			"                 │   │               └─ Table\n" +
 31624  			"                 │   │                   ├─ name: aka_name\n" +
 31625  			"                 │   │                   └─ columns: [person_id name]\n" +
 31626  			"                 │   └─ TableAlias(ml)\n" +
 31627  			"                 │       └─ ProcessTable\n" +
 31628  			"                 │           └─ Table\n" +
 31629  			"                 │               ├─ name: movie_link\n" +
 31630  			"                 │               └─ columns: [linked_movie_id link_type_id]\n" +
 31631  			"                 └─ Filter\n" +
 31632  			"                     ├─ Eq\n" +
 31633  			"                     │   ├─ lt.link:1!null\n" +
 31634  			"                     │   └─ features (longtext)\n" +
 31635  			"                     └─ TableAlias(lt)\n" +
 31636  			"                         └─ ProcessTable\n" +
 31637  			"                             └─ Table\n" +
 31638  			"                                 ├─ name: link_type\n" +
 31639  			"                                 └─ columns: [id link]\n" +
 31640  			"",
 31641  		ExpectedEstimates: "Project\n" +
 31642  			" ├─ columns: [min(n.name) as of_person, min(t.title) as biography_movie]\n" +
 31643  			" └─ GroupBy\n" +
 31644  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 31645  			"     ├─ Grouping()\n" +
 31646  			"     └─ InnerJoin\n" +
 31647  			"         ├─ ((t.id = ci.movie_id) AND (ml.linked_movie_id = t.id))\n" +
 31648  			"         ├─ Filter\n" +
 31649  			"         │   ├─ ((t.production_year >= 1980) AND (t.production_year <= 1995))\n" +
 31650  			"         │   └─ TableAlias(t)\n" +
 31651  			"         │       └─ Table\n" +
 31652  			"         │           ├─ name: title\n" +
 31653  			"         │           └─ columns: [id title production_year]\n" +
 31654  			"         └─ InnerJoin\n" +
 31655  			"             ├─ (((n.id = pi.person_id) AND (pi.person_id = an.person_id)) AND (pi.person_id = ci.person_id))\n" +
 31656  			"             ├─ InnerJoin\n" +
 31657  			"             │   ├─ (it.id = pi.info_type_id)\n" +
 31658  			"             │   ├─ Filter\n" +
 31659  			"             │   │   ├─ (pi.note = 'Volker Boehm')\n" +
 31660  			"             │   │   └─ TableAlias(pi)\n" +
 31661  			"             │   │       └─ Table\n" +
 31662  			"             │   │           ├─ name: person_info\n" +
 31663  			"             │   │           └─ columns: [person_id info_type_id note]\n" +
 31664  			"             │   └─ Filter\n" +
 31665  			"             │       ├─ (it.info = 'mini biography')\n" +
 31666  			"             │       └─ TableAlias(it)\n" +
 31667  			"             │           └─ Table\n" +
 31668  			"             │               ├─ name: info_type\n" +
 31669  			"             │               └─ columns: [id info]\n" +
 31670  			"             └─ InnerJoin\n" +
 31671  			"                 ├─ (lt.id = ml.link_type_id)\n" +
 31672  			"                 ├─ InnerJoin\n" +
 31673  			"                 │   ├─ (ci.movie_id = ml.linked_movie_id)\n" +
 31674  			"                 │   ├─ LookupJoin\n" +
 31675  			"                 │   │   ├─ (n.id = an.person_id)\n" +
 31676  			"                 │   │   ├─ InnerJoin\n" +
 31677  			"                 │   │   │   ├─ (ci.person_id = n.id)\n" +
 31678  			"                 │   │   │   ├─ Filter\n" +
 31679  			"                 │   │   │   │   ├─ (((n.name_pcode_cf >= 'A') AND (n.name_pcode_cf <= 'F')) AND ((n.gender = 'm') OR ((n.gender = 'f') AND ((n.name >= 'B') AND (n.name <= 'Bÿ')))))\n" +
 31680  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 31681  			"                 │   │   │   │       └─ Table\n" +
 31682  			"                 │   │   │   │           ├─ name: name\n" +
 31683  			"                 │   │   │   │           └─ columns: [id name gender name_pcode_cf]\n" +
 31684  			"                 │   │   │   └─ TableAlias(ci)\n" +
 31685  			"                 │   │   │       └─ Table\n" +
 31686  			"                 │   │   │           ├─ name: cast_info\n" +
 31687  			"                 │   │   │           └─ columns: [person_id movie_id]\n" +
 31688  			"                 │   │   └─ Filter\n" +
 31689  			"                 │   │       ├─ an.name LIKE '%a%'\n" +
 31690  			"                 │   │       └─ TableAlias(an)\n" +
 31691  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 31692  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 31693  			"                 │   │               ├─ columns: [person_id name]\n" +
 31694  			"                 │   │               └─ keys: ci.person_id\n" +
 31695  			"                 │   └─ TableAlias(ml)\n" +
 31696  			"                 │       └─ Table\n" +
 31697  			"                 │           ├─ name: movie_link\n" +
 31698  			"                 │           └─ columns: [linked_movie_id link_type_id]\n" +
 31699  			"                 └─ Filter\n" +
 31700  			"                     ├─ (lt.link = 'features')\n" +
 31701  			"                     └─ TableAlias(lt)\n" +
 31702  			"                         └─ Table\n" +
 31703  			"                             ├─ name: link_type\n" +
 31704  			"                             └─ columns: [id link]\n" +
 31705  			"",
 31706  		ExpectedAnalysis: "Project\n" +
 31707  			" ├─ columns: [min(n.name) as of_person, min(t.title) as biography_movie]\n" +
 31708  			" └─ GroupBy\n" +
 31709  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 31710  			"     ├─ Grouping()\n" +
 31711  			"     └─ InnerJoin\n" +
 31712  			"         ├─ ((t.id = ci.movie_id) AND (ml.linked_movie_id = t.id))\n" +
 31713  			"         ├─ Filter\n" +
 31714  			"         │   ├─ ((t.production_year >= 1980) AND (t.production_year <= 1995))\n" +
 31715  			"         │   └─ TableAlias(t)\n" +
 31716  			"         │       └─ Table\n" +
 31717  			"         │           ├─ name: title\n" +
 31718  			"         │           └─ columns: [id title production_year]\n" +
 31719  			"         └─ InnerJoin\n" +
 31720  			"             ├─ (((n.id = pi.person_id) AND (pi.person_id = an.person_id)) AND (pi.person_id = ci.person_id))\n" +
 31721  			"             ├─ InnerJoin\n" +
 31722  			"             │   ├─ (it.id = pi.info_type_id)\n" +
 31723  			"             │   ├─ Filter\n" +
 31724  			"             │   │   ├─ (pi.note = 'Volker Boehm')\n" +
 31725  			"             │   │   └─ TableAlias(pi)\n" +
 31726  			"             │   │       └─ Table\n" +
 31727  			"             │   │           ├─ name: person_info\n" +
 31728  			"             │   │           └─ columns: [person_id info_type_id note]\n" +
 31729  			"             │   └─ Filter\n" +
 31730  			"             │       ├─ (it.info = 'mini biography')\n" +
 31731  			"             │       └─ TableAlias(it)\n" +
 31732  			"             │           └─ Table\n" +
 31733  			"             │               ├─ name: info_type\n" +
 31734  			"             │               └─ columns: [id info]\n" +
 31735  			"             └─ InnerJoin\n" +
 31736  			"                 ├─ (lt.id = ml.link_type_id)\n" +
 31737  			"                 ├─ InnerJoin\n" +
 31738  			"                 │   ├─ (ci.movie_id = ml.linked_movie_id)\n" +
 31739  			"                 │   ├─ LookupJoin\n" +
 31740  			"                 │   │   ├─ (n.id = an.person_id)\n" +
 31741  			"                 │   │   ├─ InnerJoin\n" +
 31742  			"                 │   │   │   ├─ (ci.person_id = n.id)\n" +
 31743  			"                 │   │   │   ├─ Filter\n" +
 31744  			"                 │   │   │   │   ├─ (((n.name_pcode_cf >= 'A') AND (n.name_pcode_cf <= 'F')) AND ((n.gender = 'm') OR ((n.gender = 'f') AND ((n.name >= 'B') AND (n.name <= 'Bÿ')))))\n" +
 31745  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 31746  			"                 │   │   │   │       └─ Table\n" +
 31747  			"                 │   │   │   │           ├─ name: name\n" +
 31748  			"                 │   │   │   │           └─ columns: [id name gender name_pcode_cf]\n" +
 31749  			"                 │   │   │   └─ TableAlias(ci)\n" +
 31750  			"                 │   │   │       └─ Table\n" +
 31751  			"                 │   │   │           ├─ name: cast_info\n" +
 31752  			"                 │   │   │           └─ columns: [person_id movie_id]\n" +
 31753  			"                 │   │   └─ Filter\n" +
 31754  			"                 │   │       ├─ an.name LIKE '%a%'\n" +
 31755  			"                 │   │       └─ TableAlias(an)\n" +
 31756  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 31757  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 31758  			"                 │   │               ├─ columns: [person_id name]\n" +
 31759  			"                 │   │               └─ keys: ci.person_id\n" +
 31760  			"                 │   └─ TableAlias(ml)\n" +
 31761  			"                 │       └─ Table\n" +
 31762  			"                 │           ├─ name: movie_link\n" +
 31763  			"                 │           └─ columns: [linked_movie_id link_type_id]\n" +
 31764  			"                 └─ Filter\n" +
 31765  			"                     ├─ (lt.link = 'features')\n" +
 31766  			"                     └─ TableAlias(lt)\n" +
 31767  			"                         └─ Table\n" +
 31768  			"                             ├─ name: link_type\n" +
 31769  			"                             └─ columns: [id link]\n" +
 31770  			"",
 31771  	},
 31772  	{
 31773  		Query: `
 31774  SELECT MIN(n.name) AS of_person,
 31775         MIN(t.title) AS biography_movie
 31776  FROM aka_name AS an,
 31777       cast_info AS ci,
 31778       info_type AS it,
 31779       link_type AS lt,
 31780       movie_link AS ml,
 31781       name AS n,
 31782       person_info AS pi,
 31783       title AS t
 31784  WHERE an.name LIKE '%a%'
 31785    AND it.info ='mini biography'
 31786    AND lt.link ='features'
 31787    AND n.name_pcode_cf LIKE 'D%'
 31788    AND n.gender='m'
 31789    AND pi.note ='Volker Boehm'
 31790    AND t.production_year BETWEEN 1980 AND 1984
 31791    AND n.id = an.person_id
 31792    AND n.id = pi.person_id
 31793    AND ci.person_id = n.id
 31794    AND t.id = ci.movie_id
 31795    AND ml.linked_movie_id = t.id
 31796    AND lt.id = ml.link_type_id
 31797    AND it.id = pi.info_type_id
 31798    AND pi.person_id = an.person_id
 31799    AND pi.person_id = ci.person_id
 31800    AND an.person_id = ci.person_id
 31801    AND ci.movie_id = ml.linked_movie_id;
 31802  
 31803  `,
 31804  		ExpectedPlan: "Project\n" +
 31805  			" ├─ columns: [min(n.name):0!null as of_person, min(t.title):1!null as biography_movie]\n" +
 31806  			" └─ GroupBy\n" +
 31807  			"     ├─ select: MIN(n.name:9!null), MIN(t.title:1!null)\n" +
 31808  			"     ├─ group: \n" +
 31809  			"     └─ InnerJoin\n" +
 31810  			"         ├─ AND\n" +
 31811  			"         │   ├─ Eq\n" +
 31812  			"         │   │   ├─ t.id:0!null\n" +
 31813  			"         │   │   └─ ci.movie_id:13!null\n" +
 31814  			"         │   └─ Eq\n" +
 31815  			"         │       ├─ ml.linked_movie_id:16!null\n" +
 31816  			"         │       └─ t.id:0!null\n" +
 31817  			"         ├─ Filter\n" +
 31818  			"         │   ├─ AND\n" +
 31819  			"         │   │   ├─ GreaterThanOrEqual\n" +
 31820  			"         │   │   │   ├─ t.production_year:2\n" +
 31821  			"         │   │   │   └─ 1980 (smallint)\n" +
 31822  			"         │   │   └─ LessThanOrEqual\n" +
 31823  			"         │   │       ├─ t.production_year:2\n" +
 31824  			"         │   │       └─ 1984 (smallint)\n" +
 31825  			"         │   └─ TableAlias(t)\n" +
 31826  			"         │       └─ ProcessTable\n" +
 31827  			"         │           └─ Table\n" +
 31828  			"         │               ├─ name: title\n" +
 31829  			"         │               └─ columns: [id title production_year]\n" +
 31830  			"         └─ InnerJoin\n" +
 31831  			"             ├─ AND\n" +
 31832  			"             │   ├─ AND\n" +
 31833  			"             │   │   ├─ Eq\n" +
 31834  			"             │   │   │   ├─ n.id:8!null\n" +
 31835  			"             │   │   │   └─ pi.person_id:3!null\n" +
 31836  			"             │   │   └─ Eq\n" +
 31837  			"             │   │       ├─ pi.person_id:3!null\n" +
 31838  			"             │   │       └─ an.person_id:14!null\n" +
 31839  			"             │   └─ Eq\n" +
 31840  			"             │       ├─ pi.person_id:3!null\n" +
 31841  			"             │       └─ ci.person_id:12!null\n" +
 31842  			"             ├─ InnerJoin\n" +
 31843  			"             │   ├─ Eq\n" +
 31844  			"             │   │   ├─ it.id:6!null\n" +
 31845  			"             │   │   └─ pi.info_type_id:4!null\n" +
 31846  			"             │   ├─ Filter\n" +
 31847  			"             │   │   ├─ Eq\n" +
 31848  			"             │   │   │   ├─ pi.note:2\n" +
 31849  			"             │   │   │   └─ Volker Boehm (longtext)\n" +
 31850  			"             │   │   └─ TableAlias(pi)\n" +
 31851  			"             │   │       └─ ProcessTable\n" +
 31852  			"             │   │           └─ Table\n" +
 31853  			"             │   │               ├─ name: person_info\n" +
 31854  			"             │   │               └─ columns: [person_id info_type_id note]\n" +
 31855  			"             │   └─ Filter\n" +
 31856  			"             │       ├─ Eq\n" +
 31857  			"             │       │   ├─ it.info:1!null\n" +
 31858  			"             │       │   └─ mini biography (longtext)\n" +
 31859  			"             │       └─ TableAlias(it)\n" +
 31860  			"             │           └─ ProcessTable\n" +
 31861  			"             │               └─ Table\n" +
 31862  			"             │                   ├─ name: info_type\n" +
 31863  			"             │                   └─ columns: [id info]\n" +
 31864  			"             └─ InnerJoin\n" +
 31865  			"                 ├─ Eq\n" +
 31866  			"                 │   ├─ lt.id:18!null\n" +
 31867  			"                 │   └─ ml.link_type_id:17!null\n" +
 31868  			"                 ├─ InnerJoin\n" +
 31869  			"                 │   ├─ Eq\n" +
 31870  			"                 │   │   ├─ ci.movie_id:13!null\n" +
 31871  			"                 │   │   └─ ml.linked_movie_id:16!null\n" +
 31872  			"                 │   ├─ LookupJoin\n" +
 31873  			"                 │   │   ├─ Eq\n" +
 31874  			"                 │   │   │   ├─ n.id:8!null\n" +
 31875  			"                 │   │   │   └─ an.person_id:14!null\n" +
 31876  			"                 │   │   ├─ InnerJoin\n" +
 31877  			"                 │   │   │   ├─ Eq\n" +
 31878  			"                 │   │   │   │   ├─ ci.person_id:12!null\n" +
 31879  			"                 │   │   │   │   └─ n.id:8!null\n" +
 31880  			"                 │   │   │   ├─ Filter\n" +
 31881  			"                 │   │   │   │   ├─ AND\n" +
 31882  			"                 │   │   │   │   │   ├─ AND\n" +
 31883  			"                 │   │   │   │   │   │   ├─ GreaterThanOrEqual\n" +
 31884  			"                 │   │   │   │   │   │   │   ├─ n.name_pcode_cf:3\n" +
 31885  			"                 │   │   │   │   │   │   │   └─ D (longtext)\n" +
 31886  			"                 │   │   │   │   │   │   └─ LessThanOrEqual\n" +
 31887  			"                 │   │   │   │   │   │       ├─ n.name_pcode_cf:3\n" +
 31888  			"                 │   │   │   │   │   │       └─ Dÿ (longtext)\n" +
 31889  			"                 │   │   │   │   │   └─ Eq\n" +
 31890  			"                 │   │   │   │   │       ├─ n.gender:2\n" +
 31891  			"                 │   │   │   │   │       └─ m (longtext)\n" +
 31892  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 31893  			"                 │   │   │   │       └─ ProcessTable\n" +
 31894  			"                 │   │   │   │           └─ Table\n" +
 31895  			"                 │   │   │   │               ├─ name: name\n" +
 31896  			"                 │   │   │   │               └─ columns: [id name gender name_pcode_cf]\n" +
 31897  			"                 │   │   │   └─ TableAlias(ci)\n" +
 31898  			"                 │   │   │       └─ ProcessTable\n" +
 31899  			"                 │   │   │           └─ Table\n" +
 31900  			"                 │   │   │               ├─ name: cast_info\n" +
 31901  			"                 │   │   │               └─ columns: [person_id movie_id]\n" +
 31902  			"                 │   │   └─ Filter\n" +
 31903  			"                 │   │       ├─ an.name LIKE '%a%'\n" +
 31904  			"                 │   │       └─ TableAlias(an)\n" +
 31905  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 31906  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 31907  			"                 │   │               ├─ keys: [ci.person_id:12!null]\n" +
 31908  			"                 │   │               ├─ colSet: (1-8)\n" +
 31909  			"                 │   │               ├─ tableId: 1\n" +
 31910  			"                 │   │               └─ Table\n" +
 31911  			"                 │   │                   ├─ name: aka_name\n" +
 31912  			"                 │   │                   └─ columns: [person_id name]\n" +
 31913  			"                 │   └─ TableAlias(ml)\n" +
 31914  			"                 │       └─ ProcessTable\n" +
 31915  			"                 │           └─ Table\n" +
 31916  			"                 │               ├─ name: movie_link\n" +
 31917  			"                 │               └─ columns: [linked_movie_id link_type_id]\n" +
 31918  			"                 └─ Filter\n" +
 31919  			"                     ├─ Eq\n" +
 31920  			"                     │   ├─ lt.link:1!null\n" +
 31921  			"                     │   └─ features (longtext)\n" +
 31922  			"                     └─ TableAlias(lt)\n" +
 31923  			"                         └─ ProcessTable\n" +
 31924  			"                             └─ Table\n" +
 31925  			"                                 ├─ name: link_type\n" +
 31926  			"                                 └─ columns: [id link]\n" +
 31927  			"",
 31928  		ExpectedEstimates: "Project\n" +
 31929  			" ├─ columns: [min(n.name) as of_person, min(t.title) as biography_movie]\n" +
 31930  			" └─ GroupBy\n" +
 31931  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 31932  			"     ├─ Grouping()\n" +
 31933  			"     └─ InnerJoin\n" +
 31934  			"         ├─ ((t.id = ci.movie_id) AND (ml.linked_movie_id = t.id))\n" +
 31935  			"         ├─ Filter\n" +
 31936  			"         │   ├─ ((t.production_year >= 1980) AND (t.production_year <= 1984))\n" +
 31937  			"         │   └─ TableAlias(t)\n" +
 31938  			"         │       └─ Table\n" +
 31939  			"         │           ├─ name: title\n" +
 31940  			"         │           └─ columns: [id title production_year]\n" +
 31941  			"         └─ InnerJoin\n" +
 31942  			"             ├─ (((n.id = pi.person_id) AND (pi.person_id = an.person_id)) AND (pi.person_id = ci.person_id))\n" +
 31943  			"             ├─ InnerJoin\n" +
 31944  			"             │   ├─ (it.id = pi.info_type_id)\n" +
 31945  			"             │   ├─ Filter\n" +
 31946  			"             │   │   ├─ (pi.note = 'Volker Boehm')\n" +
 31947  			"             │   │   └─ TableAlias(pi)\n" +
 31948  			"             │   │       └─ Table\n" +
 31949  			"             │   │           ├─ name: person_info\n" +
 31950  			"             │   │           └─ columns: [person_id info_type_id note]\n" +
 31951  			"             │   └─ Filter\n" +
 31952  			"             │       ├─ (it.info = 'mini biography')\n" +
 31953  			"             │       └─ TableAlias(it)\n" +
 31954  			"             │           └─ Table\n" +
 31955  			"             │               ├─ name: info_type\n" +
 31956  			"             │               └─ columns: [id info]\n" +
 31957  			"             └─ InnerJoin\n" +
 31958  			"                 ├─ (lt.id = ml.link_type_id)\n" +
 31959  			"                 ├─ InnerJoin\n" +
 31960  			"                 │   ├─ (ci.movie_id = ml.linked_movie_id)\n" +
 31961  			"                 │   ├─ LookupJoin\n" +
 31962  			"                 │   │   ├─ (n.id = an.person_id)\n" +
 31963  			"                 │   │   ├─ InnerJoin\n" +
 31964  			"                 │   │   │   ├─ (ci.person_id = n.id)\n" +
 31965  			"                 │   │   │   ├─ Filter\n" +
 31966  			"                 │   │   │   │   ├─ (((n.name_pcode_cf >= 'D') AND (n.name_pcode_cf <= 'Dÿ')) AND (n.gender = 'm'))\n" +
 31967  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 31968  			"                 │   │   │   │       └─ Table\n" +
 31969  			"                 │   │   │   │           ├─ name: name\n" +
 31970  			"                 │   │   │   │           └─ columns: [id name gender name_pcode_cf]\n" +
 31971  			"                 │   │   │   └─ TableAlias(ci)\n" +
 31972  			"                 │   │   │       └─ Table\n" +
 31973  			"                 │   │   │           ├─ name: cast_info\n" +
 31974  			"                 │   │   │           └─ columns: [person_id movie_id]\n" +
 31975  			"                 │   │   └─ Filter\n" +
 31976  			"                 │   │       ├─ an.name LIKE '%a%'\n" +
 31977  			"                 │   │       └─ TableAlias(an)\n" +
 31978  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 31979  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 31980  			"                 │   │               ├─ columns: [person_id name]\n" +
 31981  			"                 │   │               └─ keys: ci.person_id\n" +
 31982  			"                 │   └─ TableAlias(ml)\n" +
 31983  			"                 │       └─ Table\n" +
 31984  			"                 │           ├─ name: movie_link\n" +
 31985  			"                 │           └─ columns: [linked_movie_id link_type_id]\n" +
 31986  			"                 └─ Filter\n" +
 31987  			"                     ├─ (lt.link = 'features')\n" +
 31988  			"                     └─ TableAlias(lt)\n" +
 31989  			"                         └─ Table\n" +
 31990  			"                             ├─ name: link_type\n" +
 31991  			"                             └─ columns: [id link]\n" +
 31992  			"",
 31993  		ExpectedAnalysis: "Project\n" +
 31994  			" ├─ columns: [min(n.name) as of_person, min(t.title) as biography_movie]\n" +
 31995  			" └─ GroupBy\n" +
 31996  			"     ├─ SelectedExprs(MIN(n.name), MIN(t.title))\n" +
 31997  			"     ├─ Grouping()\n" +
 31998  			"     └─ InnerJoin\n" +
 31999  			"         ├─ ((t.id = ci.movie_id) AND (ml.linked_movie_id = t.id))\n" +
 32000  			"         ├─ Filter\n" +
 32001  			"         │   ├─ ((t.production_year >= 1980) AND (t.production_year <= 1984))\n" +
 32002  			"         │   └─ TableAlias(t)\n" +
 32003  			"         │       └─ Table\n" +
 32004  			"         │           ├─ name: title\n" +
 32005  			"         │           └─ columns: [id title production_year]\n" +
 32006  			"         └─ InnerJoin\n" +
 32007  			"             ├─ (((n.id = pi.person_id) AND (pi.person_id = an.person_id)) AND (pi.person_id = ci.person_id))\n" +
 32008  			"             ├─ InnerJoin\n" +
 32009  			"             │   ├─ (it.id = pi.info_type_id)\n" +
 32010  			"             │   ├─ Filter\n" +
 32011  			"             │   │   ├─ (pi.note = 'Volker Boehm')\n" +
 32012  			"             │   │   └─ TableAlias(pi)\n" +
 32013  			"             │   │       └─ Table\n" +
 32014  			"             │   │           ├─ name: person_info\n" +
 32015  			"             │   │           └─ columns: [person_id info_type_id note]\n" +
 32016  			"             │   └─ Filter\n" +
 32017  			"             │       ├─ (it.info = 'mini biography')\n" +
 32018  			"             │       └─ TableAlias(it)\n" +
 32019  			"             │           └─ Table\n" +
 32020  			"             │               ├─ name: info_type\n" +
 32021  			"             │               └─ columns: [id info]\n" +
 32022  			"             └─ InnerJoin\n" +
 32023  			"                 ├─ (lt.id = ml.link_type_id)\n" +
 32024  			"                 ├─ InnerJoin\n" +
 32025  			"                 │   ├─ (ci.movie_id = ml.linked_movie_id)\n" +
 32026  			"                 │   ├─ LookupJoin\n" +
 32027  			"                 │   │   ├─ (n.id = an.person_id)\n" +
 32028  			"                 │   │   ├─ InnerJoin\n" +
 32029  			"                 │   │   │   ├─ (ci.person_id = n.id)\n" +
 32030  			"                 │   │   │   ├─ Filter\n" +
 32031  			"                 │   │   │   │   ├─ (((n.name_pcode_cf >= 'D') AND (n.name_pcode_cf <= 'Dÿ')) AND (n.gender = 'm'))\n" +
 32032  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 32033  			"                 │   │   │   │       └─ Table\n" +
 32034  			"                 │   │   │   │           ├─ name: name\n" +
 32035  			"                 │   │   │   │           └─ columns: [id name gender name_pcode_cf]\n" +
 32036  			"                 │   │   │   └─ TableAlias(ci)\n" +
 32037  			"                 │   │   │       └─ Table\n" +
 32038  			"                 │   │   │           ├─ name: cast_info\n" +
 32039  			"                 │   │   │           └─ columns: [person_id movie_id]\n" +
 32040  			"                 │   │   └─ Filter\n" +
 32041  			"                 │   │       ├─ an.name LIKE '%a%'\n" +
 32042  			"                 │   │       └─ TableAlias(an)\n" +
 32043  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 32044  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 32045  			"                 │   │               ├─ columns: [person_id name]\n" +
 32046  			"                 │   │               └─ keys: ci.person_id\n" +
 32047  			"                 │   └─ TableAlias(ml)\n" +
 32048  			"                 │       └─ Table\n" +
 32049  			"                 │           ├─ name: movie_link\n" +
 32050  			"                 │           └─ columns: [linked_movie_id link_type_id]\n" +
 32051  			"                 └─ Filter\n" +
 32052  			"                     ├─ (lt.link = 'features')\n" +
 32053  			"                     └─ TableAlias(lt)\n" +
 32054  			"                         └─ Table\n" +
 32055  			"                             ├─ name: link_type\n" +
 32056  			"                             └─ columns: [id link]\n" +
 32057  			"",
 32058  	},
 32059  	{
 32060  		Query: `
 32061  SELECT MIN(n.name) AS cast_member_name,
 32062         MIN(pi.info) AS cast_member_info
 32063  FROM aka_name AS an,
 32064       cast_info AS ci,
 32065       info_type AS it,
 32066       link_type AS lt,
 32067       movie_link AS ml,
 32068       name AS n,
 32069       person_info AS pi,
 32070       title AS t
 32071  WHERE an.name IS NOT NULL
 32072    AND (an.name LIKE '%a%'
 32073         OR an.name LIKE 'A%')
 32074    AND it.info ='mini biography'
 32075    AND lt.link IN ('references',
 32076                    'referenced in',
 32077                    'features',
 32078                    'featured in')
 32079    AND n.name_pcode_cf BETWEEN 'A' AND 'F'
 32080    AND (n.gender='m'
 32081         OR (n.gender = 'f'
 32082             AND n.name LIKE 'A%'))
 32083    AND pi.note IS NOT NULL
 32084    AND t.production_year BETWEEN 1980 AND 2010
 32085    AND n.id = an.person_id
 32086    AND n.id = pi.person_id
 32087    AND ci.person_id = n.id
 32088    AND t.id = ci.movie_id
 32089    AND ml.linked_movie_id = t.id
 32090    AND lt.id = ml.link_type_id
 32091    AND it.id = pi.info_type_id
 32092    AND pi.person_id = an.person_id
 32093    AND pi.person_id = ci.person_id
 32094    AND an.person_id = ci.person_id
 32095    AND ci.movie_id = ml.linked_movie_id;
 32096  
 32097  `,
 32098  		ExpectedPlan: "Project\n" +
 32099  			" ├─ columns: [min(n.name):0!null as cast_member_name, min(pi.info):1!null as cast_member_info]\n" +
 32100  			" └─ GroupBy\n" +
 32101  			"     ├─ select: MIN(n.name:9!null), MIN(pi.info:4!null)\n" +
 32102  			"     ├─ group: \n" +
 32103  			"     └─ InnerJoin\n" +
 32104  			"         ├─ AND\n" +
 32105  			"         │   ├─ Eq\n" +
 32106  			"         │   │   ├─ t.id:0!null\n" +
 32107  			"         │   │   └─ ci.movie_id:13!null\n" +
 32108  			"         │   └─ Eq\n" +
 32109  			"         │       ├─ ml.linked_movie_id:16!null\n" +
 32110  			"         │       └─ t.id:0!null\n" +
 32111  			"         ├─ Filter\n" +
 32112  			"         │   ├─ AND\n" +
 32113  			"         │   │   ├─ GreaterThanOrEqual\n" +
 32114  			"         │   │   │   ├─ t.production_year:1\n" +
 32115  			"         │   │   │   └─ 1980 (smallint)\n" +
 32116  			"         │   │   └─ LessThanOrEqual\n" +
 32117  			"         │   │       ├─ t.production_year:1\n" +
 32118  			"         │   │       └─ 2010 (smallint)\n" +
 32119  			"         │   └─ TableAlias(t)\n" +
 32120  			"         │       └─ ProcessTable\n" +
 32121  			"         │           └─ Table\n" +
 32122  			"         │               ├─ name: title\n" +
 32123  			"         │               └─ columns: [id production_year]\n" +
 32124  			"         └─ InnerJoin\n" +
 32125  			"             ├─ AND\n" +
 32126  			"             │   ├─ AND\n" +
 32127  			"             │   │   ├─ Eq\n" +
 32128  			"             │   │   │   ├─ n.id:8!null\n" +
 32129  			"             │   │   │   └─ pi.person_id:2!null\n" +
 32130  			"             │   │   └─ Eq\n" +
 32131  			"             │   │       ├─ pi.person_id:2!null\n" +
 32132  			"             │   │       └─ an.person_id:14!null\n" +
 32133  			"             │   └─ Eq\n" +
 32134  			"             │       ├─ pi.person_id:2!null\n" +
 32135  			"             │       └─ ci.person_id:12!null\n" +
 32136  			"             ├─ InnerJoin\n" +
 32137  			"             │   ├─ Eq\n" +
 32138  			"             │   │   ├─ it.id:6!null\n" +
 32139  			"             │   │   └─ pi.info_type_id:3!null\n" +
 32140  			"             │   ├─ Filter\n" +
 32141  			"             │   │   ├─ NOT\n" +
 32142  			"             │   │   │   └─ pi.note:3 IS NULL\n" +
 32143  			"             │   │   └─ TableAlias(pi)\n" +
 32144  			"             │   │       └─ ProcessTable\n" +
 32145  			"             │   │           └─ Table\n" +
 32146  			"             │   │               ├─ name: person_info\n" +
 32147  			"             │   │               └─ columns: [person_id info_type_id info note]\n" +
 32148  			"             │   └─ Filter\n" +
 32149  			"             │       ├─ Eq\n" +
 32150  			"             │       │   ├─ it.info:1!null\n" +
 32151  			"             │       │   └─ mini biography (longtext)\n" +
 32152  			"             │       └─ TableAlias(it)\n" +
 32153  			"             │           └─ ProcessTable\n" +
 32154  			"             │               └─ Table\n" +
 32155  			"             │                   ├─ name: info_type\n" +
 32156  			"             │                   └─ columns: [id info]\n" +
 32157  			"             └─ InnerJoin\n" +
 32158  			"                 ├─ Eq\n" +
 32159  			"                 │   ├─ lt.id:18!null\n" +
 32160  			"                 │   └─ ml.link_type_id:17!null\n" +
 32161  			"                 ├─ InnerJoin\n" +
 32162  			"                 │   ├─ Eq\n" +
 32163  			"                 │   │   ├─ ci.movie_id:13!null\n" +
 32164  			"                 │   │   └─ ml.linked_movie_id:16!null\n" +
 32165  			"                 │   ├─ LookupJoin\n" +
 32166  			"                 │   │   ├─ Eq\n" +
 32167  			"                 │   │   │   ├─ n.id:8!null\n" +
 32168  			"                 │   │   │   └─ an.person_id:14!null\n" +
 32169  			"                 │   │   ├─ InnerJoin\n" +
 32170  			"                 │   │   │   ├─ Eq\n" +
 32171  			"                 │   │   │   │   ├─ ci.person_id:12!null\n" +
 32172  			"                 │   │   │   │   └─ n.id:8!null\n" +
 32173  			"                 │   │   │   ├─ Filter\n" +
 32174  			"                 │   │   │   │   ├─ AND\n" +
 32175  			"                 │   │   │   │   │   ├─ AND\n" +
 32176  			"                 │   │   │   │   │   │   ├─ GreaterThanOrEqual\n" +
 32177  			"                 │   │   │   │   │   │   │   ├─ n.name_pcode_cf:3\n" +
 32178  			"                 │   │   │   │   │   │   │   └─ A (longtext)\n" +
 32179  			"                 │   │   │   │   │   │   └─ LessThanOrEqual\n" +
 32180  			"                 │   │   │   │   │   │       ├─ n.name_pcode_cf:3\n" +
 32181  			"                 │   │   │   │   │   │       └─ F (longtext)\n" +
 32182  			"                 │   │   │   │   │   └─ Or\n" +
 32183  			"                 │   │   │   │   │       ├─ Eq\n" +
 32184  			"                 │   │   │   │   │       │   ├─ n.gender:2\n" +
 32185  			"                 │   │   │   │   │       │   └─ m (longtext)\n" +
 32186  			"                 │   │   │   │   │       └─ AND\n" +
 32187  			"                 │   │   │   │   │           ├─ Eq\n" +
 32188  			"                 │   │   │   │   │           │   ├─ n.gender:2\n" +
 32189  			"                 │   │   │   │   │           │   └─ f (longtext)\n" +
 32190  			"                 │   │   │   │   │           └─ AND\n" +
 32191  			"                 │   │   │   │   │               ├─ GreaterThanOrEqual\n" +
 32192  			"                 │   │   │   │   │               │   ├─ n.name:1!null\n" +
 32193  			"                 │   │   │   │   │               │   └─ A (longtext)\n" +
 32194  			"                 │   │   │   │   │               └─ LessThanOrEqual\n" +
 32195  			"                 │   │   │   │   │                   ├─ n.name:1!null\n" +
 32196  			"                 │   │   │   │   │                   └─ Aÿ (longtext)\n" +
 32197  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 32198  			"                 │   │   │   │       └─ ProcessTable\n" +
 32199  			"                 │   │   │   │           └─ Table\n" +
 32200  			"                 │   │   │   │               ├─ name: name\n" +
 32201  			"                 │   │   │   │               └─ columns: [id name gender name_pcode_cf]\n" +
 32202  			"                 │   │   │   └─ TableAlias(ci)\n" +
 32203  			"                 │   │   │       └─ ProcessTable\n" +
 32204  			"                 │   │   │           └─ Table\n" +
 32205  			"                 │   │   │               ├─ name: cast_info\n" +
 32206  			"                 │   │   │               └─ columns: [person_id movie_id]\n" +
 32207  			"                 │   │   └─ Filter\n" +
 32208  			"                 │   │       ├─ AND\n" +
 32209  			"                 │   │       │   ├─ NOT\n" +
 32210  			"                 │   │       │   │   └─ an.name:1!null IS NULL\n" +
 32211  			"                 │   │       │   └─ Or\n" +
 32212  			"                 │   │       │       ├─ an.name LIKE '%a%'\n" +
 32213  			"                 │   │       │       └─ AND\n" +
 32214  			"                 │   │       │           ├─ GreaterThanOrEqual\n" +
 32215  			"                 │   │       │           │   ├─ an.name:1!null\n" +
 32216  			"                 │   │       │           │   └─ A (longtext)\n" +
 32217  			"                 │   │       │           └─ LessThanOrEqual\n" +
 32218  			"                 │   │       │               ├─ an.name:1!null\n" +
 32219  			"                 │   │       │               └─ Aÿ (longtext)\n" +
 32220  			"                 │   │       └─ TableAlias(an)\n" +
 32221  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 32222  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 32223  			"                 │   │               ├─ keys: [ci.person_id:12!null]\n" +
 32224  			"                 │   │               ├─ colSet: (1-8)\n" +
 32225  			"                 │   │               ├─ tableId: 1\n" +
 32226  			"                 │   │               └─ Table\n" +
 32227  			"                 │   │                   ├─ name: aka_name\n" +
 32228  			"                 │   │                   └─ columns: [person_id name]\n" +
 32229  			"                 │   └─ TableAlias(ml)\n" +
 32230  			"                 │       └─ ProcessTable\n" +
 32231  			"                 │           └─ Table\n" +
 32232  			"                 │               ├─ name: movie_link\n" +
 32233  			"                 │               └─ columns: [linked_movie_id link_type_id]\n" +
 32234  			"                 └─ Filter\n" +
 32235  			"                     ├─ HashIn\n" +
 32236  			"                     │   ├─ lt.link:1!null\n" +
 32237  			"                     │   └─ TUPLE(references (longtext), referenced in (longtext), features (longtext), featured in (longtext))\n" +
 32238  			"                     └─ TableAlias(lt)\n" +
 32239  			"                         └─ ProcessTable\n" +
 32240  			"                             └─ Table\n" +
 32241  			"                                 ├─ name: link_type\n" +
 32242  			"                                 └─ columns: [id link]\n" +
 32243  			"",
 32244  		ExpectedEstimates: "Project\n" +
 32245  			" ├─ columns: [min(n.name) as cast_member_name, min(pi.info) as cast_member_info]\n" +
 32246  			" └─ GroupBy\n" +
 32247  			"     ├─ SelectedExprs(MIN(n.name), MIN(pi.info))\n" +
 32248  			"     ├─ Grouping()\n" +
 32249  			"     └─ InnerJoin\n" +
 32250  			"         ├─ ((t.id = ci.movie_id) AND (ml.linked_movie_id = t.id))\n" +
 32251  			"         ├─ Filter\n" +
 32252  			"         │   ├─ ((t.production_year >= 1980) AND (t.production_year <= 2010))\n" +
 32253  			"         │   └─ TableAlias(t)\n" +
 32254  			"         │       └─ Table\n" +
 32255  			"         │           ├─ name: title\n" +
 32256  			"         │           └─ columns: [id production_year]\n" +
 32257  			"         └─ InnerJoin\n" +
 32258  			"             ├─ (((n.id = pi.person_id) AND (pi.person_id = an.person_id)) AND (pi.person_id = ci.person_id))\n" +
 32259  			"             ├─ InnerJoin\n" +
 32260  			"             │   ├─ (it.id = pi.info_type_id)\n" +
 32261  			"             │   ├─ Filter\n" +
 32262  			"             │   │   ├─ (NOT(pi.note IS NULL))\n" +
 32263  			"             │   │   └─ TableAlias(pi)\n" +
 32264  			"             │   │       └─ Table\n" +
 32265  			"             │   │           ├─ name: person_info\n" +
 32266  			"             │   │           └─ columns: [person_id info_type_id info note]\n" +
 32267  			"             │   └─ Filter\n" +
 32268  			"             │       ├─ (it.info = 'mini biography')\n" +
 32269  			"             │       └─ TableAlias(it)\n" +
 32270  			"             │           └─ Table\n" +
 32271  			"             │               ├─ name: info_type\n" +
 32272  			"             │               └─ columns: [id info]\n" +
 32273  			"             └─ InnerJoin\n" +
 32274  			"                 ├─ (lt.id = ml.link_type_id)\n" +
 32275  			"                 ├─ InnerJoin\n" +
 32276  			"                 │   ├─ (ci.movie_id = ml.linked_movie_id)\n" +
 32277  			"                 │   ├─ LookupJoin\n" +
 32278  			"                 │   │   ├─ (n.id = an.person_id)\n" +
 32279  			"                 │   │   ├─ InnerJoin\n" +
 32280  			"                 │   │   │   ├─ (ci.person_id = n.id)\n" +
 32281  			"                 │   │   │   ├─ Filter\n" +
 32282  			"                 │   │   │   │   ├─ (((n.name_pcode_cf >= 'A') AND (n.name_pcode_cf <= 'F')) AND ((n.gender = 'm') OR ((n.gender = 'f') AND ((n.name >= 'A') AND (n.name <= 'Aÿ')))))\n" +
 32283  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 32284  			"                 │   │   │   │       └─ Table\n" +
 32285  			"                 │   │   │   │           ├─ name: name\n" +
 32286  			"                 │   │   │   │           └─ columns: [id name gender name_pcode_cf]\n" +
 32287  			"                 │   │   │   └─ TableAlias(ci)\n" +
 32288  			"                 │   │   │       └─ Table\n" +
 32289  			"                 │   │   │           ├─ name: cast_info\n" +
 32290  			"                 │   │   │           └─ columns: [person_id movie_id]\n" +
 32291  			"                 │   │   └─ Filter\n" +
 32292  			"                 │   │       ├─ ((NOT(an.name IS NULL)) AND (an.name LIKE '%a%' OR ((an.name >= 'A') AND (an.name <= 'Aÿ'))))\n" +
 32293  			"                 │   │       └─ TableAlias(an)\n" +
 32294  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 32295  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 32296  			"                 │   │               ├─ columns: [person_id name]\n" +
 32297  			"                 │   │               └─ keys: ci.person_id\n" +
 32298  			"                 │   └─ TableAlias(ml)\n" +
 32299  			"                 │       └─ Table\n" +
 32300  			"                 │           ├─ name: movie_link\n" +
 32301  			"                 │           └─ columns: [linked_movie_id link_type_id]\n" +
 32302  			"                 └─ Filter\n" +
 32303  			"                     ├─ (lt.link HASH IN ('references', 'referenced in', 'features', 'featured in'))\n" +
 32304  			"                     └─ TableAlias(lt)\n" +
 32305  			"                         └─ Table\n" +
 32306  			"                             ├─ name: link_type\n" +
 32307  			"                             └─ columns: [id link]\n" +
 32308  			"",
 32309  		ExpectedAnalysis: "Project\n" +
 32310  			" ├─ columns: [min(n.name) as cast_member_name, min(pi.info) as cast_member_info]\n" +
 32311  			" └─ GroupBy\n" +
 32312  			"     ├─ SelectedExprs(MIN(n.name), MIN(pi.info))\n" +
 32313  			"     ├─ Grouping()\n" +
 32314  			"     └─ InnerJoin\n" +
 32315  			"         ├─ ((t.id = ci.movie_id) AND (ml.linked_movie_id = t.id))\n" +
 32316  			"         ├─ Filter\n" +
 32317  			"         │   ├─ ((t.production_year >= 1980) AND (t.production_year <= 2010))\n" +
 32318  			"         │   └─ TableAlias(t)\n" +
 32319  			"         │       └─ Table\n" +
 32320  			"         │           ├─ name: title\n" +
 32321  			"         │           └─ columns: [id production_year]\n" +
 32322  			"         └─ InnerJoin\n" +
 32323  			"             ├─ (((n.id = pi.person_id) AND (pi.person_id = an.person_id)) AND (pi.person_id = ci.person_id))\n" +
 32324  			"             ├─ InnerJoin\n" +
 32325  			"             │   ├─ (it.id = pi.info_type_id)\n" +
 32326  			"             │   ├─ Filter\n" +
 32327  			"             │   │   ├─ (NOT(pi.note IS NULL))\n" +
 32328  			"             │   │   └─ TableAlias(pi)\n" +
 32329  			"             │   │       └─ Table\n" +
 32330  			"             │   │           ├─ name: person_info\n" +
 32331  			"             │   │           └─ columns: [person_id info_type_id info note]\n" +
 32332  			"             │   └─ Filter\n" +
 32333  			"             │       ├─ (it.info = 'mini biography')\n" +
 32334  			"             │       └─ TableAlias(it)\n" +
 32335  			"             │           └─ Table\n" +
 32336  			"             │               ├─ name: info_type\n" +
 32337  			"             │               └─ columns: [id info]\n" +
 32338  			"             └─ InnerJoin\n" +
 32339  			"                 ├─ (lt.id = ml.link_type_id)\n" +
 32340  			"                 ├─ InnerJoin\n" +
 32341  			"                 │   ├─ (ci.movie_id = ml.linked_movie_id)\n" +
 32342  			"                 │   ├─ LookupJoin\n" +
 32343  			"                 │   │   ├─ (n.id = an.person_id)\n" +
 32344  			"                 │   │   ├─ InnerJoin\n" +
 32345  			"                 │   │   │   ├─ (ci.person_id = n.id)\n" +
 32346  			"                 │   │   │   ├─ Filter\n" +
 32347  			"                 │   │   │   │   ├─ (((n.name_pcode_cf >= 'A') AND (n.name_pcode_cf <= 'F')) AND ((n.gender = 'm') OR ((n.gender = 'f') AND ((n.name >= 'A') AND (n.name <= 'Aÿ')))))\n" +
 32348  			"                 │   │   │   │   └─ TableAlias(n)\n" +
 32349  			"                 │   │   │   │       └─ Table\n" +
 32350  			"                 │   │   │   │           ├─ name: name\n" +
 32351  			"                 │   │   │   │           └─ columns: [id name gender name_pcode_cf]\n" +
 32352  			"                 │   │   │   └─ TableAlias(ci)\n" +
 32353  			"                 │   │   │       └─ Table\n" +
 32354  			"                 │   │   │           ├─ name: cast_info\n" +
 32355  			"                 │   │   │           └─ columns: [person_id movie_id]\n" +
 32356  			"                 │   │   └─ Filter\n" +
 32357  			"                 │   │       ├─ ((NOT(an.name IS NULL)) AND (an.name LIKE '%a%' OR ((an.name >= 'A') AND (an.name <= 'Aÿ'))))\n" +
 32358  			"                 │   │       └─ TableAlias(an)\n" +
 32359  			"                 │   │           └─ IndexedTableAccess(aka_name)\n" +
 32360  			"                 │   │               ├─ index: [aka_name.person_id]\n" +
 32361  			"                 │   │               ├─ columns: [person_id name]\n" +
 32362  			"                 │   │               └─ keys: ci.person_id\n" +
 32363  			"                 │   └─ TableAlias(ml)\n" +
 32364  			"                 │       └─ Table\n" +
 32365  			"                 │           ├─ name: movie_link\n" +
 32366  			"                 │           └─ columns: [linked_movie_id link_type_id]\n" +
 32367  			"                 └─ Filter\n" +
 32368  			"                     ├─ (lt.link HASH IN ('references', 'referenced in', 'features', 'featured in'))\n" +
 32369  			"                     └─ TableAlias(lt)\n" +
 32370  			"                         └─ Table\n" +
 32371  			"                             ├─ name: link_type\n" +
 32372  			"                             └─ columns: [id link]\n" +
 32373  			"",
 32374  	},
 32375  	{
 32376  		Query: `
 32377  SELECT MIN(an1.name) AS actress_pseudonym,
 32378         MIN(t.title) AS japanese_movie_dubbed
 32379  FROM aka_name AS an1,
 32380       cast_info AS ci,
 32381       company_name AS cn,
 32382       movie_companies AS mc,
 32383       name AS n1,
 32384       role_type AS rt,
 32385       title AS t
 32386  WHERE ci.note ='(voice: English version)'
 32387    AND cn.country_code ='[jp]'
 32388    AND mc.note LIKE '%(Japan)%'
 32389    AND mc.note NOT LIKE '%(USA)%'
 32390    AND n1.name LIKE '%Yo%'
 32391    AND n1.name NOT LIKE '%Yu%'
 32392    AND rt.role ='actress'
 32393    AND an1.person_id = n1.id
 32394    AND n1.id = ci.person_id
 32395    AND ci.movie_id = t.id
 32396    AND t.id = mc.movie_id
 32397    AND mc.company_id = cn.id
 32398    AND ci.role_id = rt.id
 32399    AND an1.person_id = ci.person_id
 32400    AND ci.movie_id = mc.movie_id;
 32401  
 32402  `,
 32403  		ExpectedPlan: "Project\n" +
 32404  			" ├─ columns: [min(an1.name):0!null as actress_pseudonym, min(t.title):1!null as japanese_movie_dubbed]\n" +
 32405  			" └─ GroupBy\n" +
 32406  			"     ├─ select: MIN(an1.name:14!null), MIN(t.title:1!null)\n" +
 32407  			"     ├─ group: \n" +
 32408  			"     └─ InnerJoin\n" +
 32409  			"         ├─ AND\n" +
 32410  			"         │   ├─ Eq\n" +
 32411  			"         │   │   ├─ ci.movie_id:10!null\n" +
 32412  			"         │   │   └─ t.id:0!null\n" +
 32413  			"         │   └─ Eq\n" +
 32414  			"         │       ├─ t.id:0!null\n" +
 32415  			"         │       └─ mc.movie_id:6!null\n" +
 32416  			"         ├─ TableAlias(t)\n" +
 32417  			"         │   └─ ProcessTable\n" +
 32418  			"         │       └─ Table\n" +
 32419  			"         │           ├─ name: title\n" +
 32420  			"         │           └─ columns: [id title]\n" +
 32421  			"         └─ InnerJoin\n" +
 32422  			"             ├─ Eq\n" +
 32423  			"             │   ├─ ci.role_id:12!null\n" +
 32424  			"             │   └─ rt.id:2!null\n" +
 32425  			"             ├─ Filter\n" +
 32426  			"             │   ├─ Eq\n" +
 32427  			"             │   │   ├─ rt.role:1!null\n" +
 32428  			"             │   │   └─ actress (longtext)\n" +
 32429  			"             │   └─ TableAlias(rt)\n" +
 32430  			"             │       └─ ProcessTable\n" +
 32431  			"             │           └─ Table\n" +
 32432  			"             │               ├─ name: role_type\n" +
 32433  			"             │               └─ columns: [id role]\n" +
 32434  			"             └─ InnerJoin\n" +
 32435  			"                 ├─ AND\n" +
 32436  			"                 │   ├─ Eq\n" +
 32437  			"                 │   │   ├─ an1.person_id:13!null\n" +
 32438  			"                 │   │   └─ n1.id:4!null\n" +
 32439  			"                 │   └─ Eq\n" +
 32440  			"                 │       ├─ n1.id:4!null\n" +
 32441  			"                 │       └─ ci.person_id:9!null\n" +
 32442  			"                 ├─ Filter\n" +
 32443  			"                 │   ├─ AND\n" +
 32444  			"                 │   │   ├─ n1.name LIKE '%Yo%'\n" +
 32445  			"                 │   │   └─ NOT\n" +
 32446  			"                 │   │       └─ n1.name LIKE '%Yu%'\n" +
 32447  			"                 │   └─ TableAlias(n1)\n" +
 32448  			"                 │       └─ ProcessTable\n" +
 32449  			"                 │           └─ Table\n" +
 32450  			"                 │               ├─ name: name\n" +
 32451  			"                 │               └─ columns: [id name]\n" +
 32452  			"                 └─ InnerJoin\n" +
 32453  			"                     ├─ Eq\n" +
 32454  			"                     │   ├─ mc.company_id:7!null\n" +
 32455  			"                     │   └─ cn.id:15!null\n" +
 32456  			"                     ├─ InnerJoin\n" +
 32457  			"                     │   ├─ Eq\n" +
 32458  			"                     │   │   ├─ ci.movie_id:10!null\n" +
 32459  			"                     │   │   └─ mc.movie_id:6!null\n" +
 32460  			"                     │   ├─ Filter\n" +
 32461  			"                     │   │   ├─ AND\n" +
 32462  			"                     │   │   │   ├─ mc.note LIKE '%(Japan)%'\n" +
 32463  			"                     │   │   │   └─ NOT\n" +
 32464  			"                     │   │   │       └─ mc.note LIKE '%(USA)%'\n" +
 32465  			"                     │   │   └─ TableAlias(mc)\n" +
 32466  			"                     │   │       └─ ProcessTable\n" +
 32467  			"                     │   │           └─ Table\n" +
 32468  			"                     │   │               ├─ name: movie_companies\n" +
 32469  			"                     │   │               └─ columns: [movie_id company_id note]\n" +
 32470  			"                     │   └─ LookupJoin\n" +
 32471  			"                     │       ├─ Filter\n" +
 32472  			"                     │       │   ├─ Eq\n" +
 32473  			"                     │       │   │   ├─ ci.note:2\n" +
 32474  			"                     │       │   │   └─ (voice: English version) (longtext)\n" +
 32475  			"                     │       │   └─ TableAlias(ci)\n" +
 32476  			"                     │       │       └─ ProcessTable\n" +
 32477  			"                     │       │           └─ Table\n" +
 32478  			"                     │       │               ├─ name: cast_info\n" +
 32479  			"                     │       │               └─ columns: [person_id movie_id note role_id]\n" +
 32480  			"                     │       └─ TableAlias(an1)\n" +
 32481  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 32482  			"                     │               ├─ index: [aka_name.person_id]\n" +
 32483  			"                     │               ├─ keys: [ci.person_id:9!null]\n" +
 32484  			"                     │               ├─ colSet: (1-8)\n" +
 32485  			"                     │               ├─ tableId: 1\n" +
 32486  			"                     │               └─ Table\n" +
 32487  			"                     │                   ├─ name: aka_name\n" +
 32488  			"                     │                   └─ columns: [person_id name]\n" +
 32489  			"                     └─ Filter\n" +
 32490  			"                         ├─ Eq\n" +
 32491  			"                         │   ├─ cn.country_code:1\n" +
 32492  			"                         │   └─ [jp] (longtext)\n" +
 32493  			"                         └─ TableAlias(cn)\n" +
 32494  			"                             └─ ProcessTable\n" +
 32495  			"                                 └─ Table\n" +
 32496  			"                                     ├─ name: company_name\n" +
 32497  			"                                     └─ columns: [id country_code]\n" +
 32498  			"",
 32499  		ExpectedEstimates: "Project\n" +
 32500  			" ├─ columns: [min(an1.name) as actress_pseudonym, min(t.title) as japanese_movie_dubbed]\n" +
 32501  			" └─ GroupBy\n" +
 32502  			"     ├─ SelectedExprs(MIN(an1.name), MIN(t.title))\n" +
 32503  			"     ├─ Grouping()\n" +
 32504  			"     └─ InnerJoin\n" +
 32505  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 32506  			"         ├─ TableAlias(t)\n" +
 32507  			"         │   └─ Table\n" +
 32508  			"         │       ├─ name: title\n" +
 32509  			"         │       └─ columns: [id title]\n" +
 32510  			"         └─ InnerJoin\n" +
 32511  			"             ├─ (ci.role_id = rt.id)\n" +
 32512  			"             ├─ Filter\n" +
 32513  			"             │   ├─ (rt.role = 'actress')\n" +
 32514  			"             │   └─ TableAlias(rt)\n" +
 32515  			"             │       └─ Table\n" +
 32516  			"             │           ├─ name: role_type\n" +
 32517  			"             │           └─ columns: [id role]\n" +
 32518  			"             └─ InnerJoin\n" +
 32519  			"                 ├─ ((an1.person_id = n1.id) AND (n1.id = ci.person_id))\n" +
 32520  			"                 ├─ Filter\n" +
 32521  			"                 │   ├─ (n1.name LIKE '%Yo%' AND (NOT(n1.name LIKE '%Yu%')))\n" +
 32522  			"                 │   └─ TableAlias(n1)\n" +
 32523  			"                 │       └─ Table\n" +
 32524  			"                 │           ├─ name: name\n" +
 32525  			"                 │           └─ columns: [id name]\n" +
 32526  			"                 └─ InnerJoin\n" +
 32527  			"                     ├─ (mc.company_id = cn.id)\n" +
 32528  			"                     ├─ InnerJoin\n" +
 32529  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 32530  			"                     │   ├─ Filter\n" +
 32531  			"                     │   │   ├─ (mc.note LIKE '%(Japan)%' AND (NOT(mc.note LIKE '%(USA)%')))\n" +
 32532  			"                     │   │   └─ TableAlias(mc)\n" +
 32533  			"                     │   │       └─ Table\n" +
 32534  			"                     │   │           ├─ name: movie_companies\n" +
 32535  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 32536  			"                     │   └─ LookupJoin\n" +
 32537  			"                     │       ├─ Filter\n" +
 32538  			"                     │       │   ├─ (ci.note = '(voice: English version)')\n" +
 32539  			"                     │       │   └─ TableAlias(ci)\n" +
 32540  			"                     │       │       └─ Table\n" +
 32541  			"                     │       │           ├─ name: cast_info\n" +
 32542  			"                     │       │           └─ columns: [person_id movie_id note role_id]\n" +
 32543  			"                     │       └─ TableAlias(an1)\n" +
 32544  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 32545  			"                     │               ├─ index: [aka_name.person_id]\n" +
 32546  			"                     │               ├─ columns: [person_id name]\n" +
 32547  			"                     │               └─ keys: ci.person_id\n" +
 32548  			"                     └─ Filter\n" +
 32549  			"                         ├─ (cn.country_code = '[jp]')\n" +
 32550  			"                         └─ TableAlias(cn)\n" +
 32551  			"                             └─ Table\n" +
 32552  			"                                 ├─ name: company_name\n" +
 32553  			"                                 └─ columns: [id country_code]\n" +
 32554  			"",
 32555  		ExpectedAnalysis: "Project\n" +
 32556  			" ├─ columns: [min(an1.name) as actress_pseudonym, min(t.title) as japanese_movie_dubbed]\n" +
 32557  			" └─ GroupBy\n" +
 32558  			"     ├─ SelectedExprs(MIN(an1.name), MIN(t.title))\n" +
 32559  			"     ├─ Grouping()\n" +
 32560  			"     └─ InnerJoin\n" +
 32561  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 32562  			"         ├─ TableAlias(t)\n" +
 32563  			"         │   └─ Table\n" +
 32564  			"         │       ├─ name: title\n" +
 32565  			"         │       └─ columns: [id title]\n" +
 32566  			"         └─ InnerJoin\n" +
 32567  			"             ├─ (ci.role_id = rt.id)\n" +
 32568  			"             ├─ Filter\n" +
 32569  			"             │   ├─ (rt.role = 'actress')\n" +
 32570  			"             │   └─ TableAlias(rt)\n" +
 32571  			"             │       └─ Table\n" +
 32572  			"             │           ├─ name: role_type\n" +
 32573  			"             │           └─ columns: [id role]\n" +
 32574  			"             └─ InnerJoin\n" +
 32575  			"                 ├─ ((an1.person_id = n1.id) AND (n1.id = ci.person_id))\n" +
 32576  			"                 ├─ Filter\n" +
 32577  			"                 │   ├─ (n1.name LIKE '%Yo%' AND (NOT(n1.name LIKE '%Yu%')))\n" +
 32578  			"                 │   └─ TableAlias(n1)\n" +
 32579  			"                 │       └─ Table\n" +
 32580  			"                 │           ├─ name: name\n" +
 32581  			"                 │           └─ columns: [id name]\n" +
 32582  			"                 └─ InnerJoin\n" +
 32583  			"                     ├─ (mc.company_id = cn.id)\n" +
 32584  			"                     ├─ InnerJoin\n" +
 32585  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 32586  			"                     │   ├─ Filter\n" +
 32587  			"                     │   │   ├─ (mc.note LIKE '%(Japan)%' AND (NOT(mc.note LIKE '%(USA)%')))\n" +
 32588  			"                     │   │   └─ TableAlias(mc)\n" +
 32589  			"                     │   │       └─ Table\n" +
 32590  			"                     │   │           ├─ name: movie_companies\n" +
 32591  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 32592  			"                     │   └─ LookupJoin\n" +
 32593  			"                     │       ├─ Filter\n" +
 32594  			"                     │       │   ├─ (ci.note = '(voice: English version)')\n" +
 32595  			"                     │       │   └─ TableAlias(ci)\n" +
 32596  			"                     │       │       └─ Table\n" +
 32597  			"                     │       │           ├─ name: cast_info\n" +
 32598  			"                     │       │           └─ columns: [person_id movie_id note role_id]\n" +
 32599  			"                     │       └─ TableAlias(an1)\n" +
 32600  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 32601  			"                     │               ├─ index: [aka_name.person_id]\n" +
 32602  			"                     │               ├─ columns: [person_id name]\n" +
 32603  			"                     │               └─ keys: ci.person_id\n" +
 32604  			"                     └─ Filter\n" +
 32605  			"                         ├─ (cn.country_code = '[jp]')\n" +
 32606  			"                         └─ TableAlias(cn)\n" +
 32607  			"                             └─ Table\n" +
 32608  			"                                 ├─ name: company_name\n" +
 32609  			"                                 └─ columns: [id country_code]\n" +
 32610  			"",
 32611  	},
 32612  	{
 32613  		Query: `
 32614  SELECT MIN(an.name) AS acress_pseudonym,
 32615         MIN(t.title) AS japanese_anime_movie
 32616  FROM aka_name AS an,
 32617       cast_info AS ci,
 32618       company_name AS cn,
 32619       movie_companies AS mc,
 32620       name AS n,
 32621       role_type AS rt,
 32622       title AS t
 32623  WHERE ci.note ='(voice: English version)'
 32624    AND cn.country_code ='[jp]'
 32625    AND mc.note LIKE '%(Japan)%'
 32626    AND mc.note NOT LIKE '%(USA)%'
 32627    AND (mc.note LIKE '%(2006)%'
 32628         OR mc.note LIKE '%(2007)%')
 32629    AND n.name LIKE '%Yo%'
 32630    AND n.name NOT LIKE '%Yu%'
 32631    AND rt.role ='actress'
 32632    AND t.production_year BETWEEN 2006 AND 2007
 32633    AND (t.title LIKE 'One Piece%'
 32634         OR t.title LIKE 'Dragon Ball Z%')
 32635    AND an.person_id = n.id
 32636    AND n.id = ci.person_id
 32637    AND ci.movie_id = t.id
 32638    AND t.id = mc.movie_id
 32639    AND mc.company_id = cn.id
 32640    AND ci.role_id = rt.id
 32641    AND an.person_id = ci.person_id
 32642    AND ci.movie_id = mc.movie_id;
 32643  
 32644  `,
 32645  		ExpectedPlan: "Project\n" +
 32646  			" ├─ columns: [min(an.name):0!null as acress_pseudonym, min(t.title):1!null as japanese_anime_movie]\n" +
 32647  			" └─ GroupBy\n" +
 32648  			"     ├─ select: MIN(an.name:15!null), MIN(t.title:1!null)\n" +
 32649  			"     ├─ group: \n" +
 32650  			"     └─ InnerJoin\n" +
 32651  			"         ├─ AND\n" +
 32652  			"         │   ├─ Eq\n" +
 32653  			"         │   │   ├─ ci.movie_id:11!null\n" +
 32654  			"         │   │   └─ t.id:0!null\n" +
 32655  			"         │   └─ Eq\n" +
 32656  			"         │       ├─ t.id:0!null\n" +
 32657  			"         │       └─ mc.movie_id:7!null\n" +
 32658  			"         ├─ Filter\n" +
 32659  			"         │   ├─ AND\n" +
 32660  			"         │   │   ├─ AND\n" +
 32661  			"         │   │   │   ├─ GreaterThanOrEqual\n" +
 32662  			"         │   │   │   │   ├─ t.production_year:2\n" +
 32663  			"         │   │   │   │   └─ 2006 (smallint)\n" +
 32664  			"         │   │   │   └─ LessThanOrEqual\n" +
 32665  			"         │   │   │       ├─ t.production_year:2\n" +
 32666  			"         │   │   │       └─ 2007 (smallint)\n" +
 32667  			"         │   │   └─ Or\n" +
 32668  			"         │   │       ├─ AND\n" +
 32669  			"         │   │       │   ├─ GreaterThanOrEqual\n" +
 32670  			"         │   │       │   │   ├─ t.title:1!null\n" +
 32671  			"         │   │       │   │   └─ One Piece (longtext)\n" +
 32672  			"         │   │       │   └─ LessThanOrEqual\n" +
 32673  			"         │   │       │       ├─ t.title:1!null\n" +
 32674  			"         │   │       │       └─ One Pieceÿ (longtext)\n" +
 32675  			"         │   │       └─ AND\n" +
 32676  			"         │   │           ├─ GreaterThanOrEqual\n" +
 32677  			"         │   │           │   ├─ t.title:1!null\n" +
 32678  			"         │   │           │   └─ Dragon Ball Z (longtext)\n" +
 32679  			"         │   │           └─ LessThanOrEqual\n" +
 32680  			"         │   │               ├─ t.title:1!null\n" +
 32681  			"         │   │               └─ Dragon Ball Zÿ (longtext)\n" +
 32682  			"         │   └─ TableAlias(t)\n" +
 32683  			"         │       └─ ProcessTable\n" +
 32684  			"         │           └─ Table\n" +
 32685  			"         │               ├─ name: title\n" +
 32686  			"         │               └─ columns: [id title production_year]\n" +
 32687  			"         └─ InnerJoin\n" +
 32688  			"             ├─ Eq\n" +
 32689  			"             │   ├─ ci.role_id:13!null\n" +
 32690  			"             │   └─ rt.id:3!null\n" +
 32691  			"             ├─ Filter\n" +
 32692  			"             │   ├─ Eq\n" +
 32693  			"             │   │   ├─ rt.role:1!null\n" +
 32694  			"             │   │   └─ actress (longtext)\n" +
 32695  			"             │   └─ TableAlias(rt)\n" +
 32696  			"             │       └─ ProcessTable\n" +
 32697  			"             │           └─ Table\n" +
 32698  			"             │               ├─ name: role_type\n" +
 32699  			"             │               └─ columns: [id role]\n" +
 32700  			"             └─ InnerJoin\n" +
 32701  			"                 ├─ AND\n" +
 32702  			"                 │   ├─ Eq\n" +
 32703  			"                 │   │   ├─ an.person_id:14!null\n" +
 32704  			"                 │   │   └─ n.id:5!null\n" +
 32705  			"                 │   └─ Eq\n" +
 32706  			"                 │       ├─ n.id:5!null\n" +
 32707  			"                 │       └─ ci.person_id:10!null\n" +
 32708  			"                 ├─ Filter\n" +
 32709  			"                 │   ├─ AND\n" +
 32710  			"                 │   │   ├─ n.name LIKE '%Yo%'\n" +
 32711  			"                 │   │   └─ NOT\n" +
 32712  			"                 │   │       └─ n.name LIKE '%Yu%'\n" +
 32713  			"                 │   └─ TableAlias(n)\n" +
 32714  			"                 │       └─ ProcessTable\n" +
 32715  			"                 │           └─ Table\n" +
 32716  			"                 │               ├─ name: name\n" +
 32717  			"                 │               └─ columns: [id name]\n" +
 32718  			"                 └─ InnerJoin\n" +
 32719  			"                     ├─ Eq\n" +
 32720  			"                     │   ├─ mc.company_id:8!null\n" +
 32721  			"                     │   └─ cn.id:16!null\n" +
 32722  			"                     ├─ InnerJoin\n" +
 32723  			"                     │   ├─ Eq\n" +
 32724  			"                     │   │   ├─ ci.movie_id:11!null\n" +
 32725  			"                     │   │   └─ mc.movie_id:7!null\n" +
 32726  			"                     │   ├─ Filter\n" +
 32727  			"                     │   │   ├─ AND\n" +
 32728  			"                     │   │   │   ├─ AND\n" +
 32729  			"                     │   │   │   │   ├─ mc.note LIKE '%(Japan)%'\n" +
 32730  			"                     │   │   │   │   └─ NOT\n" +
 32731  			"                     │   │   │   │       └─ mc.note LIKE '%(USA)%'\n" +
 32732  			"                     │   │   │   └─ Or\n" +
 32733  			"                     │   │   │       ├─ mc.note LIKE '%(2006)%'\n" +
 32734  			"                     │   │   │       └─ mc.note LIKE '%(2007)%'\n" +
 32735  			"                     │   │   └─ TableAlias(mc)\n" +
 32736  			"                     │   │       └─ ProcessTable\n" +
 32737  			"                     │   │           └─ Table\n" +
 32738  			"                     │   │               ├─ name: movie_companies\n" +
 32739  			"                     │   │               └─ columns: [movie_id company_id note]\n" +
 32740  			"                     │   └─ LookupJoin\n" +
 32741  			"                     │       ├─ Filter\n" +
 32742  			"                     │       │   ├─ Eq\n" +
 32743  			"                     │       │   │   ├─ ci.note:2\n" +
 32744  			"                     │       │   │   └─ (voice: English version) (longtext)\n" +
 32745  			"                     │       │   └─ TableAlias(ci)\n" +
 32746  			"                     │       │       └─ ProcessTable\n" +
 32747  			"                     │       │           └─ Table\n" +
 32748  			"                     │       │               ├─ name: cast_info\n" +
 32749  			"                     │       │               └─ columns: [person_id movie_id note role_id]\n" +
 32750  			"                     │       └─ TableAlias(an)\n" +
 32751  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 32752  			"                     │               ├─ index: [aka_name.person_id]\n" +
 32753  			"                     │               ├─ keys: [ci.person_id:10!null]\n" +
 32754  			"                     │               ├─ colSet: (1-8)\n" +
 32755  			"                     │               ├─ tableId: 1\n" +
 32756  			"                     │               └─ Table\n" +
 32757  			"                     │                   ├─ name: aka_name\n" +
 32758  			"                     │                   └─ columns: [person_id name]\n" +
 32759  			"                     └─ Filter\n" +
 32760  			"                         ├─ Eq\n" +
 32761  			"                         │   ├─ cn.country_code:1\n" +
 32762  			"                         │   └─ [jp] (longtext)\n" +
 32763  			"                         └─ TableAlias(cn)\n" +
 32764  			"                             └─ ProcessTable\n" +
 32765  			"                                 └─ Table\n" +
 32766  			"                                     ├─ name: company_name\n" +
 32767  			"                                     └─ columns: [id country_code]\n" +
 32768  			"",
 32769  		ExpectedEstimates: "Project\n" +
 32770  			" ├─ columns: [min(an.name) as acress_pseudonym, min(t.title) as japanese_anime_movie]\n" +
 32771  			" └─ GroupBy\n" +
 32772  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
 32773  			"     ├─ Grouping()\n" +
 32774  			"     └─ InnerJoin\n" +
 32775  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 32776  			"         ├─ Filter\n" +
 32777  			"         │   ├─ (((t.production_year >= 2006) AND (t.production_year <= 2007)) AND (((t.title >= 'One Piece') AND (t.title <= 'One Pieceÿ')) OR ((t.title >= 'Dragon Ball Z') AND (t.title <= 'Dragon Ball Zÿ'))))\n" +
 32778  			"         │   └─ TableAlias(t)\n" +
 32779  			"         │       └─ Table\n" +
 32780  			"         │           ├─ name: title\n" +
 32781  			"         │           └─ columns: [id title production_year]\n" +
 32782  			"         └─ InnerJoin\n" +
 32783  			"             ├─ (ci.role_id = rt.id)\n" +
 32784  			"             ├─ Filter\n" +
 32785  			"             │   ├─ (rt.role = 'actress')\n" +
 32786  			"             │   └─ TableAlias(rt)\n" +
 32787  			"             │       └─ Table\n" +
 32788  			"             │           ├─ name: role_type\n" +
 32789  			"             │           └─ columns: [id role]\n" +
 32790  			"             └─ InnerJoin\n" +
 32791  			"                 ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
 32792  			"                 ├─ Filter\n" +
 32793  			"                 │   ├─ (n.name LIKE '%Yo%' AND (NOT(n.name LIKE '%Yu%')))\n" +
 32794  			"                 │   └─ TableAlias(n)\n" +
 32795  			"                 │       └─ Table\n" +
 32796  			"                 │           ├─ name: name\n" +
 32797  			"                 │           └─ columns: [id name]\n" +
 32798  			"                 └─ InnerJoin\n" +
 32799  			"                     ├─ (mc.company_id = cn.id)\n" +
 32800  			"                     ├─ InnerJoin\n" +
 32801  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 32802  			"                     │   ├─ Filter\n" +
 32803  			"                     │   │   ├─ ((mc.note LIKE '%(Japan)%' AND (NOT(mc.note LIKE '%(USA)%'))) AND (mc.note LIKE '%(2006)%' OR mc.note LIKE '%(2007)%'))\n" +
 32804  			"                     │   │   └─ TableAlias(mc)\n" +
 32805  			"                     │   │       └─ Table\n" +
 32806  			"                     │   │           ├─ name: movie_companies\n" +
 32807  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 32808  			"                     │   └─ LookupJoin\n" +
 32809  			"                     │       ├─ Filter\n" +
 32810  			"                     │       │   ├─ (ci.note = '(voice: English version)')\n" +
 32811  			"                     │       │   └─ TableAlias(ci)\n" +
 32812  			"                     │       │       └─ Table\n" +
 32813  			"                     │       │           ├─ name: cast_info\n" +
 32814  			"                     │       │           └─ columns: [person_id movie_id note role_id]\n" +
 32815  			"                     │       └─ TableAlias(an)\n" +
 32816  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 32817  			"                     │               ├─ index: [aka_name.person_id]\n" +
 32818  			"                     │               ├─ columns: [person_id name]\n" +
 32819  			"                     │               └─ keys: ci.person_id\n" +
 32820  			"                     └─ Filter\n" +
 32821  			"                         ├─ (cn.country_code = '[jp]')\n" +
 32822  			"                         └─ TableAlias(cn)\n" +
 32823  			"                             └─ Table\n" +
 32824  			"                                 ├─ name: company_name\n" +
 32825  			"                                 └─ columns: [id country_code]\n" +
 32826  			"",
 32827  		ExpectedAnalysis: "Project\n" +
 32828  			" ├─ columns: [min(an.name) as acress_pseudonym, min(t.title) as japanese_anime_movie]\n" +
 32829  			" └─ GroupBy\n" +
 32830  			"     ├─ SelectedExprs(MIN(an.name), MIN(t.title))\n" +
 32831  			"     ├─ Grouping()\n" +
 32832  			"     └─ InnerJoin\n" +
 32833  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 32834  			"         ├─ Filter\n" +
 32835  			"         │   ├─ (((t.production_year >= 2006) AND (t.production_year <= 2007)) AND (((t.title >= 'One Piece') AND (t.title <= 'One Pieceÿ')) OR ((t.title >= 'Dragon Ball Z') AND (t.title <= 'Dragon Ball Zÿ'))))\n" +
 32836  			"         │   └─ TableAlias(t)\n" +
 32837  			"         │       └─ Table\n" +
 32838  			"         │           ├─ name: title\n" +
 32839  			"         │           └─ columns: [id title production_year]\n" +
 32840  			"         └─ InnerJoin\n" +
 32841  			"             ├─ (ci.role_id = rt.id)\n" +
 32842  			"             ├─ Filter\n" +
 32843  			"             │   ├─ (rt.role = 'actress')\n" +
 32844  			"             │   └─ TableAlias(rt)\n" +
 32845  			"             │       └─ Table\n" +
 32846  			"             │           ├─ name: role_type\n" +
 32847  			"             │           └─ columns: [id role]\n" +
 32848  			"             └─ InnerJoin\n" +
 32849  			"                 ├─ ((an.person_id = n.id) AND (n.id = ci.person_id))\n" +
 32850  			"                 ├─ Filter\n" +
 32851  			"                 │   ├─ (n.name LIKE '%Yo%' AND (NOT(n.name LIKE '%Yu%')))\n" +
 32852  			"                 │   └─ TableAlias(n)\n" +
 32853  			"                 │       └─ Table\n" +
 32854  			"                 │           ├─ name: name\n" +
 32855  			"                 │           └─ columns: [id name]\n" +
 32856  			"                 └─ InnerJoin\n" +
 32857  			"                     ├─ (mc.company_id = cn.id)\n" +
 32858  			"                     ├─ InnerJoin\n" +
 32859  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 32860  			"                     │   ├─ Filter\n" +
 32861  			"                     │   │   ├─ ((mc.note LIKE '%(Japan)%' AND (NOT(mc.note LIKE '%(USA)%'))) AND (mc.note LIKE '%(2006)%' OR mc.note LIKE '%(2007)%'))\n" +
 32862  			"                     │   │   └─ TableAlias(mc)\n" +
 32863  			"                     │   │       └─ Table\n" +
 32864  			"                     │   │           ├─ name: movie_companies\n" +
 32865  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 32866  			"                     │   └─ LookupJoin\n" +
 32867  			"                     │       ├─ Filter\n" +
 32868  			"                     │       │   ├─ (ci.note = '(voice: English version)')\n" +
 32869  			"                     │       │   └─ TableAlias(ci)\n" +
 32870  			"                     │       │       └─ Table\n" +
 32871  			"                     │       │           ├─ name: cast_info\n" +
 32872  			"                     │       │           └─ columns: [person_id movie_id note role_id]\n" +
 32873  			"                     │       └─ TableAlias(an)\n" +
 32874  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 32875  			"                     │               ├─ index: [aka_name.person_id]\n" +
 32876  			"                     │               ├─ columns: [person_id name]\n" +
 32877  			"                     │               └─ keys: ci.person_id\n" +
 32878  			"                     └─ Filter\n" +
 32879  			"                         ├─ (cn.country_code = '[jp]')\n" +
 32880  			"                         └─ TableAlias(cn)\n" +
 32881  			"                             └─ Table\n" +
 32882  			"                                 ├─ name: company_name\n" +
 32883  			"                                 └─ columns: [id country_code]\n" +
 32884  			"",
 32885  	},
 32886  	{
 32887  		Query: `
 32888  SELECT MIN(a1.name) AS writer_pseudo_name,
 32889         MIN(t.title) AS movie_title
 32890  FROM aka_name AS a1,
 32891       cast_info AS ci,
 32892       company_name AS cn,
 32893       movie_companies AS mc,
 32894       name AS n1,
 32895       role_type AS rt,
 32896       title AS t
 32897  WHERE cn.country_code ='[us]'
 32898    AND rt.role ='writer'
 32899    AND a1.person_id = n1.id
 32900    AND n1.id = ci.person_id
 32901    AND ci.movie_id = t.id
 32902    AND t.id = mc.movie_id
 32903    AND mc.company_id = cn.id
 32904    AND ci.role_id = rt.id
 32905    AND a1.person_id = ci.person_id
 32906    AND ci.movie_id = mc.movie_id;
 32907  
 32908  `,
 32909  		ExpectedPlan: "Project\n" +
 32910  			" ├─ columns: [min(a1.name):0!null as writer_pseudo_name, min(t.title):1!null as movie_title]\n" +
 32911  			" └─ GroupBy\n" +
 32912  			"     ├─ select: MIN(a1.name:11!null), MIN(t.title:1!null)\n" +
 32913  			"     ├─ group: \n" +
 32914  			"     └─ InnerJoin\n" +
 32915  			"         ├─ AND\n" +
 32916  			"         │   ├─ Eq\n" +
 32917  			"         │   │   ├─ ci.movie_id:8!null\n" +
 32918  			"         │   │   └─ t.id:0!null\n" +
 32919  			"         │   └─ Eq\n" +
 32920  			"         │       ├─ t.id:0!null\n" +
 32921  			"         │       └─ mc.movie_id:5!null\n" +
 32922  			"         ├─ TableAlias(t)\n" +
 32923  			"         │   └─ ProcessTable\n" +
 32924  			"         │       └─ Table\n" +
 32925  			"         │           ├─ name: title\n" +
 32926  			"         │           └─ columns: [id title]\n" +
 32927  			"         └─ InnerJoin\n" +
 32928  			"             ├─ Eq\n" +
 32929  			"             │   ├─ ci.role_id:9!null\n" +
 32930  			"             │   └─ rt.id:2!null\n" +
 32931  			"             ├─ Filter\n" +
 32932  			"             │   ├─ Eq\n" +
 32933  			"             │   │   ├─ rt.role:1!null\n" +
 32934  			"             │   │   └─ writer (longtext)\n" +
 32935  			"             │   └─ TableAlias(rt)\n" +
 32936  			"             │       └─ ProcessTable\n" +
 32937  			"             │           └─ Table\n" +
 32938  			"             │               ├─ name: role_type\n" +
 32939  			"             │               └─ columns: [id role]\n" +
 32940  			"             └─ InnerJoin\n" +
 32941  			"                 ├─ AND\n" +
 32942  			"                 │   ├─ Eq\n" +
 32943  			"                 │   │   ├─ a1.person_id:10!null\n" +
 32944  			"                 │   │   └─ n1.id:4!null\n" +
 32945  			"                 │   └─ Eq\n" +
 32946  			"                 │       ├─ n1.id:4!null\n" +
 32947  			"                 │       └─ ci.person_id:7!null\n" +
 32948  			"                 ├─ TableAlias(n1)\n" +
 32949  			"                 │   └─ ProcessTable\n" +
 32950  			"                 │       └─ Table\n" +
 32951  			"                 │           ├─ name: name\n" +
 32952  			"                 │           └─ columns: [id]\n" +
 32953  			"                 └─ InnerJoin\n" +
 32954  			"                     ├─ Eq\n" +
 32955  			"                     │   ├─ mc.company_id:6!null\n" +
 32956  			"                     │   └─ cn.id:12!null\n" +
 32957  			"                     ├─ InnerJoin\n" +
 32958  			"                     │   ├─ Eq\n" +
 32959  			"                     │   │   ├─ ci.movie_id:8!null\n" +
 32960  			"                     │   │   └─ mc.movie_id:5!null\n" +
 32961  			"                     │   ├─ TableAlias(mc)\n" +
 32962  			"                     │   │   └─ ProcessTable\n" +
 32963  			"                     │   │       └─ Table\n" +
 32964  			"                     │   │           ├─ name: movie_companies\n" +
 32965  			"                     │   │           └─ columns: [movie_id company_id]\n" +
 32966  			"                     │   └─ LookupJoin\n" +
 32967  			"                     │       ├─ TableAlias(ci)\n" +
 32968  			"                     │       │   └─ ProcessTable\n" +
 32969  			"                     │       │       └─ Table\n" +
 32970  			"                     │       │           ├─ name: cast_info\n" +
 32971  			"                     │       │           └─ columns: [person_id movie_id role_id]\n" +
 32972  			"                     │       └─ TableAlias(a1)\n" +
 32973  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 32974  			"                     │               ├─ index: [aka_name.person_id]\n" +
 32975  			"                     │               ├─ keys: [ci.person_id:7!null]\n" +
 32976  			"                     │               ├─ colSet: (1-8)\n" +
 32977  			"                     │               ├─ tableId: 1\n" +
 32978  			"                     │               └─ Table\n" +
 32979  			"                     │                   ├─ name: aka_name\n" +
 32980  			"                     │                   └─ columns: [person_id name]\n" +
 32981  			"                     └─ Filter\n" +
 32982  			"                         ├─ Eq\n" +
 32983  			"                         │   ├─ cn.country_code:1\n" +
 32984  			"                         │   └─ [us] (longtext)\n" +
 32985  			"                         └─ TableAlias(cn)\n" +
 32986  			"                             └─ ProcessTable\n" +
 32987  			"                                 └─ Table\n" +
 32988  			"                                     ├─ name: company_name\n" +
 32989  			"                                     └─ columns: [id country_code]\n" +
 32990  			"",
 32991  		ExpectedEstimates: "Project\n" +
 32992  			" ├─ columns: [min(a1.name) as writer_pseudo_name, min(t.title) as movie_title]\n" +
 32993  			" └─ GroupBy\n" +
 32994  			"     ├─ SelectedExprs(MIN(a1.name), MIN(t.title))\n" +
 32995  			"     ├─ Grouping()\n" +
 32996  			"     └─ InnerJoin\n" +
 32997  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 32998  			"         ├─ TableAlias(t)\n" +
 32999  			"         │   └─ Table\n" +
 33000  			"         │       ├─ name: title\n" +
 33001  			"         │       └─ columns: [id title]\n" +
 33002  			"         └─ InnerJoin\n" +
 33003  			"             ├─ (ci.role_id = rt.id)\n" +
 33004  			"             ├─ Filter\n" +
 33005  			"             │   ├─ (rt.role = 'writer')\n" +
 33006  			"             │   └─ TableAlias(rt)\n" +
 33007  			"             │       └─ Table\n" +
 33008  			"             │           ├─ name: role_type\n" +
 33009  			"             │           └─ columns: [id role]\n" +
 33010  			"             └─ InnerJoin\n" +
 33011  			"                 ├─ ((a1.person_id = n1.id) AND (n1.id = ci.person_id))\n" +
 33012  			"                 ├─ TableAlias(n1)\n" +
 33013  			"                 │   └─ Table\n" +
 33014  			"                 │       ├─ name: name\n" +
 33015  			"                 │       └─ columns: [id]\n" +
 33016  			"                 └─ InnerJoin\n" +
 33017  			"                     ├─ (mc.company_id = cn.id)\n" +
 33018  			"                     ├─ InnerJoin\n" +
 33019  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33020  			"                     │   ├─ TableAlias(mc)\n" +
 33021  			"                     │   │   └─ Table\n" +
 33022  			"                     │   │       ├─ name: movie_companies\n" +
 33023  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 33024  			"                     │   └─ LookupJoin\n" +
 33025  			"                     │       ├─ TableAlias(ci)\n" +
 33026  			"                     │       │   └─ Table\n" +
 33027  			"                     │       │       ├─ name: cast_info\n" +
 33028  			"                     │       │       └─ columns: [person_id movie_id role_id]\n" +
 33029  			"                     │       └─ TableAlias(a1)\n" +
 33030  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33031  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33032  			"                     │               ├─ columns: [person_id name]\n" +
 33033  			"                     │               └─ keys: ci.person_id\n" +
 33034  			"                     └─ Filter\n" +
 33035  			"                         ├─ (cn.country_code = '[us]')\n" +
 33036  			"                         └─ TableAlias(cn)\n" +
 33037  			"                             └─ Table\n" +
 33038  			"                                 ├─ name: company_name\n" +
 33039  			"                                 └─ columns: [id country_code]\n" +
 33040  			"",
 33041  		ExpectedAnalysis: "Project\n" +
 33042  			" ├─ columns: [min(a1.name) as writer_pseudo_name, min(t.title) as movie_title]\n" +
 33043  			" └─ GroupBy\n" +
 33044  			"     ├─ SelectedExprs(MIN(a1.name), MIN(t.title))\n" +
 33045  			"     ├─ Grouping()\n" +
 33046  			"     └─ InnerJoin\n" +
 33047  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33048  			"         ├─ TableAlias(t)\n" +
 33049  			"         │   └─ Table\n" +
 33050  			"         │       ├─ name: title\n" +
 33051  			"         │       └─ columns: [id title]\n" +
 33052  			"         └─ InnerJoin\n" +
 33053  			"             ├─ (ci.role_id = rt.id)\n" +
 33054  			"             ├─ Filter\n" +
 33055  			"             │   ├─ (rt.role = 'writer')\n" +
 33056  			"             │   └─ TableAlias(rt)\n" +
 33057  			"             │       └─ Table\n" +
 33058  			"             │           ├─ name: role_type\n" +
 33059  			"             │           └─ columns: [id role]\n" +
 33060  			"             └─ InnerJoin\n" +
 33061  			"                 ├─ ((a1.person_id = n1.id) AND (n1.id = ci.person_id))\n" +
 33062  			"                 ├─ TableAlias(n1)\n" +
 33063  			"                 │   └─ Table\n" +
 33064  			"                 │       ├─ name: name\n" +
 33065  			"                 │       └─ columns: [id]\n" +
 33066  			"                 └─ InnerJoin\n" +
 33067  			"                     ├─ (mc.company_id = cn.id)\n" +
 33068  			"                     ├─ InnerJoin\n" +
 33069  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33070  			"                     │   ├─ TableAlias(mc)\n" +
 33071  			"                     │   │   └─ Table\n" +
 33072  			"                     │   │       ├─ name: movie_companies\n" +
 33073  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 33074  			"                     │   └─ LookupJoin\n" +
 33075  			"                     │       ├─ TableAlias(ci)\n" +
 33076  			"                     │       │   └─ Table\n" +
 33077  			"                     │       │       ├─ name: cast_info\n" +
 33078  			"                     │       │       └─ columns: [person_id movie_id role_id]\n" +
 33079  			"                     │       └─ TableAlias(a1)\n" +
 33080  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33081  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33082  			"                     │               ├─ columns: [person_id name]\n" +
 33083  			"                     │               └─ keys: ci.person_id\n" +
 33084  			"                     └─ Filter\n" +
 33085  			"                         ├─ (cn.country_code = '[us]')\n" +
 33086  			"                         └─ TableAlias(cn)\n" +
 33087  			"                             └─ Table\n" +
 33088  			"                                 ├─ name: company_name\n" +
 33089  			"                                 └─ columns: [id country_code]\n" +
 33090  			"",
 33091  	},
 33092  	{
 33093  		Query: `
 33094  SELECT MIN(an1.name) AS costume_designer_pseudo,
 33095         MIN(t.title) AS movie_with_costumes
 33096  FROM aka_name AS an1,
 33097       cast_info AS ci,
 33098       company_name AS cn,
 33099       movie_companies AS mc,
 33100       name AS n1,
 33101       role_type AS rt,
 33102       title AS t
 33103  WHERE cn.country_code ='[us]'
 33104    AND rt.role ='costume designer'
 33105    AND an1.person_id = n1.id
 33106    AND n1.id = ci.person_id
 33107    AND ci.movie_id = t.id
 33108    AND t.id = mc.movie_id
 33109    AND mc.company_id = cn.id
 33110    AND ci.role_id = rt.id
 33111    AND an1.person_id = ci.person_id
 33112    AND ci.movie_id = mc.movie_id;
 33113  
 33114  `,
 33115  		ExpectedPlan: "Project\n" +
 33116  			" ├─ columns: [min(an1.name):0!null as costume_designer_pseudo, min(t.title):1!null as movie_with_costumes]\n" +
 33117  			" └─ GroupBy\n" +
 33118  			"     ├─ select: MIN(an1.name:11!null), MIN(t.title:1!null)\n" +
 33119  			"     ├─ group: \n" +
 33120  			"     └─ InnerJoin\n" +
 33121  			"         ├─ AND\n" +
 33122  			"         │   ├─ Eq\n" +
 33123  			"         │   │   ├─ ci.movie_id:8!null\n" +
 33124  			"         │   │   └─ t.id:0!null\n" +
 33125  			"         │   └─ Eq\n" +
 33126  			"         │       ├─ t.id:0!null\n" +
 33127  			"         │       └─ mc.movie_id:5!null\n" +
 33128  			"         ├─ TableAlias(t)\n" +
 33129  			"         │   └─ ProcessTable\n" +
 33130  			"         │       └─ Table\n" +
 33131  			"         │           ├─ name: title\n" +
 33132  			"         │           └─ columns: [id title]\n" +
 33133  			"         └─ InnerJoin\n" +
 33134  			"             ├─ Eq\n" +
 33135  			"             │   ├─ ci.role_id:9!null\n" +
 33136  			"             │   └─ rt.id:2!null\n" +
 33137  			"             ├─ Filter\n" +
 33138  			"             │   ├─ Eq\n" +
 33139  			"             │   │   ├─ rt.role:1!null\n" +
 33140  			"             │   │   └─ costume designer (longtext)\n" +
 33141  			"             │   └─ TableAlias(rt)\n" +
 33142  			"             │       └─ ProcessTable\n" +
 33143  			"             │           └─ Table\n" +
 33144  			"             │               ├─ name: role_type\n" +
 33145  			"             │               └─ columns: [id role]\n" +
 33146  			"             └─ InnerJoin\n" +
 33147  			"                 ├─ AND\n" +
 33148  			"                 │   ├─ Eq\n" +
 33149  			"                 │   │   ├─ an1.person_id:10!null\n" +
 33150  			"                 │   │   └─ n1.id:4!null\n" +
 33151  			"                 │   └─ Eq\n" +
 33152  			"                 │       ├─ n1.id:4!null\n" +
 33153  			"                 │       └─ ci.person_id:7!null\n" +
 33154  			"                 ├─ TableAlias(n1)\n" +
 33155  			"                 │   └─ ProcessTable\n" +
 33156  			"                 │       └─ Table\n" +
 33157  			"                 │           ├─ name: name\n" +
 33158  			"                 │           └─ columns: [id]\n" +
 33159  			"                 └─ InnerJoin\n" +
 33160  			"                     ├─ Eq\n" +
 33161  			"                     │   ├─ mc.company_id:6!null\n" +
 33162  			"                     │   └─ cn.id:12!null\n" +
 33163  			"                     ├─ InnerJoin\n" +
 33164  			"                     │   ├─ Eq\n" +
 33165  			"                     │   │   ├─ ci.movie_id:8!null\n" +
 33166  			"                     │   │   └─ mc.movie_id:5!null\n" +
 33167  			"                     │   ├─ TableAlias(mc)\n" +
 33168  			"                     │   │   └─ ProcessTable\n" +
 33169  			"                     │   │       └─ Table\n" +
 33170  			"                     │   │           ├─ name: movie_companies\n" +
 33171  			"                     │   │           └─ columns: [movie_id company_id]\n" +
 33172  			"                     │   └─ LookupJoin\n" +
 33173  			"                     │       ├─ TableAlias(ci)\n" +
 33174  			"                     │       │   └─ ProcessTable\n" +
 33175  			"                     │       │       └─ Table\n" +
 33176  			"                     │       │           ├─ name: cast_info\n" +
 33177  			"                     │       │           └─ columns: [person_id movie_id role_id]\n" +
 33178  			"                     │       └─ TableAlias(an1)\n" +
 33179  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33180  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33181  			"                     │               ├─ keys: [ci.person_id:7!null]\n" +
 33182  			"                     │               ├─ colSet: (1-8)\n" +
 33183  			"                     │               ├─ tableId: 1\n" +
 33184  			"                     │               └─ Table\n" +
 33185  			"                     │                   ├─ name: aka_name\n" +
 33186  			"                     │                   └─ columns: [person_id name]\n" +
 33187  			"                     └─ Filter\n" +
 33188  			"                         ├─ Eq\n" +
 33189  			"                         │   ├─ cn.country_code:1\n" +
 33190  			"                         │   └─ [us] (longtext)\n" +
 33191  			"                         └─ TableAlias(cn)\n" +
 33192  			"                             └─ ProcessTable\n" +
 33193  			"                                 └─ Table\n" +
 33194  			"                                     ├─ name: company_name\n" +
 33195  			"                                     └─ columns: [id country_code]\n" +
 33196  			"",
 33197  		ExpectedEstimates: "Project\n" +
 33198  			" ├─ columns: [min(an1.name) as costume_designer_pseudo, min(t.title) as movie_with_costumes]\n" +
 33199  			" └─ GroupBy\n" +
 33200  			"     ├─ SelectedExprs(MIN(an1.name), MIN(t.title))\n" +
 33201  			"     ├─ Grouping()\n" +
 33202  			"     └─ InnerJoin\n" +
 33203  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33204  			"         ├─ TableAlias(t)\n" +
 33205  			"         │   └─ Table\n" +
 33206  			"         │       ├─ name: title\n" +
 33207  			"         │       └─ columns: [id title]\n" +
 33208  			"         └─ InnerJoin\n" +
 33209  			"             ├─ (ci.role_id = rt.id)\n" +
 33210  			"             ├─ Filter\n" +
 33211  			"             │   ├─ (rt.role = 'costume designer')\n" +
 33212  			"             │   └─ TableAlias(rt)\n" +
 33213  			"             │       └─ Table\n" +
 33214  			"             │           ├─ name: role_type\n" +
 33215  			"             │           └─ columns: [id role]\n" +
 33216  			"             └─ InnerJoin\n" +
 33217  			"                 ├─ ((an1.person_id = n1.id) AND (n1.id = ci.person_id))\n" +
 33218  			"                 ├─ TableAlias(n1)\n" +
 33219  			"                 │   └─ Table\n" +
 33220  			"                 │       ├─ name: name\n" +
 33221  			"                 │       └─ columns: [id]\n" +
 33222  			"                 └─ InnerJoin\n" +
 33223  			"                     ├─ (mc.company_id = cn.id)\n" +
 33224  			"                     ├─ InnerJoin\n" +
 33225  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33226  			"                     │   ├─ TableAlias(mc)\n" +
 33227  			"                     │   │   └─ Table\n" +
 33228  			"                     │   │       ├─ name: movie_companies\n" +
 33229  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 33230  			"                     │   └─ LookupJoin\n" +
 33231  			"                     │       ├─ TableAlias(ci)\n" +
 33232  			"                     │       │   └─ Table\n" +
 33233  			"                     │       │       ├─ name: cast_info\n" +
 33234  			"                     │       │       └─ columns: [person_id movie_id role_id]\n" +
 33235  			"                     │       └─ TableAlias(an1)\n" +
 33236  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33237  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33238  			"                     │               ├─ columns: [person_id name]\n" +
 33239  			"                     │               └─ keys: ci.person_id\n" +
 33240  			"                     └─ Filter\n" +
 33241  			"                         ├─ (cn.country_code = '[us]')\n" +
 33242  			"                         └─ TableAlias(cn)\n" +
 33243  			"                             └─ Table\n" +
 33244  			"                                 ├─ name: company_name\n" +
 33245  			"                                 └─ columns: [id country_code]\n" +
 33246  			"",
 33247  		ExpectedAnalysis: "Project\n" +
 33248  			" ├─ columns: [min(an1.name) as costume_designer_pseudo, min(t.title) as movie_with_costumes]\n" +
 33249  			" └─ GroupBy\n" +
 33250  			"     ├─ SelectedExprs(MIN(an1.name), MIN(t.title))\n" +
 33251  			"     ├─ Grouping()\n" +
 33252  			"     └─ InnerJoin\n" +
 33253  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33254  			"         ├─ TableAlias(t)\n" +
 33255  			"         │   └─ Table\n" +
 33256  			"         │       ├─ name: title\n" +
 33257  			"         │       └─ columns: [id title]\n" +
 33258  			"         └─ InnerJoin\n" +
 33259  			"             ├─ (ci.role_id = rt.id)\n" +
 33260  			"             ├─ Filter\n" +
 33261  			"             │   ├─ (rt.role = 'costume designer')\n" +
 33262  			"             │   └─ TableAlias(rt)\n" +
 33263  			"             │       └─ Table\n" +
 33264  			"             │           ├─ name: role_type\n" +
 33265  			"             │           └─ columns: [id role]\n" +
 33266  			"             └─ InnerJoin\n" +
 33267  			"                 ├─ ((an1.person_id = n1.id) AND (n1.id = ci.person_id))\n" +
 33268  			"                 ├─ TableAlias(n1)\n" +
 33269  			"                 │   └─ Table\n" +
 33270  			"                 │       ├─ name: name\n" +
 33271  			"                 │       └─ columns: [id]\n" +
 33272  			"                 └─ InnerJoin\n" +
 33273  			"                     ├─ (mc.company_id = cn.id)\n" +
 33274  			"                     ├─ InnerJoin\n" +
 33275  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33276  			"                     │   ├─ TableAlias(mc)\n" +
 33277  			"                     │   │   └─ Table\n" +
 33278  			"                     │   │       ├─ name: movie_companies\n" +
 33279  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 33280  			"                     │   └─ LookupJoin\n" +
 33281  			"                     │       ├─ TableAlias(ci)\n" +
 33282  			"                     │       │   └─ Table\n" +
 33283  			"                     │       │       ├─ name: cast_info\n" +
 33284  			"                     │       │       └─ columns: [person_id movie_id role_id]\n" +
 33285  			"                     │       └─ TableAlias(an1)\n" +
 33286  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33287  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33288  			"                     │               ├─ columns: [person_id name]\n" +
 33289  			"                     │               └─ keys: ci.person_id\n" +
 33290  			"                     └─ Filter\n" +
 33291  			"                         ├─ (cn.country_code = '[us]')\n" +
 33292  			"                         └─ TableAlias(cn)\n" +
 33293  			"                             └─ Table\n" +
 33294  			"                                 ├─ name: company_name\n" +
 33295  			"                                 └─ columns: [id country_code]\n" +
 33296  			"",
 33297  	},
 33298  	{
 33299  		Query: `
 33300  SELECT MIN(an.name) AS alternative_name,
 33301         MIN(chn.name) AS character_name,
 33302         MIN(t.title) AS movie
 33303  FROM aka_name AS an,
 33304       char_name AS chn,
 33305       cast_info AS ci,
 33306       company_name AS cn,
 33307       movie_companies AS mc,
 33308       name AS n,
 33309       role_type AS rt,
 33310       title AS t
 33311  WHERE ci.note IN ('(voice)',
 33312                    '(voice: Japanese version)',
 33313                    '(voice) (uncredited)',
 33314                    '(voice: English version)')
 33315    AND cn.country_code ='[us]'
 33316    AND mc.note IS NOT NULL
 33317    AND (mc.note LIKE '%(USA)%'
 33318         OR mc.note LIKE '%(worldwide)%')
 33319    AND n.gender ='f'
 33320    AND n.name LIKE '%Ang%'
 33321    AND rt.role ='actress'
 33322    AND t.production_year BETWEEN 2005 AND 2015
 33323    AND ci.movie_id = t.id
 33324    AND t.id = mc.movie_id
 33325    AND ci.movie_id = mc.movie_id
 33326    AND mc.company_id = cn.id
 33327    AND ci.role_id = rt.id
 33328    AND n.id = ci.person_id
 33329    AND chn.id = ci.person_role_id
 33330    AND an.person_id = n.id
 33331    AND an.person_id = ci.person_id;
 33332  
 33333  `,
 33334  		ExpectedPlan: "Project\n" +
 33335  			" ├─ columns: [min(an.name):0!null as alternative_name, min(chn.name):1!null as character_name, min(t.title):2!null as movie]\n" +
 33336  			" └─ GroupBy\n" +
 33337  			"     ├─ select: MIN(an.name:19!null), MIN(chn.name:17!null), MIN(t.title:1!null)\n" +
 33338  			"     ├─ group: \n" +
 33339  			"     └─ InnerJoin\n" +
 33340  			"         ├─ AND\n" +
 33341  			"         │   ├─ Eq\n" +
 33342  			"         │   │   ├─ ci.movie_id:12!null\n" +
 33343  			"         │   │   └─ t.id:0!null\n" +
 33344  			"         │   └─ Eq\n" +
 33345  			"         │       ├─ t.id:0!null\n" +
 33346  			"         │       └─ mc.movie_id:8!null\n" +
 33347  			"         ├─ Filter\n" +
 33348  			"         │   ├─ AND\n" +
 33349  			"         │   │   ├─ GreaterThanOrEqual\n" +
 33350  			"         │   │   │   ├─ t.production_year:2\n" +
 33351  			"         │   │   │   └─ 2005 (smallint)\n" +
 33352  			"         │   │   └─ LessThanOrEqual\n" +
 33353  			"         │   │       ├─ t.production_year:2\n" +
 33354  			"         │   │       └─ 2015 (smallint)\n" +
 33355  			"         │   └─ TableAlias(t)\n" +
 33356  			"         │       └─ ProcessTable\n" +
 33357  			"         │           └─ Table\n" +
 33358  			"         │               ├─ name: title\n" +
 33359  			"         │               └─ columns: [id title production_year]\n" +
 33360  			"         └─ InnerJoin\n" +
 33361  			"             ├─ Eq\n" +
 33362  			"             │   ├─ ci.role_id:15!null\n" +
 33363  			"             │   └─ rt.id:3!null\n" +
 33364  			"             ├─ Filter\n" +
 33365  			"             │   ├─ Eq\n" +
 33366  			"             │   │   ├─ rt.role:1!null\n" +
 33367  			"             │   │   └─ actress (longtext)\n" +
 33368  			"             │   └─ TableAlias(rt)\n" +
 33369  			"             │       └─ ProcessTable\n" +
 33370  			"             │           └─ Table\n" +
 33371  			"             │               ├─ name: role_type\n" +
 33372  			"             │               └─ columns: [id role]\n" +
 33373  			"             └─ InnerJoin\n" +
 33374  			"                 ├─ AND\n" +
 33375  			"                 │   ├─ Eq\n" +
 33376  			"                 │   │   ├─ n.id:5!null\n" +
 33377  			"                 │   │   └─ ci.person_id:11!null\n" +
 33378  			"                 │   └─ Eq\n" +
 33379  			"                 │       ├─ an.person_id:18!null\n" +
 33380  			"                 │       └─ n.id:5!null\n" +
 33381  			"                 ├─ Filter\n" +
 33382  			"                 │   ├─ AND\n" +
 33383  			"                 │   │   ├─ Eq\n" +
 33384  			"                 │   │   │   ├─ n.gender:2\n" +
 33385  			"                 │   │   │   └─ f (longtext)\n" +
 33386  			"                 │   │   └─ n.name LIKE '%Ang%'\n" +
 33387  			"                 │   └─ TableAlias(n)\n" +
 33388  			"                 │       └─ ProcessTable\n" +
 33389  			"                 │           └─ Table\n" +
 33390  			"                 │               ├─ name: name\n" +
 33391  			"                 │               └─ columns: [id name gender]\n" +
 33392  			"                 └─ InnerJoin\n" +
 33393  			"                     ├─ Eq\n" +
 33394  			"                     │   ├─ mc.company_id:9!null\n" +
 33395  			"                     │   └─ cn.id:20!null\n" +
 33396  			"                     ├─ InnerJoin\n" +
 33397  			"                     │   ├─ Eq\n" +
 33398  			"                     │   │   ├─ ci.movie_id:12!null\n" +
 33399  			"                     │   │   └─ mc.movie_id:8!null\n" +
 33400  			"                     │   ├─ Filter\n" +
 33401  			"                     │   │   ├─ AND\n" +
 33402  			"                     │   │   │   ├─ NOT\n" +
 33403  			"                     │   │   │   │   └─ mc.note:2 IS NULL\n" +
 33404  			"                     │   │   │   └─ Or\n" +
 33405  			"                     │   │   │       ├─ mc.note LIKE '%(USA)%'\n" +
 33406  			"                     │   │   │       └─ mc.note LIKE '%(worldwide)%'\n" +
 33407  			"                     │   │   └─ TableAlias(mc)\n" +
 33408  			"                     │   │       └─ ProcessTable\n" +
 33409  			"                     │   │           └─ Table\n" +
 33410  			"                     │   │               ├─ name: movie_companies\n" +
 33411  			"                     │   │               └─ columns: [movie_id company_id note]\n" +
 33412  			"                     │   └─ LookupJoin\n" +
 33413  			"                     │       ├─ InnerJoin\n" +
 33414  			"                     │       │   ├─ Eq\n" +
 33415  			"                     │       │   │   ├─ chn.id:16!null\n" +
 33416  			"                     │       │   │   └─ ci.person_role_id:13\n" +
 33417  			"                     │       │   ├─ Filter\n" +
 33418  			"                     │       │   │   ├─ HashIn\n" +
 33419  			"                     │       │   │   │   ├─ ci.note:3\n" +
 33420  			"                     │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 33421  			"                     │       │   │   └─ TableAlias(ci)\n" +
 33422  			"                     │       │   │       └─ ProcessTable\n" +
 33423  			"                     │       │   │           └─ Table\n" +
 33424  			"                     │       │   │               ├─ name: cast_info\n" +
 33425  			"                     │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 33426  			"                     │       │   └─ TableAlias(chn)\n" +
 33427  			"                     │       │       └─ ProcessTable\n" +
 33428  			"                     │       │           └─ Table\n" +
 33429  			"                     │       │               ├─ name: char_name\n" +
 33430  			"                     │       │               └─ columns: [id name]\n" +
 33431  			"                     │       └─ TableAlias(an)\n" +
 33432  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33433  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33434  			"                     │               ├─ keys: [ci.person_id:11!null]\n" +
 33435  			"                     │               ├─ colSet: (1-8)\n" +
 33436  			"                     │               ├─ tableId: 1\n" +
 33437  			"                     │               └─ Table\n" +
 33438  			"                     │                   ├─ name: aka_name\n" +
 33439  			"                     │                   └─ columns: [person_id name]\n" +
 33440  			"                     └─ Filter\n" +
 33441  			"                         ├─ Eq\n" +
 33442  			"                         │   ├─ cn.country_code:1\n" +
 33443  			"                         │   └─ [us] (longtext)\n" +
 33444  			"                         └─ TableAlias(cn)\n" +
 33445  			"                             └─ ProcessTable\n" +
 33446  			"                                 └─ Table\n" +
 33447  			"                                     ├─ name: company_name\n" +
 33448  			"                                     └─ columns: [id country_code]\n" +
 33449  			"",
 33450  		ExpectedEstimates: "Project\n" +
 33451  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as character_name, min(t.title) as movie]\n" +
 33452  			" └─ GroupBy\n" +
 33453  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(t.title))\n" +
 33454  			"     ├─ Grouping()\n" +
 33455  			"     └─ InnerJoin\n" +
 33456  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33457  			"         ├─ Filter\n" +
 33458  			"         │   ├─ ((t.production_year >= 2005) AND (t.production_year <= 2015))\n" +
 33459  			"         │   └─ TableAlias(t)\n" +
 33460  			"         │       └─ Table\n" +
 33461  			"         │           ├─ name: title\n" +
 33462  			"         │           └─ columns: [id title production_year]\n" +
 33463  			"         └─ InnerJoin\n" +
 33464  			"             ├─ (ci.role_id = rt.id)\n" +
 33465  			"             ├─ Filter\n" +
 33466  			"             │   ├─ (rt.role = 'actress')\n" +
 33467  			"             │   └─ TableAlias(rt)\n" +
 33468  			"             │       └─ Table\n" +
 33469  			"             │           ├─ name: role_type\n" +
 33470  			"             │           └─ columns: [id role]\n" +
 33471  			"             └─ InnerJoin\n" +
 33472  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 33473  			"                 ├─ Filter\n" +
 33474  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Ang%')\n" +
 33475  			"                 │   └─ TableAlias(n)\n" +
 33476  			"                 │       └─ Table\n" +
 33477  			"                 │           ├─ name: name\n" +
 33478  			"                 │           └─ columns: [id name gender]\n" +
 33479  			"                 └─ InnerJoin\n" +
 33480  			"                     ├─ (mc.company_id = cn.id)\n" +
 33481  			"                     ├─ InnerJoin\n" +
 33482  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33483  			"                     │   ├─ Filter\n" +
 33484  			"                     │   │   ├─ ((NOT(mc.note IS NULL)) AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
 33485  			"                     │   │   └─ TableAlias(mc)\n" +
 33486  			"                     │   │       └─ Table\n" +
 33487  			"                     │   │           ├─ name: movie_companies\n" +
 33488  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 33489  			"                     │   └─ LookupJoin\n" +
 33490  			"                     │       ├─ InnerJoin\n" +
 33491  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 33492  			"                     │       │   ├─ Filter\n" +
 33493  			"                     │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 33494  			"                     │       │   │   └─ TableAlias(ci)\n" +
 33495  			"                     │       │   │       └─ Table\n" +
 33496  			"                     │       │   │           ├─ name: cast_info\n" +
 33497  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 33498  			"                     │       │   └─ TableAlias(chn)\n" +
 33499  			"                     │       │       └─ Table\n" +
 33500  			"                     │       │           ├─ name: char_name\n" +
 33501  			"                     │       │           └─ columns: [id name]\n" +
 33502  			"                     │       └─ TableAlias(an)\n" +
 33503  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33504  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33505  			"                     │               ├─ columns: [person_id name]\n" +
 33506  			"                     │               └─ keys: ci.person_id\n" +
 33507  			"                     └─ Filter\n" +
 33508  			"                         ├─ (cn.country_code = '[us]')\n" +
 33509  			"                         └─ TableAlias(cn)\n" +
 33510  			"                             └─ Table\n" +
 33511  			"                                 ├─ name: company_name\n" +
 33512  			"                                 └─ columns: [id country_code]\n" +
 33513  			"",
 33514  		ExpectedAnalysis: "Project\n" +
 33515  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as character_name, min(t.title) as movie]\n" +
 33516  			" └─ GroupBy\n" +
 33517  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(t.title))\n" +
 33518  			"     ├─ Grouping()\n" +
 33519  			"     └─ InnerJoin\n" +
 33520  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33521  			"         ├─ Filter\n" +
 33522  			"         │   ├─ ((t.production_year >= 2005) AND (t.production_year <= 2015))\n" +
 33523  			"         │   └─ TableAlias(t)\n" +
 33524  			"         │       └─ Table\n" +
 33525  			"         │           ├─ name: title\n" +
 33526  			"         │           └─ columns: [id title production_year]\n" +
 33527  			"         └─ InnerJoin\n" +
 33528  			"             ├─ (ci.role_id = rt.id)\n" +
 33529  			"             ├─ Filter\n" +
 33530  			"             │   ├─ (rt.role = 'actress')\n" +
 33531  			"             │   └─ TableAlias(rt)\n" +
 33532  			"             │       └─ Table\n" +
 33533  			"             │           ├─ name: role_type\n" +
 33534  			"             │           └─ columns: [id role]\n" +
 33535  			"             └─ InnerJoin\n" +
 33536  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 33537  			"                 ├─ Filter\n" +
 33538  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Ang%')\n" +
 33539  			"                 │   └─ TableAlias(n)\n" +
 33540  			"                 │       └─ Table\n" +
 33541  			"                 │           ├─ name: name\n" +
 33542  			"                 │           └─ columns: [id name gender]\n" +
 33543  			"                 └─ InnerJoin\n" +
 33544  			"                     ├─ (mc.company_id = cn.id)\n" +
 33545  			"                     ├─ InnerJoin\n" +
 33546  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33547  			"                     │   ├─ Filter\n" +
 33548  			"                     │   │   ├─ ((NOT(mc.note IS NULL)) AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
 33549  			"                     │   │   └─ TableAlias(mc)\n" +
 33550  			"                     │   │       └─ Table\n" +
 33551  			"                     │   │           ├─ name: movie_companies\n" +
 33552  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 33553  			"                     │   └─ LookupJoin\n" +
 33554  			"                     │       ├─ InnerJoin\n" +
 33555  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 33556  			"                     │       │   ├─ Filter\n" +
 33557  			"                     │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 33558  			"                     │       │   │   └─ TableAlias(ci)\n" +
 33559  			"                     │       │   │       └─ Table\n" +
 33560  			"                     │       │   │           ├─ name: cast_info\n" +
 33561  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 33562  			"                     │       │   └─ TableAlias(chn)\n" +
 33563  			"                     │       │       └─ Table\n" +
 33564  			"                     │       │           ├─ name: char_name\n" +
 33565  			"                     │       │           └─ columns: [id name]\n" +
 33566  			"                     │       └─ TableAlias(an)\n" +
 33567  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33568  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33569  			"                     │               ├─ columns: [person_id name]\n" +
 33570  			"                     │               └─ keys: ci.person_id\n" +
 33571  			"                     └─ Filter\n" +
 33572  			"                         ├─ (cn.country_code = '[us]')\n" +
 33573  			"                         └─ TableAlias(cn)\n" +
 33574  			"                             └─ Table\n" +
 33575  			"                                 ├─ name: company_name\n" +
 33576  			"                                 └─ columns: [id country_code]\n" +
 33577  			"",
 33578  	},
 33579  	{
 33580  		Query: `
 33581  SELECT MIN(an.name) AS alternative_name,
 33582         MIN(chn.name) AS voiced_character,
 33583         MIN(n.name) AS voicing_actress,
 33584         MIN(t.title) AS american_movie
 33585  FROM aka_name AS an,
 33586       char_name AS chn,
 33587       cast_info AS ci,
 33588       company_name AS cn,
 33589       movie_companies AS mc,
 33590       name AS n,
 33591       role_type AS rt,
 33592       title AS t
 33593  WHERE ci.note = '(voice)'
 33594    AND cn.country_code ='[us]'
 33595    AND mc.note LIKE '%(200%)%'
 33596    AND (mc.note LIKE '%(USA)%'
 33597         OR mc.note LIKE '%(worldwide)%')
 33598    AND n.gender ='f'
 33599    AND n.name LIKE '%Angel%'
 33600    AND rt.role ='actress'
 33601    AND t.production_year BETWEEN 2007 AND 2010
 33602    AND ci.movie_id = t.id
 33603    AND t.id = mc.movie_id
 33604    AND ci.movie_id = mc.movie_id
 33605    AND mc.company_id = cn.id
 33606    AND ci.role_id = rt.id
 33607    AND n.id = ci.person_id
 33608    AND chn.id = ci.person_role_id
 33609    AND an.person_id = n.id
 33610    AND an.person_id = ci.person_id;
 33611  
 33612  `,
 33613  		ExpectedPlan: "Project\n" +
 33614  			" ├─ columns: [min(an.name):0!null as alternative_name, min(chn.name):1!null as voiced_character, min(n.name):2!null as voicing_actress, min(t.title):3!null as american_movie]\n" +
 33615  			" └─ GroupBy\n" +
 33616  			"     ├─ select: MIN(an.name:19!null), MIN(chn.name:17!null), MIN(n.name:6!null), MIN(t.title:1!null)\n" +
 33617  			"     ├─ group: \n" +
 33618  			"     └─ InnerJoin\n" +
 33619  			"         ├─ AND\n" +
 33620  			"         │   ├─ Eq\n" +
 33621  			"         │   │   ├─ ci.movie_id:12!null\n" +
 33622  			"         │   │   └─ t.id:0!null\n" +
 33623  			"         │   └─ Eq\n" +
 33624  			"         │       ├─ t.id:0!null\n" +
 33625  			"         │       └─ mc.movie_id:8!null\n" +
 33626  			"         ├─ Filter\n" +
 33627  			"         │   ├─ AND\n" +
 33628  			"         │   │   ├─ GreaterThanOrEqual\n" +
 33629  			"         │   │   │   ├─ t.production_year:2\n" +
 33630  			"         │   │   │   └─ 2007 (smallint)\n" +
 33631  			"         │   │   └─ LessThanOrEqual\n" +
 33632  			"         │   │       ├─ t.production_year:2\n" +
 33633  			"         │   │       └─ 2010 (smallint)\n" +
 33634  			"         │   └─ TableAlias(t)\n" +
 33635  			"         │       └─ ProcessTable\n" +
 33636  			"         │           └─ Table\n" +
 33637  			"         │               ├─ name: title\n" +
 33638  			"         │               └─ columns: [id title production_year]\n" +
 33639  			"         └─ InnerJoin\n" +
 33640  			"             ├─ Eq\n" +
 33641  			"             │   ├─ ci.role_id:15!null\n" +
 33642  			"             │   └─ rt.id:3!null\n" +
 33643  			"             ├─ Filter\n" +
 33644  			"             │   ├─ Eq\n" +
 33645  			"             │   │   ├─ rt.role:1!null\n" +
 33646  			"             │   │   └─ actress (longtext)\n" +
 33647  			"             │   └─ TableAlias(rt)\n" +
 33648  			"             │       └─ ProcessTable\n" +
 33649  			"             │           └─ Table\n" +
 33650  			"             │               ├─ name: role_type\n" +
 33651  			"             │               └─ columns: [id role]\n" +
 33652  			"             └─ InnerJoin\n" +
 33653  			"                 ├─ AND\n" +
 33654  			"                 │   ├─ Eq\n" +
 33655  			"                 │   │   ├─ n.id:5!null\n" +
 33656  			"                 │   │   └─ ci.person_id:11!null\n" +
 33657  			"                 │   └─ Eq\n" +
 33658  			"                 │       ├─ an.person_id:18!null\n" +
 33659  			"                 │       └─ n.id:5!null\n" +
 33660  			"                 ├─ Filter\n" +
 33661  			"                 │   ├─ AND\n" +
 33662  			"                 │   │   ├─ Eq\n" +
 33663  			"                 │   │   │   ├─ n.gender:2\n" +
 33664  			"                 │   │   │   └─ f (longtext)\n" +
 33665  			"                 │   │   └─ n.name LIKE '%Angel%'\n" +
 33666  			"                 │   └─ TableAlias(n)\n" +
 33667  			"                 │       └─ ProcessTable\n" +
 33668  			"                 │           └─ Table\n" +
 33669  			"                 │               ├─ name: name\n" +
 33670  			"                 │               └─ columns: [id name gender]\n" +
 33671  			"                 └─ InnerJoin\n" +
 33672  			"                     ├─ Eq\n" +
 33673  			"                     │   ├─ mc.company_id:9!null\n" +
 33674  			"                     │   └─ cn.id:20!null\n" +
 33675  			"                     ├─ InnerJoin\n" +
 33676  			"                     │   ├─ Eq\n" +
 33677  			"                     │   │   ├─ ci.movie_id:12!null\n" +
 33678  			"                     │   │   └─ mc.movie_id:8!null\n" +
 33679  			"                     │   ├─ Filter\n" +
 33680  			"                     │   │   ├─ AND\n" +
 33681  			"                     │   │   │   ├─ mc.note LIKE '%(200%)%'\n" +
 33682  			"                     │   │   │   └─ Or\n" +
 33683  			"                     │   │   │       ├─ mc.note LIKE '%(USA)%'\n" +
 33684  			"                     │   │   │       └─ mc.note LIKE '%(worldwide)%'\n" +
 33685  			"                     │   │   └─ TableAlias(mc)\n" +
 33686  			"                     │   │       └─ ProcessTable\n" +
 33687  			"                     │   │           └─ Table\n" +
 33688  			"                     │   │               ├─ name: movie_companies\n" +
 33689  			"                     │   │               └─ columns: [movie_id company_id note]\n" +
 33690  			"                     │   └─ LookupJoin\n" +
 33691  			"                     │       ├─ InnerJoin\n" +
 33692  			"                     │       │   ├─ Eq\n" +
 33693  			"                     │       │   │   ├─ chn.id:16!null\n" +
 33694  			"                     │       │   │   └─ ci.person_role_id:13\n" +
 33695  			"                     │       │   ├─ Filter\n" +
 33696  			"                     │       │   │   ├─ Eq\n" +
 33697  			"                     │       │   │   │   ├─ ci.note:3\n" +
 33698  			"                     │       │   │   │   └─ (voice) (longtext)\n" +
 33699  			"                     │       │   │   └─ TableAlias(ci)\n" +
 33700  			"                     │       │   │       └─ ProcessTable\n" +
 33701  			"                     │       │   │           └─ Table\n" +
 33702  			"                     │       │   │               ├─ name: cast_info\n" +
 33703  			"                     │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 33704  			"                     │       │   └─ TableAlias(chn)\n" +
 33705  			"                     │       │       └─ ProcessTable\n" +
 33706  			"                     │       │           └─ Table\n" +
 33707  			"                     │       │               ├─ name: char_name\n" +
 33708  			"                     │       │               └─ columns: [id name]\n" +
 33709  			"                     │       └─ TableAlias(an)\n" +
 33710  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33711  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33712  			"                     │               ├─ keys: [ci.person_id:11!null]\n" +
 33713  			"                     │               ├─ colSet: (1-8)\n" +
 33714  			"                     │               ├─ tableId: 1\n" +
 33715  			"                     │               └─ Table\n" +
 33716  			"                     │                   ├─ name: aka_name\n" +
 33717  			"                     │                   └─ columns: [person_id name]\n" +
 33718  			"                     └─ Filter\n" +
 33719  			"                         ├─ Eq\n" +
 33720  			"                         │   ├─ cn.country_code:1\n" +
 33721  			"                         │   └─ [us] (longtext)\n" +
 33722  			"                         └─ TableAlias(cn)\n" +
 33723  			"                             └─ ProcessTable\n" +
 33724  			"                                 └─ Table\n" +
 33725  			"                                     ├─ name: company_name\n" +
 33726  			"                                     └─ columns: [id country_code]\n" +
 33727  			"",
 33728  		ExpectedEstimates: "Project\n" +
 33729  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as voiced_character, min(n.name) as voicing_actress, min(t.title) as american_movie]\n" +
 33730  			" └─ GroupBy\n" +
 33731  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 33732  			"     ├─ Grouping()\n" +
 33733  			"     └─ InnerJoin\n" +
 33734  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33735  			"         ├─ Filter\n" +
 33736  			"         │   ├─ ((t.production_year >= 2007) AND (t.production_year <= 2010))\n" +
 33737  			"         │   └─ TableAlias(t)\n" +
 33738  			"         │       └─ Table\n" +
 33739  			"         │           ├─ name: title\n" +
 33740  			"         │           └─ columns: [id title production_year]\n" +
 33741  			"         └─ InnerJoin\n" +
 33742  			"             ├─ (ci.role_id = rt.id)\n" +
 33743  			"             ├─ Filter\n" +
 33744  			"             │   ├─ (rt.role = 'actress')\n" +
 33745  			"             │   └─ TableAlias(rt)\n" +
 33746  			"             │       └─ Table\n" +
 33747  			"             │           ├─ name: role_type\n" +
 33748  			"             │           └─ columns: [id role]\n" +
 33749  			"             └─ InnerJoin\n" +
 33750  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 33751  			"                 ├─ Filter\n" +
 33752  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Angel%')\n" +
 33753  			"                 │   └─ TableAlias(n)\n" +
 33754  			"                 │       └─ Table\n" +
 33755  			"                 │           ├─ name: name\n" +
 33756  			"                 │           └─ columns: [id name gender]\n" +
 33757  			"                 └─ InnerJoin\n" +
 33758  			"                     ├─ (mc.company_id = cn.id)\n" +
 33759  			"                     ├─ InnerJoin\n" +
 33760  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33761  			"                     │   ├─ Filter\n" +
 33762  			"                     │   │   ├─ (mc.note LIKE '%(200%)%' AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
 33763  			"                     │   │   └─ TableAlias(mc)\n" +
 33764  			"                     │   │       └─ Table\n" +
 33765  			"                     │   │           ├─ name: movie_companies\n" +
 33766  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 33767  			"                     │   └─ LookupJoin\n" +
 33768  			"                     │       ├─ InnerJoin\n" +
 33769  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 33770  			"                     │       │   ├─ Filter\n" +
 33771  			"                     │       │   │   ├─ (ci.note = '(voice)')\n" +
 33772  			"                     │       │   │   └─ TableAlias(ci)\n" +
 33773  			"                     │       │   │       └─ Table\n" +
 33774  			"                     │       │   │           ├─ name: cast_info\n" +
 33775  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 33776  			"                     │       │   └─ TableAlias(chn)\n" +
 33777  			"                     │       │       └─ Table\n" +
 33778  			"                     │       │           ├─ name: char_name\n" +
 33779  			"                     │       │           └─ columns: [id name]\n" +
 33780  			"                     │       └─ TableAlias(an)\n" +
 33781  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33782  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33783  			"                     │               ├─ columns: [person_id name]\n" +
 33784  			"                     │               └─ keys: ci.person_id\n" +
 33785  			"                     └─ Filter\n" +
 33786  			"                         ├─ (cn.country_code = '[us]')\n" +
 33787  			"                         └─ TableAlias(cn)\n" +
 33788  			"                             └─ Table\n" +
 33789  			"                                 ├─ name: company_name\n" +
 33790  			"                                 └─ columns: [id country_code]\n" +
 33791  			"",
 33792  		ExpectedAnalysis: "Project\n" +
 33793  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as voiced_character, min(n.name) as voicing_actress, min(t.title) as american_movie]\n" +
 33794  			" └─ GroupBy\n" +
 33795  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 33796  			"     ├─ Grouping()\n" +
 33797  			"     └─ InnerJoin\n" +
 33798  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33799  			"         ├─ Filter\n" +
 33800  			"         │   ├─ ((t.production_year >= 2007) AND (t.production_year <= 2010))\n" +
 33801  			"         │   └─ TableAlias(t)\n" +
 33802  			"         │       └─ Table\n" +
 33803  			"         │           ├─ name: title\n" +
 33804  			"         │           └─ columns: [id title production_year]\n" +
 33805  			"         └─ InnerJoin\n" +
 33806  			"             ├─ (ci.role_id = rt.id)\n" +
 33807  			"             ├─ Filter\n" +
 33808  			"             │   ├─ (rt.role = 'actress')\n" +
 33809  			"             │   └─ TableAlias(rt)\n" +
 33810  			"             │       └─ Table\n" +
 33811  			"             │           ├─ name: role_type\n" +
 33812  			"             │           └─ columns: [id role]\n" +
 33813  			"             └─ InnerJoin\n" +
 33814  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 33815  			"                 ├─ Filter\n" +
 33816  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%Angel%')\n" +
 33817  			"                 │   └─ TableAlias(n)\n" +
 33818  			"                 │       └─ Table\n" +
 33819  			"                 │           ├─ name: name\n" +
 33820  			"                 │           └─ columns: [id name gender]\n" +
 33821  			"                 └─ InnerJoin\n" +
 33822  			"                     ├─ (mc.company_id = cn.id)\n" +
 33823  			"                     ├─ InnerJoin\n" +
 33824  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 33825  			"                     │   ├─ Filter\n" +
 33826  			"                     │   │   ├─ (mc.note LIKE '%(200%)%' AND (mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%'))\n" +
 33827  			"                     │   │   └─ TableAlias(mc)\n" +
 33828  			"                     │   │       └─ Table\n" +
 33829  			"                     │   │           ├─ name: movie_companies\n" +
 33830  			"                     │   │           └─ columns: [movie_id company_id note]\n" +
 33831  			"                     │   └─ LookupJoin\n" +
 33832  			"                     │       ├─ InnerJoin\n" +
 33833  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 33834  			"                     │       │   ├─ Filter\n" +
 33835  			"                     │       │   │   ├─ (ci.note = '(voice)')\n" +
 33836  			"                     │       │   │   └─ TableAlias(ci)\n" +
 33837  			"                     │       │   │       └─ Table\n" +
 33838  			"                     │       │   │           ├─ name: cast_info\n" +
 33839  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 33840  			"                     │       │   └─ TableAlias(chn)\n" +
 33841  			"                     │       │       └─ Table\n" +
 33842  			"                     │       │           ├─ name: char_name\n" +
 33843  			"                     │       │           └─ columns: [id name]\n" +
 33844  			"                     │       └─ TableAlias(an)\n" +
 33845  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33846  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33847  			"                     │               ├─ columns: [person_id name]\n" +
 33848  			"                     │               └─ keys: ci.person_id\n" +
 33849  			"                     └─ Filter\n" +
 33850  			"                         ├─ (cn.country_code = '[us]')\n" +
 33851  			"                         └─ TableAlias(cn)\n" +
 33852  			"                             └─ Table\n" +
 33853  			"                                 ├─ name: company_name\n" +
 33854  			"                                 └─ columns: [id country_code]\n" +
 33855  			"",
 33856  	},
 33857  	{
 33858  		Query: `
 33859  SELECT MIN(an.name) AS alternative_name,
 33860         MIN(chn.name) AS voiced_character_name,
 33861         MIN(n.name) AS voicing_actress,
 33862         MIN(t.title) AS american_movie
 33863  FROM aka_name AS an,
 33864       char_name AS chn,
 33865       cast_info AS ci,
 33866       company_name AS cn,
 33867       movie_companies AS mc,
 33868       name AS n,
 33869       role_type AS rt,
 33870       title AS t
 33871  WHERE ci.note IN ('(voice)',
 33872                    '(voice: Japanese version)',
 33873                    '(voice) (uncredited)',
 33874                    '(voice: English version)')
 33875    AND cn.country_code ='[us]'
 33876    AND n.gender ='f'
 33877    AND n.name LIKE '%An%'
 33878    AND rt.role ='actress'
 33879    AND ci.movie_id = t.id
 33880    AND t.id = mc.movie_id
 33881    AND ci.movie_id = mc.movie_id
 33882    AND mc.company_id = cn.id
 33883    AND ci.role_id = rt.id
 33884    AND n.id = ci.person_id
 33885    AND chn.id = ci.person_role_id
 33886    AND an.person_id = n.id
 33887    AND an.person_id = ci.person_id;
 33888  
 33889  `,
 33890  		ExpectedPlan: "Project\n" +
 33891  			" ├─ columns: [min(an.name):0!null as alternative_name, min(chn.name):1!null as voiced_character_name, min(n.name):2!null as voicing_actress, min(t.title):3!null as american_movie]\n" +
 33892  			" └─ GroupBy\n" +
 33893  			"     ├─ select: MIN(an.name:17!null), MIN(chn.name:15!null), MIN(n.name:5!null), MIN(t.title:1!null)\n" +
 33894  			"     ├─ group: \n" +
 33895  			"     └─ InnerJoin\n" +
 33896  			"         ├─ AND\n" +
 33897  			"         │   ├─ Eq\n" +
 33898  			"         │   │   ├─ ci.movie_id:10!null\n" +
 33899  			"         │   │   └─ t.id:0!null\n" +
 33900  			"         │   └─ Eq\n" +
 33901  			"         │       ├─ t.id:0!null\n" +
 33902  			"         │       └─ mc.movie_id:7!null\n" +
 33903  			"         ├─ TableAlias(t)\n" +
 33904  			"         │   └─ ProcessTable\n" +
 33905  			"         │       └─ Table\n" +
 33906  			"         │           ├─ name: title\n" +
 33907  			"         │           └─ columns: [id title]\n" +
 33908  			"         └─ InnerJoin\n" +
 33909  			"             ├─ Eq\n" +
 33910  			"             │   ├─ ci.role_id:13!null\n" +
 33911  			"             │   └─ rt.id:2!null\n" +
 33912  			"             ├─ Filter\n" +
 33913  			"             │   ├─ Eq\n" +
 33914  			"             │   │   ├─ rt.role:1!null\n" +
 33915  			"             │   │   └─ actress (longtext)\n" +
 33916  			"             │   └─ TableAlias(rt)\n" +
 33917  			"             │       └─ ProcessTable\n" +
 33918  			"             │           └─ Table\n" +
 33919  			"             │               ├─ name: role_type\n" +
 33920  			"             │               └─ columns: [id role]\n" +
 33921  			"             └─ InnerJoin\n" +
 33922  			"                 ├─ AND\n" +
 33923  			"                 │   ├─ Eq\n" +
 33924  			"                 │   │   ├─ n.id:4!null\n" +
 33925  			"                 │   │   └─ ci.person_id:9!null\n" +
 33926  			"                 │   └─ Eq\n" +
 33927  			"                 │       ├─ an.person_id:16!null\n" +
 33928  			"                 │       └─ n.id:4!null\n" +
 33929  			"                 ├─ Filter\n" +
 33930  			"                 │   ├─ AND\n" +
 33931  			"                 │   │   ├─ Eq\n" +
 33932  			"                 │   │   │   ├─ n.gender:2\n" +
 33933  			"                 │   │   │   └─ f (longtext)\n" +
 33934  			"                 │   │   └─ n.name LIKE '%An%'\n" +
 33935  			"                 │   └─ TableAlias(n)\n" +
 33936  			"                 │       └─ ProcessTable\n" +
 33937  			"                 │           └─ Table\n" +
 33938  			"                 │               ├─ name: name\n" +
 33939  			"                 │               └─ columns: [id name gender]\n" +
 33940  			"                 └─ InnerJoin\n" +
 33941  			"                     ├─ Eq\n" +
 33942  			"                     │   ├─ mc.company_id:8!null\n" +
 33943  			"                     │   └─ cn.id:18!null\n" +
 33944  			"                     ├─ InnerJoin\n" +
 33945  			"                     │   ├─ Eq\n" +
 33946  			"                     │   │   ├─ ci.movie_id:10!null\n" +
 33947  			"                     │   │   └─ mc.movie_id:7!null\n" +
 33948  			"                     │   ├─ TableAlias(mc)\n" +
 33949  			"                     │   │   └─ ProcessTable\n" +
 33950  			"                     │   │       └─ Table\n" +
 33951  			"                     │   │           ├─ name: movie_companies\n" +
 33952  			"                     │   │           └─ columns: [movie_id company_id]\n" +
 33953  			"                     │   └─ LookupJoin\n" +
 33954  			"                     │       ├─ InnerJoin\n" +
 33955  			"                     │       │   ├─ Eq\n" +
 33956  			"                     │       │   │   ├─ chn.id:14!null\n" +
 33957  			"                     │       │   │   └─ ci.person_role_id:11\n" +
 33958  			"                     │       │   ├─ Filter\n" +
 33959  			"                     │       │   │   ├─ HashIn\n" +
 33960  			"                     │       │   │   │   ├─ ci.note:3\n" +
 33961  			"                     │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 33962  			"                     │       │   │   └─ TableAlias(ci)\n" +
 33963  			"                     │       │   │       └─ ProcessTable\n" +
 33964  			"                     │       │   │           └─ Table\n" +
 33965  			"                     │       │   │               ├─ name: cast_info\n" +
 33966  			"                     │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 33967  			"                     │       │   └─ TableAlias(chn)\n" +
 33968  			"                     │       │       └─ ProcessTable\n" +
 33969  			"                     │       │           └─ Table\n" +
 33970  			"                     │       │               ├─ name: char_name\n" +
 33971  			"                     │       │               └─ columns: [id name]\n" +
 33972  			"                     │       └─ TableAlias(an)\n" +
 33973  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 33974  			"                     │               ├─ index: [aka_name.person_id]\n" +
 33975  			"                     │               ├─ keys: [ci.person_id:9!null]\n" +
 33976  			"                     │               ├─ colSet: (1-8)\n" +
 33977  			"                     │               ├─ tableId: 1\n" +
 33978  			"                     │               └─ Table\n" +
 33979  			"                     │                   ├─ name: aka_name\n" +
 33980  			"                     │                   └─ columns: [person_id name]\n" +
 33981  			"                     └─ Filter\n" +
 33982  			"                         ├─ Eq\n" +
 33983  			"                         │   ├─ cn.country_code:1\n" +
 33984  			"                         │   └─ [us] (longtext)\n" +
 33985  			"                         └─ TableAlias(cn)\n" +
 33986  			"                             └─ ProcessTable\n" +
 33987  			"                                 └─ Table\n" +
 33988  			"                                     ├─ name: company_name\n" +
 33989  			"                                     └─ columns: [id country_code]\n" +
 33990  			"",
 33991  		ExpectedEstimates: "Project\n" +
 33992  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as voiced_character_name, min(n.name) as voicing_actress, min(t.title) as american_movie]\n" +
 33993  			" └─ GroupBy\n" +
 33994  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 33995  			"     ├─ Grouping()\n" +
 33996  			"     └─ InnerJoin\n" +
 33997  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 33998  			"         ├─ TableAlias(t)\n" +
 33999  			"         │   └─ Table\n" +
 34000  			"         │       ├─ name: title\n" +
 34001  			"         │       └─ columns: [id title]\n" +
 34002  			"         └─ InnerJoin\n" +
 34003  			"             ├─ (ci.role_id = rt.id)\n" +
 34004  			"             ├─ Filter\n" +
 34005  			"             │   ├─ (rt.role = 'actress')\n" +
 34006  			"             │   └─ TableAlias(rt)\n" +
 34007  			"             │       └─ Table\n" +
 34008  			"             │           ├─ name: role_type\n" +
 34009  			"             │           └─ columns: [id role]\n" +
 34010  			"             └─ InnerJoin\n" +
 34011  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 34012  			"                 ├─ Filter\n" +
 34013  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 34014  			"                 │   └─ TableAlias(n)\n" +
 34015  			"                 │       └─ Table\n" +
 34016  			"                 │           ├─ name: name\n" +
 34017  			"                 │           └─ columns: [id name gender]\n" +
 34018  			"                 └─ InnerJoin\n" +
 34019  			"                     ├─ (mc.company_id = cn.id)\n" +
 34020  			"                     ├─ InnerJoin\n" +
 34021  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 34022  			"                     │   ├─ TableAlias(mc)\n" +
 34023  			"                     │   │   └─ Table\n" +
 34024  			"                     │   │       ├─ name: movie_companies\n" +
 34025  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 34026  			"                     │   └─ LookupJoin\n" +
 34027  			"                     │       ├─ InnerJoin\n" +
 34028  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 34029  			"                     │       │   ├─ Filter\n" +
 34030  			"                     │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 34031  			"                     │       │   │   └─ TableAlias(ci)\n" +
 34032  			"                     │       │   │       └─ Table\n" +
 34033  			"                     │       │   │           ├─ name: cast_info\n" +
 34034  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 34035  			"                     │       │   └─ TableAlias(chn)\n" +
 34036  			"                     │       │       └─ Table\n" +
 34037  			"                     │       │           ├─ name: char_name\n" +
 34038  			"                     │       │           └─ columns: [id name]\n" +
 34039  			"                     │       └─ TableAlias(an)\n" +
 34040  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 34041  			"                     │               ├─ index: [aka_name.person_id]\n" +
 34042  			"                     │               ├─ columns: [person_id name]\n" +
 34043  			"                     │               └─ keys: ci.person_id\n" +
 34044  			"                     └─ Filter\n" +
 34045  			"                         ├─ (cn.country_code = '[us]')\n" +
 34046  			"                         └─ TableAlias(cn)\n" +
 34047  			"                             └─ Table\n" +
 34048  			"                                 ├─ name: company_name\n" +
 34049  			"                                 └─ columns: [id country_code]\n" +
 34050  			"",
 34051  		ExpectedAnalysis: "Project\n" +
 34052  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as voiced_character_name, min(n.name) as voicing_actress, min(t.title) as american_movie]\n" +
 34053  			" └─ GroupBy\n" +
 34054  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 34055  			"     ├─ Grouping()\n" +
 34056  			"     └─ InnerJoin\n" +
 34057  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 34058  			"         ├─ TableAlias(t)\n" +
 34059  			"         │   └─ Table\n" +
 34060  			"         │       ├─ name: title\n" +
 34061  			"         │       └─ columns: [id title]\n" +
 34062  			"         └─ InnerJoin\n" +
 34063  			"             ├─ (ci.role_id = rt.id)\n" +
 34064  			"             ├─ Filter\n" +
 34065  			"             │   ├─ (rt.role = 'actress')\n" +
 34066  			"             │   └─ TableAlias(rt)\n" +
 34067  			"             │       └─ Table\n" +
 34068  			"             │           ├─ name: role_type\n" +
 34069  			"             │           └─ columns: [id role]\n" +
 34070  			"             └─ InnerJoin\n" +
 34071  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 34072  			"                 ├─ Filter\n" +
 34073  			"                 │   ├─ ((n.gender = 'f') AND n.name LIKE '%An%')\n" +
 34074  			"                 │   └─ TableAlias(n)\n" +
 34075  			"                 │       └─ Table\n" +
 34076  			"                 │           ├─ name: name\n" +
 34077  			"                 │           └─ columns: [id name gender]\n" +
 34078  			"                 └─ InnerJoin\n" +
 34079  			"                     ├─ (mc.company_id = cn.id)\n" +
 34080  			"                     ├─ InnerJoin\n" +
 34081  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 34082  			"                     │   ├─ TableAlias(mc)\n" +
 34083  			"                     │   │   └─ Table\n" +
 34084  			"                     │   │       ├─ name: movie_companies\n" +
 34085  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 34086  			"                     │   └─ LookupJoin\n" +
 34087  			"                     │       ├─ InnerJoin\n" +
 34088  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 34089  			"                     │       │   ├─ Filter\n" +
 34090  			"                     │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 34091  			"                     │       │   │   └─ TableAlias(ci)\n" +
 34092  			"                     │       │   │       └─ Table\n" +
 34093  			"                     │       │   │           ├─ name: cast_info\n" +
 34094  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 34095  			"                     │       │   └─ TableAlias(chn)\n" +
 34096  			"                     │       │       └─ Table\n" +
 34097  			"                     │       │           ├─ name: char_name\n" +
 34098  			"                     │       │           └─ columns: [id name]\n" +
 34099  			"                     │       └─ TableAlias(an)\n" +
 34100  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 34101  			"                     │               ├─ index: [aka_name.person_id]\n" +
 34102  			"                     │               ├─ columns: [person_id name]\n" +
 34103  			"                     │               └─ keys: ci.person_id\n" +
 34104  			"                     └─ Filter\n" +
 34105  			"                         ├─ (cn.country_code = '[us]')\n" +
 34106  			"                         └─ TableAlias(cn)\n" +
 34107  			"                             └─ Table\n" +
 34108  			"                                 ├─ name: company_name\n" +
 34109  			"                                 └─ columns: [id country_code]\n" +
 34110  			"",
 34111  	},
 34112  	{
 34113  		Query: `
 34114  SELECT MIN(an.name) AS alternative_name,
 34115         MIN(chn.name) AS voiced_char_name,
 34116         MIN(n.name) AS voicing_actress,
 34117         MIN(t.title) AS american_movie
 34118  FROM aka_name AS an,
 34119       char_name AS chn,
 34120       cast_info AS ci,
 34121       company_name AS cn,
 34122       movie_companies AS mc,
 34123       name AS n,
 34124       role_type AS rt,
 34125       title AS t
 34126  WHERE ci.note IN ('(voice)',
 34127                    '(voice: Japanese version)',
 34128                    '(voice) (uncredited)',
 34129                    '(voice: English version)')
 34130    AND cn.country_code ='[us]'
 34131    AND n.gender ='f'
 34132    AND rt.role ='actress'
 34133    AND ci.movie_id = t.id
 34134    AND t.id = mc.movie_id
 34135    AND ci.movie_id = mc.movie_id
 34136    AND mc.company_id = cn.id
 34137    AND ci.role_id = rt.id
 34138    AND n.id = ci.person_id
 34139    AND chn.id = ci.person_role_id
 34140    AND an.person_id = n.id
 34141    AND an.person_id = ci.person_id;
 34142  
 34143  `,
 34144  		ExpectedPlan: "Project\n" +
 34145  			" ├─ columns: [min(an.name):0!null as alternative_name, min(chn.name):1!null as voiced_char_name, min(n.name):2!null as voicing_actress, min(t.title):3!null as american_movie]\n" +
 34146  			" └─ GroupBy\n" +
 34147  			"     ├─ select: MIN(an.name:17!null), MIN(chn.name:15!null), MIN(n.name:5!null), MIN(t.title:1!null)\n" +
 34148  			"     ├─ group: \n" +
 34149  			"     └─ InnerJoin\n" +
 34150  			"         ├─ AND\n" +
 34151  			"         │   ├─ Eq\n" +
 34152  			"         │   │   ├─ ci.movie_id:10!null\n" +
 34153  			"         │   │   └─ t.id:0!null\n" +
 34154  			"         │   └─ Eq\n" +
 34155  			"         │       ├─ t.id:0!null\n" +
 34156  			"         │       └─ mc.movie_id:7!null\n" +
 34157  			"         ├─ TableAlias(t)\n" +
 34158  			"         │   └─ ProcessTable\n" +
 34159  			"         │       └─ Table\n" +
 34160  			"         │           ├─ name: title\n" +
 34161  			"         │           └─ columns: [id title]\n" +
 34162  			"         └─ InnerJoin\n" +
 34163  			"             ├─ Eq\n" +
 34164  			"             │   ├─ ci.role_id:13!null\n" +
 34165  			"             │   └─ rt.id:2!null\n" +
 34166  			"             ├─ Filter\n" +
 34167  			"             │   ├─ Eq\n" +
 34168  			"             │   │   ├─ rt.role:1!null\n" +
 34169  			"             │   │   └─ actress (longtext)\n" +
 34170  			"             │   └─ TableAlias(rt)\n" +
 34171  			"             │       └─ ProcessTable\n" +
 34172  			"             │           └─ Table\n" +
 34173  			"             │               ├─ name: role_type\n" +
 34174  			"             │               └─ columns: [id role]\n" +
 34175  			"             └─ InnerJoin\n" +
 34176  			"                 ├─ AND\n" +
 34177  			"                 │   ├─ Eq\n" +
 34178  			"                 │   │   ├─ n.id:4!null\n" +
 34179  			"                 │   │   └─ ci.person_id:9!null\n" +
 34180  			"                 │   └─ Eq\n" +
 34181  			"                 │       ├─ an.person_id:16!null\n" +
 34182  			"                 │       └─ n.id:4!null\n" +
 34183  			"                 ├─ Filter\n" +
 34184  			"                 │   ├─ Eq\n" +
 34185  			"                 │   │   ├─ n.gender:2\n" +
 34186  			"                 │   │   └─ f (longtext)\n" +
 34187  			"                 │   └─ TableAlias(n)\n" +
 34188  			"                 │       └─ ProcessTable\n" +
 34189  			"                 │           └─ Table\n" +
 34190  			"                 │               ├─ name: name\n" +
 34191  			"                 │               └─ columns: [id name gender]\n" +
 34192  			"                 └─ InnerJoin\n" +
 34193  			"                     ├─ Eq\n" +
 34194  			"                     │   ├─ mc.company_id:8!null\n" +
 34195  			"                     │   └─ cn.id:18!null\n" +
 34196  			"                     ├─ InnerJoin\n" +
 34197  			"                     │   ├─ Eq\n" +
 34198  			"                     │   │   ├─ ci.movie_id:10!null\n" +
 34199  			"                     │   │   └─ mc.movie_id:7!null\n" +
 34200  			"                     │   ├─ TableAlias(mc)\n" +
 34201  			"                     │   │   └─ ProcessTable\n" +
 34202  			"                     │   │       └─ Table\n" +
 34203  			"                     │   │           ├─ name: movie_companies\n" +
 34204  			"                     │   │           └─ columns: [movie_id company_id]\n" +
 34205  			"                     │   └─ LookupJoin\n" +
 34206  			"                     │       ├─ InnerJoin\n" +
 34207  			"                     │       │   ├─ Eq\n" +
 34208  			"                     │       │   │   ├─ chn.id:14!null\n" +
 34209  			"                     │       │   │   └─ ci.person_role_id:11\n" +
 34210  			"                     │       │   ├─ Filter\n" +
 34211  			"                     │       │   │   ├─ HashIn\n" +
 34212  			"                     │       │   │   │   ├─ ci.note:3\n" +
 34213  			"                     │       │   │   │   └─ TUPLE((voice) (longtext), (voice: Japanese version) (longtext), (voice) (uncredited) (longtext), (voice: English version) (longtext))\n" +
 34214  			"                     │       │   │   └─ TableAlias(ci)\n" +
 34215  			"                     │       │   │       └─ ProcessTable\n" +
 34216  			"                     │       │   │           └─ Table\n" +
 34217  			"                     │       │   │               ├─ name: cast_info\n" +
 34218  			"                     │       │   │               └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 34219  			"                     │       │   └─ TableAlias(chn)\n" +
 34220  			"                     │       │       └─ ProcessTable\n" +
 34221  			"                     │       │           └─ Table\n" +
 34222  			"                     │       │               ├─ name: char_name\n" +
 34223  			"                     │       │               └─ columns: [id name]\n" +
 34224  			"                     │       └─ TableAlias(an)\n" +
 34225  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 34226  			"                     │               ├─ index: [aka_name.person_id]\n" +
 34227  			"                     │               ├─ keys: [ci.person_id:9!null]\n" +
 34228  			"                     │               ├─ colSet: (1-8)\n" +
 34229  			"                     │               ├─ tableId: 1\n" +
 34230  			"                     │               └─ Table\n" +
 34231  			"                     │                   ├─ name: aka_name\n" +
 34232  			"                     │                   └─ columns: [person_id name]\n" +
 34233  			"                     └─ Filter\n" +
 34234  			"                         ├─ Eq\n" +
 34235  			"                         │   ├─ cn.country_code:1\n" +
 34236  			"                         │   └─ [us] (longtext)\n" +
 34237  			"                         └─ TableAlias(cn)\n" +
 34238  			"                             └─ ProcessTable\n" +
 34239  			"                                 └─ Table\n" +
 34240  			"                                     ├─ name: company_name\n" +
 34241  			"                                     └─ columns: [id country_code]\n" +
 34242  			"",
 34243  		ExpectedEstimates: "Project\n" +
 34244  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as voiced_char_name, min(n.name) as voicing_actress, min(t.title) as american_movie]\n" +
 34245  			" └─ GroupBy\n" +
 34246  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 34247  			"     ├─ Grouping()\n" +
 34248  			"     └─ InnerJoin\n" +
 34249  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 34250  			"         ├─ TableAlias(t)\n" +
 34251  			"         │   └─ Table\n" +
 34252  			"         │       ├─ name: title\n" +
 34253  			"         │       └─ columns: [id title]\n" +
 34254  			"         └─ InnerJoin\n" +
 34255  			"             ├─ (ci.role_id = rt.id)\n" +
 34256  			"             ├─ Filter\n" +
 34257  			"             │   ├─ (rt.role = 'actress')\n" +
 34258  			"             │   └─ TableAlias(rt)\n" +
 34259  			"             │       └─ Table\n" +
 34260  			"             │           ├─ name: role_type\n" +
 34261  			"             │           └─ columns: [id role]\n" +
 34262  			"             └─ InnerJoin\n" +
 34263  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 34264  			"                 ├─ Filter\n" +
 34265  			"                 │   ├─ (n.gender = 'f')\n" +
 34266  			"                 │   └─ TableAlias(n)\n" +
 34267  			"                 │       └─ Table\n" +
 34268  			"                 │           ├─ name: name\n" +
 34269  			"                 │           └─ columns: [id name gender]\n" +
 34270  			"                 └─ InnerJoin\n" +
 34271  			"                     ├─ (mc.company_id = cn.id)\n" +
 34272  			"                     ├─ InnerJoin\n" +
 34273  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 34274  			"                     │   ├─ TableAlias(mc)\n" +
 34275  			"                     │   │   └─ Table\n" +
 34276  			"                     │   │       ├─ name: movie_companies\n" +
 34277  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 34278  			"                     │   └─ LookupJoin\n" +
 34279  			"                     │       ├─ InnerJoin\n" +
 34280  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 34281  			"                     │       │   ├─ Filter\n" +
 34282  			"                     │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 34283  			"                     │       │   │   └─ TableAlias(ci)\n" +
 34284  			"                     │       │   │       └─ Table\n" +
 34285  			"                     │       │   │           ├─ name: cast_info\n" +
 34286  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 34287  			"                     │       │   └─ TableAlias(chn)\n" +
 34288  			"                     │       │       └─ Table\n" +
 34289  			"                     │       │           ├─ name: char_name\n" +
 34290  			"                     │       │           └─ columns: [id name]\n" +
 34291  			"                     │       └─ TableAlias(an)\n" +
 34292  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 34293  			"                     │               ├─ index: [aka_name.person_id]\n" +
 34294  			"                     │               ├─ columns: [person_id name]\n" +
 34295  			"                     │               └─ keys: ci.person_id\n" +
 34296  			"                     └─ Filter\n" +
 34297  			"                         ├─ (cn.country_code = '[us]')\n" +
 34298  			"                         └─ TableAlias(cn)\n" +
 34299  			"                             └─ Table\n" +
 34300  			"                                 ├─ name: company_name\n" +
 34301  			"                                 └─ columns: [id country_code]\n" +
 34302  			"",
 34303  		ExpectedAnalysis: "Project\n" +
 34304  			" ├─ columns: [min(an.name) as alternative_name, min(chn.name) as voiced_char_name, min(n.name) as voicing_actress, min(t.title) as american_movie]\n" +
 34305  			" └─ GroupBy\n" +
 34306  			"     ├─ SelectedExprs(MIN(an.name), MIN(chn.name), MIN(n.name), MIN(t.title))\n" +
 34307  			"     ├─ Grouping()\n" +
 34308  			"     └─ InnerJoin\n" +
 34309  			"         ├─ ((ci.movie_id = t.id) AND (t.id = mc.movie_id))\n" +
 34310  			"         ├─ TableAlias(t)\n" +
 34311  			"         │   └─ Table\n" +
 34312  			"         │       ├─ name: title\n" +
 34313  			"         │       └─ columns: [id title]\n" +
 34314  			"         └─ InnerJoin\n" +
 34315  			"             ├─ (ci.role_id = rt.id)\n" +
 34316  			"             ├─ Filter\n" +
 34317  			"             │   ├─ (rt.role = 'actress')\n" +
 34318  			"             │   └─ TableAlias(rt)\n" +
 34319  			"             │       └─ Table\n" +
 34320  			"             │           ├─ name: role_type\n" +
 34321  			"             │           └─ columns: [id role]\n" +
 34322  			"             └─ InnerJoin\n" +
 34323  			"                 ├─ ((n.id = ci.person_id) AND (an.person_id = n.id))\n" +
 34324  			"                 ├─ Filter\n" +
 34325  			"                 │   ├─ (n.gender = 'f')\n" +
 34326  			"                 │   └─ TableAlias(n)\n" +
 34327  			"                 │       └─ Table\n" +
 34328  			"                 │           ├─ name: name\n" +
 34329  			"                 │           └─ columns: [id name gender]\n" +
 34330  			"                 └─ InnerJoin\n" +
 34331  			"                     ├─ (mc.company_id = cn.id)\n" +
 34332  			"                     ├─ InnerJoin\n" +
 34333  			"                     │   ├─ (ci.movie_id = mc.movie_id)\n" +
 34334  			"                     │   ├─ TableAlias(mc)\n" +
 34335  			"                     │   │   └─ Table\n" +
 34336  			"                     │   │       ├─ name: movie_companies\n" +
 34337  			"                     │   │       └─ columns: [movie_id company_id]\n" +
 34338  			"                     │   └─ LookupJoin\n" +
 34339  			"                     │       ├─ InnerJoin\n" +
 34340  			"                     │       │   ├─ (chn.id = ci.person_role_id)\n" +
 34341  			"                     │       │   ├─ Filter\n" +
 34342  			"                     │       │   │   ├─ (ci.note HASH IN ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)', '(voice: English version)'))\n" +
 34343  			"                     │       │   │   └─ TableAlias(ci)\n" +
 34344  			"                     │       │   │       └─ Table\n" +
 34345  			"                     │       │   │           ├─ name: cast_info\n" +
 34346  			"                     │       │   │           └─ columns: [person_id movie_id person_role_id note role_id]\n" +
 34347  			"                     │       │   └─ TableAlias(chn)\n" +
 34348  			"                     │       │       └─ Table\n" +
 34349  			"                     │       │           ├─ name: char_name\n" +
 34350  			"                     │       │           └─ columns: [id name]\n" +
 34351  			"                     │       └─ TableAlias(an)\n" +
 34352  			"                     │           └─ IndexedTableAccess(aka_name)\n" +
 34353  			"                     │               ├─ index: [aka_name.person_id]\n" +
 34354  			"                     │               ├─ columns: [person_id name]\n" +
 34355  			"                     │               └─ keys: ci.person_id\n" +
 34356  			"                     └─ Filter\n" +
 34357  			"                         ├─ (cn.country_code = '[us]')\n" +
 34358  			"                         └─ TableAlias(cn)\n" +
 34359  			"                             └─ Table\n" +
 34360  			"                                 ├─ name: company_name\n" +
 34361  			"                                 └─ columns: [id country_code]\n" +
 34362  			"",
 34363  	},
 34364  }