CrackerSuperior opened a new issue #13785:
URL: https://github.com/apache/shardingsphere/issues/13785


   Version:
     master
   
   Doubt:
     We noticed that in the "Federation" engine, "Calcite" is used, but 
"Calcite" is only used to "filter data". In cross-database related queries, 
"Calcite" is not used to optimize SQL, predicate pushdown, etc. , But very 
rudely to search all the records, and then use "Calcite" to filter the data, 
whether this is not very friendly to the table related query with a huge amount 
of data.
   
   config:
     ```yaml
      schemaName: druidtest
   
   dataSources:
     ds_0:
       url: 
jdbc:mysql://127.0.0.1:3306/druidtest_0?serverTimezone=UTC&useSSL=false&characterEncoding=utf-8
       username: pcloud
       password: pcloud
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: 
jdbc:mysql://127.0.0.1:3306/druidtest_1?serverTimezone=UTC&useSSL=false&characterEncoding=utf-8
       username: pcloud
       password: pcloud
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
     - !SHARDING
       tables:
         insert4:
           actualDataNodes: ds_${0..1}.insert4
           keyGenerateStrategy:
             column: sharding
             keyGeneratorName: snowflake
         insert5:
           actualDataNodes: ds_${0..1}.insert5
           keyGenerateStrategy:
             column: sharding
             keyGeneratorName: snowflake
           databaseStrategy:
             standard:
               shardingColumn: sharding
               shardingAlgorithmName: database_inline2
       defaultDatabaseStrategy:
         standard:
           shardingColumn: sharding
           shardingAlgorithmName: database_inline
       defaultTableStrategy:
         none:
   
       shardingAlgorithms:
         database_inline:
           type: INLINE
           props:
             algorithm-expression: ds_${sharding % 2}
         database_inline2:
           type: INLINE
           props:
             algorithm-expression: ds_${(sharding + 1) % 2}
   
       keyGenerators:
         snowflake:
           type: SNOWFLAKE
           props:
             worker-id: 123
   ```
   
   SQL:
     ``` sql
     SELECT * FROM insert4 o INNER JOIN insert5 i ON o.id = i.id WHERE i.id > 3;
   ```
   
   Actual execution of the storage node:
    
   
![image](https://user-images.githubusercontent.com/45088781/143364865-91fbce09-e81f-45ef-9ce4-2027943ffc98.png)
   
![image](https://user-images.githubusercontent.com/45088781/143364888-795fcf07-3bcb-484d-adc0-67105ca22bfb.png)
   


-- 
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