if (duration > stmt->perf_metrics->slow_query_threshold_ms) QLOG_LOG(LOG_WARNING, "Slow query detected: %s (duration: %llu ms)", stmt->perf_metrics->last_query, duration);
void end_query_trace(StatementInfo_ *stmt) if (stmt->perf_metrics) stmt->perf_metrics->query_end_time = get_current_time_ms(); uint64_t duration = stmt->perf_metrics->query_end_time - stmt->perf_metrics->query_start_time; postgresql-odbc
int cache_prepared_statement(ConnectionInfo_ *ci, const char *name, const char *sql) StatementCacheEntry *entry = malloc(sizeof(StatementCacheEntry)); if (!entry) return -1; if (duration >
curr = curr->next;
return SQL_SUCCESS; Adding support for a PostgreSQL data type (e.g., JSONB with better handling): void end_query_trace(StatementInfo_ *stmt) if (stmt->
// Your implementation here // ...
statement_cache = entry; return 0;