<h2 dir="auto">Feature Request</h2>
<h3 dir="auto">Is your feature request related to a problem?</h3>
<p dir="auto">Yes, sometimes. Scaling job on PostgreSQL, the fetched statements include: create table, drop index, create index.</p>
<h3 dir="auto">Describe the feature you would like.</h3>
<p dir="auto">Currently, scaling job will be sharded and run concurrently, include preparing target tables (create tables and constraints), so there might be duplicated tables and constraints creation, it might cause error. And there's some strange issue in ShardingSphereDataSource metadata when creating index just after creating table, it's still not resolved.</p>
<p dir="auto">Possible solution:<br>
Limit concurrency, make sure there's only one thread to do create tables and constraints at the same time, other threads should ignore creating tables and constraints. But it should support retry of creation in case of scaling job restarting.<br>
We could try <code class="notranslate">PipelineSimpleLock</code> for now.</p>
<h3 dir="auto">Which version of Sharding-Jdbc do you using?（您使用的Sharding-Jdbc版本为？）</h3>
<p dir="auto">2.0.3</p>
<h3 dir="auto">Expected behavior （您预期的结果是）</h3>
<p dir="auto">shardingjdbc datasource能否针对非路由的表，sql解析时不做兼容性检查</p>
<h3 dir="auto">Actual behavior （实际运行的结果是）</h3>
<p dir="auto">shardingjdbc datasource针对非路由的表，sql解析时会对不兼容的sql报错</p>
<h3 dir="auto">Steps to reproduce the behavior （可重现问题的操作步骤）</h3>
<p dir="auto">shardingjdbc datasource针对非路由的表，sql解析时会对不兼容的sql报错</p>
<h3 dir="auto">Please provide the reproduce example codes (such as github link)，otherwise we will label the issue as Invalid and close it.（为了节省复现问题的时间，请务必提供可重现的代码，否则我们会将issue直接标记为invalid并关闭）</h3>
<p dir="auto">shardingjdbc datasource能否针对非路由的表，sql解析时不做兼容性检查</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;select id=&quot;find&quot; resultMap=&quot;baseResultMap&quot;&gt;
        select * from t_order
        where count_date&gt;=#{from,jdbcType=TIMESTAMP}
        and count_date &amp;lt; #{to,jdbcType=TIMESTAMP}
        and (status is null or satus='FALSE')
    &lt;/select&gt;
 &lt;sharding:complex-strategy id=&quot;orderTableShardingStrategy&quot;  sharding-columns=&quot;id,count_date,systemflowid&quot; algorithm-class=&quot;io.shardingjdbc.exampleExt.spring.namespace.mybatis.algorithm.PreciseTableComplexShardingAlgorithm&quot;/&gt;
    &lt;sharding:none-strategy id=&quot;orderTableNoneShardingStrategy&quot; /&gt;"><pre class="notranslate">&lt;<span class="pl-ent">select</span> <span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>find<span class="pl-pds">"</span></span> <span class="pl-e">resultMap</span>=<span class="pl-s"><span class="pl-pds">"</span>baseResultMap<span class="pl-pds">"</span></span>&gt;
        select * from t_order
        where count_date&gt;=#{from,jdbcType=TIMESTAMP}
        and count_date <span class="pl-c1">&amp;lt;</span> #{to,jdbcType=TIMESTAMP}
        and (status is null or satus='FALSE')
    &lt;/<span class="pl-ent">select</span>&gt;
 &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">complex-strategy</span> <span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>orderTableShardingStrategy<span class="pl-pds">"</span></span>  <span class="pl-e">sharding-columns</span>=<span class="pl-s"><span class="pl-pds">"</span>id,count_date,systemflowid<span class="pl-pds">"</span></span> <span class="pl-e">algorithm-class</span>=<span class="pl-s"><span class="pl-pds">"</span>io.shardingjdbc.exampleExt.spring.namespace.mybatis.algorithm.PreciseTableComplexShardingAlgorithm<span class="pl-pds">"</span></span>/&gt;
    &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">none-strategy</span> <span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>orderTableNoneShardingStrategy<span class="pl-pds">"</span></span> /&gt;</pre></div>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    &lt;sharding:data-source id=&quot;shardingDataSource&quot;&gt;
        &lt;sharding:sharding-rule data-source-names=&quot;demo_ds4sharding&quot; default-data-source-name=&quot;demo_ds4sharding&quot; default-table-strategy-ref=&quot;orderTableNoneShardingStrategy&quot;&gt;
            &lt;sharding:table-rules&gt;
                &lt;sharding:table-rule logic-table=&quot;logic_t_order&quot; actual-data-nodes=&quot;demo_ds4sharding.t_order_${['2018','2019']}${['01','02','03','04','05','06','07','08','09','10','11','12']}&quot;
                                     table-strategy-ref=&quot;orderTableShardingStrategy&quot; /&gt;
            &lt;/sharding:table-rules&gt;
            &lt;sharding:binding-table-rules&gt;
                &lt;sharding:binding-table-rule logic-tables=&quot;logic_t_order&quot;/&gt;
                &lt;!--&lt;sharding:binding-table-rule logic-tables=&quot;t_order, t_order_item&quot;/&gt;--&gt;
            &lt;/sharding:binding-table-rules&gt;
        &lt;/sharding:sharding-rule&gt;
        &lt;sharding:props&gt;
            &lt;prop key=&quot;sql.show&quot;&gt;true&lt;/prop&gt;
        &lt;/sharding:props&gt;
    &lt;/sharding:data-source&gt;"><pre class="notranslate">    &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">data-source</span> <span class="pl-e">id</span>=<span class="pl-s"><span class="pl-pds">"</span>shardingDataSource<span class="pl-pds">"</span></span>&gt;
        &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">sharding-rule</span> <span class="pl-e">data-source-names</span>=<span class="pl-s"><span class="pl-pds">"</span>demo_ds4sharding<span class="pl-pds">"</span></span> <span class="pl-e">default-data-source-name</span>=<span class="pl-s"><span class="pl-pds">"</span>demo_ds4sharding<span class="pl-pds">"</span></span> <span class="pl-e">default-table-strategy-ref</span>=<span class="pl-s"><span class="pl-pds">"</span>orderTableNoneShardingStrategy<span class="pl-pds">"</span></span>&gt;
            &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">table-rules</span>&gt;
                &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">table-rule</span> <span class="pl-e">logic-table</span>=<span class="pl-s"><span class="pl-pds">"</span>logic_t_order<span class="pl-pds">"</span></span> <span class="pl-e">actual-data-nodes</span>=<span class="pl-s"><span class="pl-pds">"</span>demo_ds4sharding.t_order_${['2018','2019']}${['01','02','03','04','05','06','07','08','09','10','11','12']}<span class="pl-pds">"</span></span>
                                     <span class="pl-e">table-strategy-ref</span>=<span class="pl-s"><span class="pl-pds">"</span>orderTableShardingStrategy<span class="pl-pds">"</span></span> /&gt;
            &lt;/<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">table-rules</span>&gt;
            &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">binding-table-rules</span>&gt;
                &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">binding-table-rule</span> <span class="pl-e">logic-tables</span>=<span class="pl-s"><span class="pl-pds">"</span>logic_t_order<span class="pl-pds">"</span></span>/&gt;
                <span class="pl-c"><span class="pl-c">&lt;!--</span>&lt;sharding:binding-table-rule logic-tables="t_order, t_order_item"/&gt;<span class="pl-c">--&gt;</span></span>
            &lt;/<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">binding-table-rules</span>&gt;
        &lt;/<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">sharding-rule</span>&gt;
        &lt;<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">props</span>&gt;
            &lt;<span class="pl-ent">prop</span> <span class="pl-e">key</span>=<span class="pl-s"><span class="pl-pds">"</span>sql.show<span class="pl-pds">"</span></span>&gt;true&lt;/<span class="pl-ent">prop</span>&gt;
        &lt;/<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">props</span>&gt;
    &lt;/<span class="pl-ent">sharding</span><span class="pl-ent">:</span><span class="pl-ent">data-source</span>&gt;</pre></div>
<p dir="auto">Code should based on <a href="https://github.com/shardingjdbc/sharding-jdbc-example">https://github.com/shardingjdbc/sharding-jdbc-example</a><br>
（代码请基于 <a href="https://github.com/shardingjdbc/sharding-jdbc-example%EF%BC%89">https://github.com/shardingjdbc/sharding-jdbc-example）</a></p>