Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add specific Mysql doExplainPlan function

  • Loading branch information...
commit f0c86731cb80774d188d55d53b17d4f025c50dc1 1 parent 03dda95
Denis Dalmais ddalmais authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 runtime/lib/adapter/DBMySQL.php
19 runtime/lib/adapter/DBMySQL.php
View
@@ -250,4 +250,23 @@ public function prepareParams($params)
return $params;
}
+
+ /**
+ * Do Explain Plan for criteria
+ *
+ * @param PropelPDO $con propel connection
+ * @param ModelCriteria $query query
+ * @throws PropelException
+ * @return PDOStatement A PDO statement executed using the connection, ready to be fetched
+ */
+ public function doExplainPlan(PropelPDO $con, ModelCriteria $query) {
+ $dbMap = Propel::getDatabaseMap($query->getDbName());
+ $params = array();
+ $sql = BasePeer::createSelectSql($query, $params);
+ $sql = 'EXPLAIN ' . $sql;
+ $stmt = $con->prepare($sql);
+ $this->bindValues($stmt, $params, $dbMap);
+ $stmt->execute();
+ return $stmt;
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.