You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/24 11:25:05 UTC

[GitHub] [shardingsphere] gzgzapp opened a new issue #12691: oracle getIndexInfo is slow

gzgzapp opened a new issue #12691:
URL: https://github.com/apache/shardingsphere/issues/12691


   
   ### Which version of ShardingSphere did you use?
   5.0.0-alpha
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   Start my app as soon as possible
   ### Actual behavior
   Load meta data for schema logic_db finished, cost 127788 milliseconds.
   ### Reason analyze (If you can)
   the method getIndexInfo() in jdbc has 5 param,the 5th param approximate, when true, result is allowed to reflect approximate or out of data values; when false, results are requested to be accurate,in the oracle jdbc implment, if approximate is false, it will analyze table compute statistics, the table records over 10 million,table compute statistics cost too much time,  DBAs have their own plans to analyze table compute statistics, so, the param approximate can configure in the rule configuration file?
   
   public static Collection<PhysicalIndexMetaData> load(final Connection connection, final String table) throws SQLException {
           Collection<PhysicalIndexMetaData> result = new HashSet<>();
           try (ResultSet resultSet = connection.getMetaData().getIndexInfo(connection.getCatalog(), connection.getSchema(), table, false, false)) {
               while (resultSet.next()) {
                   String indexName = resultSet.getString(INDEX_NAME);
                   if (null != indexName) {
                       result.add(new PhysicalIndexMetaData(indexName));
                   }
               }
           }
           return result;
       }
   
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #12691: oracle getIndexInfo is slow

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #12691:
URL: https://github.com/apache/shardingsphere/issues/12691#issuecomment-926555794


   Hi @gzgzapp, I am very happy to see that you use `5.0.0-alpha`. We also found the problem of slow metadata loading and optimize it in the master branch. Welcome to use the master branch for testing.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org