extended selection_and_product to join
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@168 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
parent
dd15d6776b
commit
8393ca93d9
@ -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]
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user