package com.cloudhandson.vpdbackoffice.domain.probe;

/**
 * Database shared-pool evidence for the statement most recently executed for
 * a protected object. The SQL text is the statement submitted by ORDS before
 * VPD rewrite; Oracle exposes the applied predicate through the cursor plan.
 */
public record SqlExecutionEvidence(
    String sqlId,
    int childNumber,
    String originalSql,
    String lastActiveAt,
    long executions,
    long rowsProcessed,
    long elapsedMillis,
    long bufferGets,
    String predicatePlan
) {

  public boolean hasPredicatePlan() {
    return predicatePlan != null && !predicatePlan.isBlank();
  }
}
