Extract last record inserted for each key identifier
Using a CTE (Supported by SQL Server) would help separate the logic of the query better than the sub-select in the from clause. Using the auto-increment ID is also something that can simplify the query.

Consider the following:

with MostRecent as (
    select max(ID) as ID
    from ArchiveData
    group by PathKey
)
select *
from ArchiveData inner join MostRecent on MostRecent.ID = ArchiveData.ID
order by PathKey


The above should reduce the number of joins a lot, and use a better key for the joins that are done.