Hello, I have an SQL query that I am trying to optimize. This request here completes in 0.3 seconds, but I need to run the same request for several different repositories. In any case, in order to optimize this request so that it accelerates or changes it, it immediately receives all the repositories.
I can always create a new team in C # that integrates with the team to make it a union of many different requests.
select * from mytable r where rs in (1, 7) and rd in (1, 75) and r.storeid = 1162 and r.period = 20110528 and r.pid in (select productid from otherTable where itmid=9999)
I already tried something like this, but it lasts forever.
select * from mytable r where rs in (1, 7) and rd in (1, 75) and r.storeid in (1162, 1223, 1231, 51231, 231, ...) and r.period = 20110528 and r.pid in (select productid from otherTable where itmid=9999)
MyTable has these indices: pid NOT UNIQUE, PLACED, NO JOIN_INDEX all other columns UNIQUE, PARTITIONED, NO JOIN_INDEX
source share