Home > database >  Count soon science problem, two conditions, conditions of 2 or more count is very slow, why is this?
Count soon science problem, two conditions, conditions of 2 or more count is very slow, why is this?

Time:10-01

Experienced great god to solve the trouble, thank you
Problem description: data volume is not large, should be milliseconds returned, the where condition query two soon (where sellerMemberId=? The and status=? - 1 seconds execution plan see figure 1), (the where sellerMemberId=? The and status=? And mergeOrderStatus=? - above 10 seconds execution plan see figure 2), is this why???????
Table data quantity: 30 w
Operating table: please count
Hit the data volume: 570
Indexes: the where condition field has index
Executing SQL statements: SELECT COUNT (0) AS the total FROM al_order_1 t1
WHERE sellerMemberId='b2b - 2413499052' AND status='buyers paid AND mergeOrderStatus IN (' 0', '3', '4') AND gmtcreate & lt; 23:59='2017-12-09' AND gmtcreate & gt;
='2017-11-24 00:00'
Figure 1: query two execution plans where clause for


Figure 2: query multiple conditions where the execution of the program execution plan:



CodePudding user response:

There is something wrong with the index was built? The first execution plan looks with two indexes, the second is only one

CodePudding user response:

1/f, right, the data quantity of daqu indexed will speed up the retrieval efficiency
  • Related