optimizes over and over until the tree is stabilized
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@144 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
parent
88efcf0b78
commit
444d3f9987
@ -166,8 +166,11 @@ def general_optimize(expression):
|
|||||||
'''This function performs general optimizations. Means that it will not need to
|
'''This function performs general optimizations. Means that it will not need to
|
||||||
know the fields used by the relations'''
|
know the fields used by the relations'''
|
||||||
n=tree(expression) #Gets the tree
|
n=tree(expression) #Gets the tree
|
||||||
for i in optimizations.general_optimizations:
|
total=1
|
||||||
print "Changes done: ", i(n) #Performs the optimization
|
while total!=0:
|
||||||
|
total=0
|
||||||
|
for i in optimizations.general_optimizations:
|
||||||
|
total+=i(n) #Performs the optimization
|
||||||
return n.__str__()
|
return n.__str__()
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user