xfyang1989 opened a new issue #3215: SQL execution is slow under sub-database 
sub-table
URL: https://github.com/apache/incubator-shardingsphere/issues/3215
 
 
   The following SQL sub-database sub-table query is very slow, nearly 1.5s, 
why? But it only takes a few milliseconds to execute in mysql.
   
   Ic_sku_channel_inventory unique 
index(`sku_code`,`warehouse_code`,`first_channel`,`second_channel`),
   
   `select id,first_channel, sku_code, 
version,second_channel,warehouse_code,warehouse_type, 
   inventory_num, normal_inventory_num, damage_inventory_num, locked_num, 
normal_locked_num, damage_locked_num, 
   transit_num,is_disable,is_deleted 
   from ic_sku_channel_inventory 
   where ( (sku_code in ( '1131378',
   '724351', 
   '724350', 
   '724595', 
   '724239', 
   '721764', 
   '721761', 
   '724358', 
   '719607', 
   '717306', 
   '717307', 
   '717305', 
   '723692', 
   '721192', 
   '721394',
   '723693', 
   '724544', 
   '721743', 
   '717299', 
   '719757', 
   '1134588', 
   '1134584', 
   '724334', 
   '721582', 
   '724298', 
   '1133778', 
   '721544', 
   '724335', 
   '724654', 
   '1145841', 
   '724606', 
   '724528', 
   '724605', 
   '717881', 
   '724526', 
   '724603', 
   '726788', 
   '724288', 
   '721411', 
   '724602', 
   '724601', 
   '724600', 
   '721377', 
   '724319', 
   '723427', 
   '724516', 
   '721007', 
   '721128', 
   '721766', 
   '721528')
            AND warehouse_code = 'jtwlhz' AND first_channel='909900' AND 
second_channel = '0' ) 
          or (sku_code in ( '721745' ) AND warehouse_code = 'jtwlhz' AND 
first_channel='909900' AND second_channel = '909902') );
   `
   
![AA7DCE78-5A00-4043-8636-1EC407E9138B](https://user-images.githubusercontent.com/25191518/66575472-8b8fc900-eba8-11e9-978a-d2324d1394eb.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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to