You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "liuheng1104 (via GitHub)" <gi...@apache.org> on 2023/02/20 08:08:24 UTC

[GitHub] [shardingsphere] liuheng1104 opened a new issue, #24257: How can we solve a large number of queries that contain in, if the parameter after in is large

liuheng1104 opened a new issue, #24257:
URL: https://github.com/apache/shardingsphere/issues/24257

   ok.... When can we optimize 'in' query
   for example: db1 (table_1, table_3, table_5), db2(table_0,table_2,table_4). sharding key is 'id'.sharding role is 'id %6'。 We have 3 records : id = 1, id = 2, id =4 。 so the real sql is : select * from db1.table_1 where id in (1 ,2,4) , select * from db2.table_2 where id in (1 ,2,4), select * from db2.table_4 where id in (1 ,2,4). so much in,it is not necessary i think。if we do batchGetByids => in (.............), it will do in all tables, it is inefficient i think。thanks


-- 
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.apache.org

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


[GitHub] [shardingsphere] liuheng1104 commented on issue #24257: How can we solve a large number of queries that contain in, if the parameter after in is large

Posted by "liuheng1104 (via GitHub)" <gi...@apache.org>.
liuheng1104 commented on issue #24257:
URL: https://github.com/apache/shardingsphere/issues/24257#issuecomment-1436629064

   Our business is divided into 256 tables. Use the partition key (user_Id) to query in. The parameters are 100, and the logical sql is select * from table where user_ Id in (100 parameters), actual sql: select * from table_ 1 where user_ Id in (100 parameters), select * from table_ 2 where user_ Id in (100 parameters),
   
   Many parameters after in are invalid code scanning
   


-- 
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 #24257: How can we solve a large number of queries that contain in, if the parameter after in is large

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #24257:
URL: https://github.com/apache/shardingsphere/issues/24257#issuecomment-1436574185

   @liuheng1104 Can you give an example for your question?


-- 
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 #24257: How can we solve a large number of queries that contain in, if the parameter after in is large

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #24257:
URL: https://github.com/apache/shardingsphere/issues/24257#issuecomment-1438003155

   Yes, this is an optimization point, I will try to optimize this problem later.


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