Github user karanmehta93 commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/410#discussion_r238896069
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixStatement.java ---
@@ -1774,11 +1778,20 @@ public QueryLogger
createQueryLogger(CompilableStatement stmt, String sql) throw
}
}
}
- QueryLogger queryLogger =
QueryLogger.getInstance(connection,isSystemTable);
- QueryLoggerUtil.logInitialDetails(queryLogger,
connection.getTenantId(),
+
+ QueryLogger queryLogger =
QueryLogger.createInstance(connection,isSystemTable,
+ isCriticalStatement(stmt));
+ QueryLoggerUtil.logInitialDetails(queryLogger,
connection.getTenantId(),
connection.getQueryServices(), sql, getParameters());
+ if (isCriticalStatement(stmt)) {
+ queryLogger.sync(null, null);
+ }
return queryLogger;
}
+
+ private boolean isCriticalStatement(CompilableStatement stmt) {
--- End diff --
On a second thought, How about logging every DML that is not a "Update
statement"?
It might be an overkill if we have people creating tons of views though,
but we could always drop those as well.
---