![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can anybody tell me how to improve the performance of this query? SELECT NID, LEVEL, VALUE FROM DATA WHERE DID=2 AND STATUS=0 The value of STATUS is either 0 or 1. The primary key of DATA is EID which I don't use in the query. The total cost of the query without index is 240.47 If I put index on DID and STATUS, the total cost is 190.47. Thanks Erwin |
#3
| |||
| |||
|
|
datatype of STATUS ? |
|
did you a runstats WITH DISTRIBUTION on the table?, otherwise the optimizer does not know that there are only 2 different values for STATUS. |

![]() |
| Thread Tools | |
| Display Modes | |
| |