List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:December 23 2001 2:08am
Subject:Re: Cube operator in DataWarehousing
View as plain text  

>>>>> "Sinisa" == Sinisa Milivojevic <sinisa@stripped> writes:

Sinisa> On Fri, 21 Dec 2001 15:13:32 +0530 (IST)
Sinisa> Sri <lakshmi@stripped> wrote:

>> Could anyone please explain me how the group_list and item_list
>> are filled in while executing a select statement.
>> Thanking you in anticipation.
>> Srilakshmi.

Sinisa> Hi!

Sinisa> Take a look at add_item_to_list()  function.

To be a little more precise:

All group's are added added at this point in sql_yacc.yy:

	group_list ',' order_ident order_dir
	  { if (add_group_to_list($3,(bool) $4)) YYABORT; }
	| order_ident order_dir
	  { if (add_group_to_list($1,(bool) $2)) YYABORT; }

All lists are stored in the thd->lex structure, defined in
You can find all the MySQL specific list-adding functions like
add_group_to_list in
The list and iterators are defined in sql_list.h.

I would recommend you to start looking at sql_list.h to understand the
basic list functions (they are very simple).

For an example of how to create a GROUP BY list of items, take a look in at:

static ORDER *create_distinct_group(ORDER *order_list,List<Item> &fields)

After you got a grasp of how the lists and the items works, you should be
able to relatively easily implement CUBE, as you described in your
previous email.

Cube operator in DataWarehousingSri20 Dec
  • Re: Cube operator in DataWarehousingSri21 Dec
    • Re: Cube operator in DataWarehousingSinisa Milivojevic21 Dec
      • Re: Cube operator in DataWarehousingMichael Widenius23 Dec