added selection_inside_projection
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@153 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
parent
9627500a21
commit
b3a9d98d24
@ -79,5 +79,28 @@ def down_to_unions_subtractions_intersections(n):
|
|||||||
changes+=down_to_unions_subtractions_intersections(n.left)
|
changes+=down_to_unions_subtractions_intersections(n.left)
|
||||||
return changes
|
return changes
|
||||||
|
|
||||||
|
def duplicated_projection(n):
|
||||||
|
'''This function locates thing like π i ( π j (R)) and replaces
|
||||||
|
them with π i (R)'''
|
||||||
|
changes=0
|
||||||
|
|
||||||
general_optimizations=[duplicated_select,down_to_unions_subtractions_intersections]
|
|
||||||
|
if n.name=='π' and n.child.name=='π':
|
||||||
|
n.child=n.child.child
|
||||||
|
changes+=1
|
||||||
|
|
||||||
|
#recoursive scan
|
||||||
|
if n.kind==optimizer.UNARY:
|
||||||
|
changes+=duplicated_projection(n.child)
|
||||||
|
elif n.kind==optimizer.BINARY:
|
||||||
|
changes+=duplicated_projection(n.right)
|
||||||
|
changes+=duplicated_projection(n.left)
|
||||||
|
return changes
|
||||||
|
|
||||||
|
def selection_inside_projection(n):
|
||||||
|
'''This function locates things like σ j (π k(R)) and
|
||||||
|
converts them into π k(σ j (R))'''
|
||||||
|
changes=0
|
||||||
|
return changes
|
||||||
|
|
||||||
|
general_optimizations=[duplicated_select,down_to_unions_subtractions_intersections,duplicated_projection,selection_inside_projection]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user