Optimization of greater than operator

前端 未结 3 473
不知归路
不知归路 2021-01-25 05:09

credit table and validtransaction table have million record data from year 2008 onwards.

We are doing a migration. So I need to find out the credittypeids which are no

3条回答
  •  长情又很酷
    2021-01-25 05:53

    The following index on the CREDIT table should help:

    CREATE INDEX idx ON CREDIT (PERIODSEQ, CREDITTYPEID);
    

    This should allow the EXISTS clause lookup to evaluate more quickly. You could also try the following variant index, which reverses the order of the columns:

    CREATE INDEX idx ON CREDIT (CREDITTYPEID, PERIODSEQ);
    

提交回复
热议问题