Join Indexes on Complex Queries

Database
Enthusiast

Join Indexes on Complex Queries

Hello All,

How can i apply join index for the below query

SEL

EmpId,

DeptId,

EmpName,

TotalDeptSalary

FROM

(

Sel

EmpId,

DeptId,

EmpName,

SUM (Salary) over (partition by deptId order by deptId desc) as TotalDeptSalary

FROM

Employee

)a

FULL OUTER JOIN

(

SEL

DeptId,

DeptName

FROM

Departments

)b

ON a.DeptId=b.DeptId;

In Employee Table i have created a NUPI on EmpId, Whereas in the Departments Table i created NUPI on DeptId. For the above query i want to create a join index on DeptId. To my knowledge we cannot create aggregate join index on analytical functions. wat is the other way to create join index for the above query.

Please Help. Thanks in Advance.

Tags (1)