From 8393ca93d90d141964dce803ec50b72f7c57e14a Mon Sep 17 00:00:00 2001 From: LtWorf Date: Tue, 12 May 2009 14:48:44 +0000 Subject: [PATCH] extended selection_and_product to join git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@168 014f5005-505e-4b48-8d0a-63407b615a7c --- relational/optimizations.py | 4 +--- relational/optimizer.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) 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)