loserwang1024 commented on code in PR #3929:
URL: https://github.com/apache/flink-cdc/pull/3929#discussion_r1992530246


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-postgres-cdc/src/main/java/org/apache/flink/cdc/connectors/postgres/source/utils/PostgresQueryUtils.java:
##########
@@ -69,12 +69,17 @@ public static long queryApproximateRowCnt(JdbcConnection 
jdbc, TableId tableId)
         // 
https://stackoverflow.com/questions/7943233/fast-way-to-discover-the-row-count-of-a-table-in-postgresql
         // NOTE: it requires ANALYZE or VACUUM to be run first in PostgreSQL.
         final String query =
-                String.format(
-                        "SELECT reltuples::bigint FROM pg_class WHERE oid = 
to_regclass('%s')",
-                        tableId.toString());
-
-        return jdbc.queryAndMap(
+                "SELECT reltuples::bigint"
+                        + " FROM pg_class c"
+                        + " JOIN pg_namespace n ON n.oid = c.relnamespace"

Review Comment:
   @morozov , what is the benefit of this modify?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to