My table Employee has a composite primary index as (last_name, first_name). If I am using only first_name in where clause, will my primary index be used?
Can someone pls explain if primary index is getting used?
In your where clause you need to specify both the columns in order to make use of the PI by the optimizer else it will go for a FTS(full table scan). The reason being the row hash would be calculated to locate the AMP of the row only if both the columns are mentioned.