This is an automated email from the ASF dual-hosted git repository.

wanghailin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 51a3737578 Reduce the time cost of getCatalogTable in jdbc (#5908)
51a3737578 is described below

commit 51a3737578eb55472b11902985f242e4ac252d3a
Author: Wenjun Ruan <[email protected]>
AuthorDate: Thu Nov 23 22:51:47 2023 +0800

    Reduce the time cost of getCatalogTable in jdbc (#5908)
---
 .../connectors/seatunnel/jdbc/catalog/utils/CatalogUtils.java          | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/utils/CatalogUtils.java
 
b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/utils/CatalogUtils.java
index 1f35098eea..3f2264a120 100644
--- 
a/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/utils/CatalogUtils.java
+++ 
b/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/utils/CatalogUtils.java
@@ -134,13 +134,14 @@ public class CatalogUtils {
 
     public static List<ConstraintKey> getConstraintKeys(
             DatabaseMetaData metadata, TablePath tablePath) throws 
SQLException {
+        // We set approximate to true to avoid querying the statistics table, 
which is slow.
         ResultSet resultSet =
                 metadata.getIndexInfo(
                         tablePath.getDatabaseName(),
                         tablePath.getSchemaName(),
                         tablePath.getTableName(),
                         false,
-                        false);
+                        true);
         // index name -> index
         Map<String, ConstraintKey> constraintKeyMap = new HashMap<>();
         while (resultSet.next()) {

Reply via email to