MCPcopy Index your code
hub / github.com/dbcli/pgcli / calculate_actuals

Method calculate_actuals

pgcli/pyev.py:112–125  ·  view source on GitHub ↗
(self, plan)

Source from the content-addressed store, hash-verified

110
111 #
112 def calculate_actuals(self, plan):
113 plan["Actual Duration"] = plan["Actual Total Time"]
114 plan["Actual Cost"] = plan["Total Cost"]
115
116 for child in plan.get("Plans", []):
117 if child["Node Type"] != "CTEScan":
118 plan["Actual Duration"] = plan["Actual Duration"] - child["Actual Total Time"]
119 plan["Actual Cost"] = plan["Actual Cost"] - child["Total Cost"]
120
121 if plan["Actual Cost"] < 0:
122 plan["Actual Cost"] = 0
123
124 plan["Actual Duration"] = plan["Actual Duration"] * plan["Actual Loops"]
125 return plan
126
127 def calculate_outlier_nodes(self, plan):
128 plan["Costliest"] = plan["Actual Cost"] == self.explain["Max Cost"]

Callers 1

process_planMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected