diff --git a/relational/optimizations.py b/relational/optimizations.py index 4c0c92b..9a877cf 100644 --- a/relational/optimizations.py +++ b/relational/optimizations.py @@ -257,7 +257,7 @@ def selection_and_product(n,rels): #TODO document in the wiki changes=0 - if n.name=='σ' and n.child.name=='*': + if n.name=='σ' and n.child.name in ('*','ᐅᐊ','ᐅLEFTᐊ','ᐅRIGHTᐊ','ᐅFULLᐊ'): l_attr=n.child.left.result_format(rels) r_attr=n.child.right.result_format(rels) @@ -354,7 +354,5 @@ def selection_and_product(n,rels): changes+=selection_and_product(n.left,rels) return changes - - general_optimizations=[duplicated_select,down_to_unions_subtractions_intersections,duplicated_projection,selection_inside_projection,subsequent_renames,swap_rename_select] specific_optimizations=[selection_and_product] \ No newline at end of file diff --git a/relational/optimizer.py b/relational/optimizer.py index 2cc6fe4..aa290e6 100644 --- a/relational/optimizer.py +++ b/relational/optimizer.py @@ -279,7 +279,7 @@ if __name__=="__main__": #n=tree("σ id==3 and indice==2 and name==5 or name<2(P1 * S1)") #print optimizations.selection_and_product(n,rels) - print specific_optimize("σ name==skill and age>21 and id==indice and skill=='C'(P1*S1)",rels) + print specific_optimize("σ name==skill and age>21 and id==indice and skill=='C'(P1ᐅᐊS1)",rels) #print n #print n.result_format(rels)