From 594914fe50878fabe38a229323c108ee50430eed Mon Sep 17 00:00:00 2001 From: Tom Papke Date: Mon, 27 Feb 2023 22:43:33 +0100 Subject: [PATCH 1/3] Update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 38e0425..9200716 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,5 @@ This repository contains: - A visualization tool for differences between normalized query plans, which makes use of the semantic diff algorithm (`npm run start`). You can try out the query plan visualizer at https://toemmsche.github.io/semantic-diff/. -For Umbra, HyPer, and DuckDB data from the TPC-H and TPC-DS benchmarks is preloaded. \ No newline at end of file + +Query plans for TPC-H and TPC-DS queries for the RDBMS Umbra, HyPer, and DuckDB are preloaded. \ No newline at end of file From b6fbe4dece9b26591f3dabd9e5f9f1abc7c3231a Mon Sep 17 00:00:00 2001 From: Tom Papke Date: Tue, 28 Feb 2023 20:14:11 +0100 Subject: [PATCH 2/3] Simplify delta tree generator unify/converge order --- .../delta/DeltaGraphGenerator.ts | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/semantic-diff/delta/DeltaGraphGenerator.ts b/src/semantic-diff/delta/DeltaGraphGenerator.ts index fe7c2d0..fe00b47 100644 --- a/src/semantic-diff/delta/DeltaGraphGenerator.ts +++ b/src/semantic-diff/delta/DeltaGraphGenerator.ts @@ -1,5 +1,4 @@ import TNode from '../tree/TNode'; -import ISemanticDiffOptions from '../diff/ISemanticDiffOptions'; export default class DeltaGraphGenerator { constructor() {} @@ -26,8 +25,7 @@ export default class DeltaGraphGenerator { const filteredMatchChildren = nextHigherMatch.children.filter((child) => { return ( // have to add any unmatched children - !child.getAdjacentLowerMatch() || - // or those that were moved between this and the next higher tree + !child.getAdjacentLowerMatch() || // or those that were moved between this and the next higher tree child.getAdjacentLowerMatch()!.getParent() != node ); }); @@ -59,27 +57,20 @@ export default class DeltaGraphGenerator { return trees[0]; } - // Turn tree into DAG by reusing nodes - this.converge(trees[trees.length - 1]); + // apply n - 1 converge() and unify() + for (let i = trees.length - 2; i >= 0; i--) { + const prev = trees[i + 1]; + const curr = trees[i]; - // do NOT use reverse since it modifies the array in-place - trees - .slice(1) - .reverse() - .slice(1) - .forEach((tree) => { - this.unify(tree); + this.converge(prev); + this.unify(curr); - // lower act index - tree.toPreOrderUnique().forEach((n) => { - // align working indices - n.workingIndex = tree.workingIndex; - }); - - this.converge(tree); + // lower act index + curr.toPreOrderUnique().forEach((n) => { + // align working indices + n.workingIndex = curr.workingIndex; }); - - this.unify(trees[0]); + } return trees[0]; } From 7ede7859ddc339cdb9a5076b21994ea78efb01a0 Mon Sep 17 00:00:00 2001 From: Tom Papke Date: Tue, 28 Feb 2023 22:33:28 +0100 Subject: [PATCH 3/3] Remove excess logging --- src/ui/components/graph/RenderGraph.ts | 2 -- src/ui/components/graph/dimensions/DocumentingRenderer.tsx | 2 -- src/ui/components/graph/dimensions/PreRenderDimensions.tsx | 1 - src/ui/components/graph/layout/RefreshLayout.tsx | 4 ---- 4 files changed, 9 deletions(-) diff --git a/src/ui/components/graph/RenderGraph.ts b/src/ui/components/graph/RenderGraph.ts index 37eedc4..7b68bea 100644 --- a/src/ui/components/graph/RenderGraph.ts +++ b/src/ui/components/graph/RenderGraph.ts @@ -19,8 +19,6 @@ export default function renderGraph( setEdges: (edges: Edge[]) => any, reactFlowInstance: ReactFlowInstance ) { - console.log('Rendering unified tree with dimensions', unifiedTree, dimensions); - const [normalizedNodes, normalizedEdges] = new DefaultNormalizer().normalize( unifiedTree, 0, diff --git a/src/ui/components/graph/dimensions/DocumentingRenderer.tsx b/src/ui/components/graph/dimensions/DocumentingRenderer.tsx index b15d0a9..e7c0011 100644 --- a/src/ui/components/graph/dimensions/DocumentingRenderer.tsx +++ b/src/ui/components/graph/dimensions/DocumentingRenderer.tsx @@ -36,8 +36,6 @@ export default class DocumentingRenderer extends React.Component< } componentDidUpdate() { - //console.log('render dimentor'); - // @ts-ignore this.props.callback( this.props.item, this.childRef.current!.clientWidth, diff --git a/src/ui/components/graph/dimensions/PreRenderDimensions.tsx b/src/ui/components/graph/dimensions/PreRenderDimensions.tsx index 38d5211..bf6eb88 100644 --- a/src/ui/components/graph/dimensions/PreRenderDimensions.tsx +++ b/src/ui/components/graph/dimensions/PreRenderDimensions.tsx @@ -64,7 +64,6 @@ export default function PreRenderDimensions(props: IPreRenderDimensionsProps) { ); useEffect(() => { - console.log('resetting dimensions due to new tree...', expandedNodes); setDimensions(new Map()); }, [unifiedTree, expandedNodes, collapsible, layouter]); diff --git a/src/ui/components/graph/layout/RefreshLayout.tsx b/src/ui/components/graph/layout/RefreshLayout.tsx index cec1ccc..86289a9 100644 --- a/src/ui/components/graph/layout/RefreshLayout.tsx +++ b/src/ui/components/graph/layout/RefreshLayout.tsx @@ -15,7 +15,6 @@ export interface INodeLayouterProps { export function fitLater(reactFlowInstance: ReactFlowInstance) { setTimeout(() => { - console.log('fitting to graph ... '); reactFlowInstance.fitView({ ...animationOptions, padding: 0.15 @@ -32,13 +31,10 @@ export default function RefreshLayout(props: INodeLayouterProps) { const nodeHasDimension = (node: Node) => node.width != null && node.height != null; function changeLayout() { - console.log('changing layout...'); - const internalNodes = new Array(...internalNodeState.entries()).map((entry) => { const [id, node] = entry; return node; }); - console.log('ACTUAL NODE DIMS', internalNodes); if (internalNodes.length > 0 && internalNodes.every(nodeHasDimension)) { const layoutNodes = layouter.treeLayout(internalNodes, edges, defaultTreeLayoutOptions); if (layoutNodes instanceof Promise) {