I have a table (UserDeptMapping) which conatins 129000000 (one hundred twenty-nine millions records).
ID
DeptId
RegionId
DistrictId
Output comes with total 300000 rows which is taking 30 seconds.
How can I optimiase the query., so it will reduce the time.