Get the highest value
Queries for greatest-n-per-group can be solved using window functions:

select note_id, size, id
from (
   select note_id, size, id, 
          row_number() over (partition by note_id order by size desc) as rn
   from the_table
) t
where rn = 1;


The above is standard SQL, but Postgres as another (proprietary) feature that can be used for this:

select distinct on (note_id) note_id, size, id
from the_table
order by node_id, size desc;


The distinct on () solution is usually faster then the solution using window functions.