(self, sql)
| 162 | return 0 |
| 163 | |
| 164 | def pgsql_cost_estimation(self, sql): |
| 165 | try: |
| 166 | #success, res = self.execute_sql('explain (FORMAT JSON, analyze) ' + sql) |
| 167 | success, res = self.execute_sql('explain (FORMAT JSON) ' + sql) |
| 168 | if success == 1: |
| 169 | cost = res[0][0][0]['Plan']['Total Cost'] |
| 170 | return cost |
| 171 | else: |
| 172 | logging.error('pgsql_cost_estimation Fails!') |
| 173 | return 0 |
| 174 | except Exception as error: |
| 175 | logging.error('pgsql_cost_estimation Exception', error) |
| 176 | return 0 |
| 177 | |
| 178 | def pgsql_actual_time(self, sql): |
| 179 | try: |
no test coverage detected