score:5

Accepted answer
ienumerable<downloadhistory> top5results = downloadhistory
    // group by songid
    .groupby(row => row.songid)

    // for each group, select the newest row
    .select(grp => 
        grp.orderbydescending(historyitem => historyitem.dateinserted)
        .firstordefault()
    )

    // get the newest 5 from the results of the newest-1-per-song partition
    .orderbydescending(historyitem => historyitem.dateinserted)
    .take(5);

score:0

--it took 99% of the two execution

select top (5) [t3].[songid], [t3].[dateinserted]
    from (
        select [t0].[songid]
        from [dbo].[downloadhistory] as [t0]
        group by [t0].[songid]
        ) as [t1]
    outer apply (
        select top (1) [t2].[songid], [t2].[dateinserted]
        from [dbo].[downloadhistory] as [t2]
        where [t1].[songid] = [t2].[songid]
        order by [t2].[dateinserted] desc
        ) as [t3]
    order by [t3].[dateinserted] desc


--it took 1% of the two execution
select top 5 t.songid,t.dateinserted
    from   (select songid,
               dateinserted,
               row_number()
                 over(
                   partition by songid
                   order by dateinserted desc) rn
        from   downloadhistory) t
    where  t.rn = 1
    order  by dateinserted desc 

Related Query