A common table, with only two fields, one is the phone number, a set is the ID, the length of the ID set up more than 3000, now want to run once a day into the cache regularly, but the query speed is slow, 2 million 10 minutes is not enough, lead to database connection timeout, below is the SQL, inquired through what way can shorten the time to come back within 1 minute The select t2. * from (select rownum as rowindex, t. * from t_zzd_attention_job t) t2 Where t2. Rowindex>=# {it} and t2. Rowindex<# {end}
CodePudding user response:
An execution plan, also do not recommend using rownum as a retrieval condition, can add a column for the index
CodePudding user response:
CodePudding user response:
Using rownum is going to partial time of the query