Hello ALL,
I have two tables A and B
Code:
A
Name Department Sex
B
Name GroupName Salary
I need to do the following query
Code:
SELECT
A.NAME, B.GroupName
FORM
A, B
WHERE
A.Name = B.Name AND A.Department = 'Sales' AND B.GroupName='Sales'
I wonder how to design the indexes when creating the two tables using 'CREATE TABLE' to get a better performance,
Code:
for Table A
INDEX idx_NAME(NAME), INDEX idx_Department(Department)
OR
INDEX idx_NAME(NAME ,Department)
for Table B
INDEX idx_NAME(NAME), INDEX idx_Department(GroupName)
OR
INDEX idx_NAME(NAME ,GroupName)