select a.id
from (select /*+index(test_table, test_index)*/
row_number() over (partition by a, b, c order by d desc) rn,
id
from test_table
) a
where a.rn = 1
test_index(a, b, c, d)
limit access to 500, cost 9s)
How should I fix it