Index Hint无法使用主键

举个例子,这里emp_department_ix如果是表的主键则执行计划里看到hint没有生效的,如果是一般的索引则是生效的,很奇怪
SELECT /+ INDEX (employees emp_department_ix)/ employee_id, department_id
FROM employees
WHERE department_id > 50;

hint /+index(test primary)/ 强制让它走主表。
explain extended SELECT /+ INDEX (employees primary) / employee_id, department_id
FROM employees
WHERE department_id > 50;

1 个赞