List:Internals« Previous MessageNext Message »
From:Sanja Byelkin Date:May 17 2007 7:27am
Subject:Re: Subselect transformation engine question
View as plain text  
Hi!

On Tue, May 15, 2007 at 03:53:19PM -0600, Sasha Pachev wrote:
> Hello, MySQL hackers:
> 
> I noticed that during the sub-select transformation some extra stuff is
> being added in  to the where clause of some subselects that looks like this:
> 
> AND <no matter>.<left_expr> = col_name
> 
> <no matter>.<left_expr> is Item_direct_ref
> 
> The code in question is in Item_in_subselect::single_value_transformer()
> 
> and looks like this:
> 
> expr= new Item_direct_ref(&select_lex->context,
>                              (Item**)optimizer->get_cache(),
>                              (char *)"<no matter>",
>                              (char *)in_left_expr_name);
> 
> 
> Can somebody who knows that code elaborate on the purpose and the
> general idea of such
> transformations?

It is rewriting IN via EXISTS-like query. (there is description in
internals (maybe not up-to-date but you can get the idea).

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Oleksandr Byelkin <sanja@stripped>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Lugansk, Ukraine
       <___/   www.mysql.com
Thread
Subselect transformation engine questionSasha Pachev15 May
  • Re: Subselect transformation engine questionSanja Byelkin17 May
    • Re: Subselect transformation engine questionSasha Pachev20 May
      • Re: Subselect transformation engine questionSanja Byelkin21 May
        • Re: Subselect transformation engine questionSasha Pachev21 May
          • Re: Subselect transformation engine questionSanja Byelkin22 May