INNER CODE UNIT · TypeScript
plan
bytebase/dbhub · src/connectors/oracle/index.ts:923
const plan = lines.map((row) => row.PLAN_TABLE_OUTPUT).join("\n");
return {
resultSets: [
{
rows: lines.length > 0 ? [{ plan }] : [],
rowCount: lines.length > 0 ? 1 : 0,
},
],
};
} catch (error) {
throw OracleConnector.wrapError("Failed to explain query", error);
} finally {
// PLAN_TABLE preserves rows for the session, and the session goes back
// to the pool: drop this plan so it cannot pile up or leak to a later
// caller. Best effort.
await closeQuietly(async () => {
await connection.execute("DELETE FROM plan_table WHERE statement_id = :id", { id: statementId });
await connection.commit();