From d384a902cff1406df3dcd33b92932433d0bbfce5 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sun, 3 Jan 2016 12:36:39 +0100 Subject: [PATCH] Removed redundant check Assuming that the query is correct, the removed condition must always be true. --- relational/optimizations.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/relational/optimizations.py b/relational/optimizations.py index 5eb2320..e53b5e0 100644 --- a/relational/optimizations.py +++ b/relational/optimizations.py @@ -558,7 +558,6 @@ def projection_and_union(n, rels): if n.name in {UNION, INTERSECTION, DIFFERENCE} and \ n.left.name == PROJECTION and \ n.right.name == PROJECTION and \ - set(n.left.result_format(rels)) == set(n.right.result_format(rels)) and \ set(n.left.child.result_format(rels)) == set(n.right.child.result_format(rels)): newchild = parser.Node() @@ -577,7 +576,6 @@ def projection_and_union(n, rels): return changes + recoursive_scan(projection_and_union, n, rels) - def selection_and_product(n, rels): '''This function locates things like σ k (R*Q) and converts them into σ l (σ j (R) * σ i (Q)). Where j contains only attributes belonging to R,