Update of /cvsroot/monetdb/pathfinder/compiler/algebra/prop
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11089/algebra/prop
Modified Files:
prop_req_node.c prop_unq_names.c
Log Message:
-- First steps to get rid of bit-encoded column names:
o The planner and the MIL generation do not rely
on bit-encoded columns anymore.
o A global counter allows to assign new column names
without the need to analyze the plan before.
o Operator la_eqjoin_unq is only introduced in the
join pushdown phase and a normal eqjoin is available
for all other phases working on unique column names.
o Changed the required node optimization phase to cope
with unique column names.
U prop_unq_names.c
Index: prop_unq_names.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_unq_names.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- prop_unq_names.c 30 May 2008 09:41:44 -0000 1.34
+++ prop_unq_names.c 18 Jun 2008 11:24:29 -0000 1.35
@@ -108,9 +108,9 @@
* to the name pair list (@a np_list).
*/
static void
-new_name_pair (PFarray_t *np_list, PFalg_att_t ori, unsigned int id)
+new_name_pair (PFarray_t *np_list, PFalg_att_t ori)
{
- add_name_pair (np_list, ori, PFalg_unq_name (ori, id));
+ add_name_pair (np_list, ori, PFalg_unq_name (ori));
}
/**
@@ -135,8 +135,8 @@
/**
* Infer unique name properties; worker for prop_infer().
*/
-static unsigned int
-infer_unq_names (PFla_op_t *n, unsigned int id)
+static void
+infer_unq_names (PFla_op_t *n)
{
PFarray_t *np_list = n->prop->name_pairs;
@@ -154,12 +154,12 @@
case la_ref_tbl:
/* create new unique names for all attributes */
for (unsigned int i = 0; i < n->schema.count; i++)
- new_name_pair (np_list, n->schema.items[i].name, id++);
+ new_name_pair (np_list, n->schema.items[i].name);
break;
case la_attach:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.attach.res, id++);
+ new_name_pair (np_list, n->sem.attach.res);
break;
case la_cross:
@@ -198,7 +198,7 @@
unq = find_unq_name (np_list, ori_prev);
else
/* no match */
- unq = PFalg_unq_name (ori, id++);
+ unq = PFalg_unq_name (ori);
add_name_pair (np_list, ori, unq);
add_name_pair (left_np_list, ori, child_unq);
@@ -216,7 +216,7 @@
unq = find_unq_name (np_list, ori_prev);
else
/* no match */
- unq = PFalg_unq_name (ori, id++);
+ unq = PFalg_unq_name (ori);
add_name_pair (np_list, ori, unq);
add_name_pair (right_np_list, ori, child_unq);
@@ -273,12 +273,12 @@
unq = find_unq_name (np_list, ori_prev);
else
/* no match */
- unq = PFalg_unq_name (ori, id++);
+ unq = PFalg_unq_name (ori);
add_name_pair (np_list, ori, unq);
}
else if (child_unq == att2_unq)
- add_name_pair (np_list, ori, PFalg_unq_name (ori, id++));
+ add_name_pair (np_list, ori, PFalg_unq_name (ori));
else
add_name_pair (np_list, ori, child_unq);
@@ -304,12 +304,12 @@
unq = find_unq_name (np_list, ori_prev);
else
/* no match */
- unq = PFalg_unq_name (ori, id++);
+ unq = PFalg_unq_name (ori);
add_name_pair (np_list, ori, unq);
}
else if (child_unq == att1_unq)
- add_name_pair (np_list, ori, PFalg_unq_name (ori, id++));
+ add_name_pair (np_list, ori, PFalg_unq_name (ori));
else
add_name_pair (np_list, ori, child_unq);
@@ -376,7 +376,7 @@
unq = l_unq;
else
*/
- unq = PFalg_unq_name (ori, id++);
+ unq = PFalg_unq_name (ori);
add_name_pair (np_list, ori, unq);
add_name_pair (n->prop->l_name_pairs, ori, l_unq);
@@ -386,7 +386,7 @@
case la_fun_1to1:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.fun_1to1.res, id++);
+ new_name_pair (np_list, n->sem.fun_1to1.res);
break;
case la_num_eq:
@@ -395,12 +395,12 @@
case la_bool_or:
case la_to:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.binary.res, id++);
+ new_name_pair (np_list, n->sem.binary.res);
break;
case la_bool_not:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.unary.res, id++);
+ new_name_pair (np_list, n->sem.unary.res);
break;
case la_avg:
@@ -410,7 +410,7 @@
case la_count:
case la_seqty1:
case la_all:
- new_name_pair (np_list, n->sem.aggr.res, id++);
+ new_name_pair (np_list, n->sem.aggr.res);
if (n->sem.aggr.part)
add_name_pair (np_list,
n->sem.aggr.part,
@@ -422,18 +422,18 @@
case la_rowrank:
case la_rank:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.sort.res, id++);
+ new_name_pair (np_list, n->sem.sort.res);
break;
case la_rowid:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.rowid.res, id++);
+ new_name_pair (np_list, n->sem.rowid.res);
break;
case la_type:
case la_cast:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.type.res, id++);
+ new_name_pair (np_list, n->sem.type.res);
break;
case la_type_assert:
@@ -446,28 +446,28 @@
n->sem.step.iter,
PFprop_unq_name (R(n)->prop,
n->sem.step.iter));
- new_name_pair (np_list, n->sem.step.item_res, id++);
+ new_name_pair (np_list, n->sem.step.item_res);
break;
case la_step_join:
case la_guide_step_join:
bulk_add_name_pairs (np_list, R(n));
- new_name_pair (np_list, n->sem.step.item_res, id++);
+ new_name_pair (np_list, n->sem.step.item_res);
break;
case la_doc_index_join:
bulk_add_name_pairs (np_list, R(n));
- new_name_pair (np_list, n->sem.doc_join.item_res, id++);
+ new_name_pair (np_list, n->sem.doc_join.item_res);
break;
case la_doc_tbl:
bulk_add_name_pairs (np_list, L(n));
- new_name_pair (np_list, n->sem.doc_tbl.res, id++);
+ new_name_pair (np_list, n->sem.doc_tbl.res);
break;
case la_doc_access:
bulk_add_name_pairs (np_list, R(n));
- new_name_pair (np_list, n->sem.doc_access.res, id++);
+ new_name_pair (np_list, n->sem.doc_access.res);
break;
case la_twig:
@@ -508,7 +508,7 @@
default:
break;
}
- new_name_pair (np_list, n->sem.iter_item.item, id++);
+ new_name_pair (np_list, n->sem.iter_item.item);
break;
case la_fcns:
@@ -530,7 +530,7 @@
n->sem.merge_adjacent.pos_res,
PFprop_unq_name (R(n)->prop,
n->sem.merge_adjacent.pos_in));
- new_name_pair (np_list, n->sem.merge_adjacent.item_res, id++);
+ new_name_pair (np_list, n->sem.merge_adjacent.item_res);
break;
case la_roots:
@@ -573,7 +573,7 @@
/* create new unique names for all attributes */
for (unsigned int i = 0; i < n->schema.count; i++)
- new_name_pair (np_list, n->schema.items[i].name, id++);
+ new_name_pair (np_list, n->schema.items[i].name);
break;
case la_rec_base:
@@ -583,7 +583,7 @@
case la_fun_call:
/* create new unique names for all attributes */
for (unsigned int i = 0; i < n->schema.count; i++)
- new_name_pair (np_list, n->schema.items[i].name, id++);
+ new_name_pair (np_list, n->schema.items[i].name);
break;
case la_fun_param:
@@ -600,7 +600,7 @@
n->sem.string_join.iter_res,
PFprop_unq_name (R(n)->prop,
n->sem.string_join.iter_sep));
- new_name_pair (np_list, n->sem.string_join.item_res, id++);
+ new_name_pair (np_list, n->sem.string_join.item_res);
break;
case la_cross_mvd:
@@ -617,7 +617,6 @@
bulk_add_name_pairs (np_list, L(n));
break;
}
- return id;
}
static void
@@ -635,20 +634,20 @@
}
/* forward declaration */
-static unsigned int
-prop_infer (PFla_op_t *n, unsigned int cur_col_id);
+static void
+prop_infer (PFla_op_t *n);
/* Helper function that walks through a recursion paramter list
and only calls the property inference for the seed expressions. */
-static unsigned int
-prop_infer_rec_seed (PFla_op_t *n, unsigned int cur_col_id)
+static void
+prop_infer_rec_seed (PFla_op_t *n)
{
switch (n->kind)
{
case la_rec_param:
/* infer the unique names of the arguments */
- cur_col_id = prop_infer_rec_seed (L(n), cur_col_id);
- cur_col_id = prop_infer_rec_seed (R(n), cur_col_id);
+ prop_infer_rec_seed (L(n));
+ prop_infer_rec_seed (R(n));
/* recursion parameters do not have properties */
reset_property (n);
@@ -656,12 +655,12 @@
case la_rec_arg:
/* infer the unique names of the seed */
- cur_col_id = prop_infer (L(n), cur_col_id);
+ prop_infer (L(n));
reset_property (n);
/* infer unique name columns */
- cur_col_id = infer_unq_names (n, cur_col_id);
+ infer_unq_names (n);
n->sem.rec_arg.base->bit_dag = true;
reset_property (n->sem.rec_arg.base);
@@ -686,26 +685,24 @@
n->kind);
break;
}
-
- return cur_col_id;
}
/* Helper function that walks through a recursion paramter list
and only calls the property inference for the recursion body. */
-static unsigned int
-prop_infer_rec_body (PFla_op_t *n, unsigned int cur_col_id)
+static void
+prop_infer_rec_body (PFla_op_t *n)
{
switch (n->kind)
{
case la_rec_param:
/* infer the unique names of the arguments */
- cur_col_id = prop_infer_rec_body (L(n), cur_col_id);
- cur_col_id = prop_infer_rec_body (R(n), cur_col_id);
+ prop_infer_rec_body (L(n));
+ prop_infer_rec_body (R(n));
break;
case la_rec_arg:
/* infer the unique names of the recursion body */
- cur_col_id = prop_infer (R(n), cur_col_id);
+ prop_infer (R(n));
/* The both inputs (seed and recursion) do not use
the same column names. Thus we live with inconsistent
@@ -725,12 +722,11 @@
}
n->bit_dag = true;
- return cur_col_id;
}
/* worker for PFprop_infer_unq_names */
-static unsigned int
-prop_infer (PFla_op_t *n, unsigned int cur_col_id)
+static void
+prop_infer (PFla_op_t *n)
{
bool bottom_up = true;
@@ -738,7 +734,7 @@
/* nothing to do if we already visited that node */
if (n->bit_dag)
- return cur_col_id;
+ return;
/* Make sure to first collect all seeds and adjust
the rec_base properties before inferring the properties
@@ -747,9 +743,9 @@
{
case la_rec_fix:
/* infer the unique names of the arguments */
- cur_col_id = prop_infer_rec_seed (L(n), cur_col_id);
- cur_col_id = prop_infer_rec_body (L(n), cur_col_id);
- cur_col_id = prop_infer (R(n), cur_col_id);
+ prop_infer_rec_seed (L(n));
+ prop_infer_rec_body (L(n));
+ prop_infer (R(n));
bottom_up = false;
break;
@@ -762,15 +758,13 @@
the fragment information is translated after the value part) */
for (unsigned int i = PFLA_OP_MAXCHILD; i > 0; i--)
if (n->child[i - 1])
- cur_col_id = prop_infer (n->child[i - 1], cur_col_id);
+ prop_infer (n->child[i - 1]);
n->bit_dag = true;
reset_property (n);
/* infer unique name columns */
- cur_col_id = infer_unq_names (n, cur_col_id);
-
- return cur_col_id;
+ infer_unq_names (n);
}
/**
@@ -783,7 +777,7 @@
a more useful eqjoin inference */
PFprop_infer_key (root);
- prop_infer (root, 1);
+ prop_infer (root);
PFla_dag_reset (root);
}
U prop_req_node.c
Index: prop_req_node.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_req_node.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- prop_req_node.c 10 Jun 2008 09:21:26 -0000 1.8
+++ prop_req_node.c 18 Jun 2008 11:24:29 -0000 1.9
@@ -766,7 +766,7 @@
map = find_map (MAP_LIST(n), att_item);
- /* inherit the properties of the iter column */
+ /* inherit the properties of the item column */
if (map) {
req_node_t map_item = *map;
map_item.col = n->sem.iter_pos_item.item;
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins