Write a query to find the second-highest salary from an employee table, and then optimize it for a dataset containing millions of records.
Assume the result means the second-highest distinct, non-null salary. Address how the access path can avoid unnecessary full-table work.
second_highest_salary.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| salary | NUMERIC(12,2) | Employee annual salary |