Self join increase paging query performance
I really cannot see the point of using self-join in this query. It is 100% equivalent to this:

select m.* 
from message m
where m.thumbs_up = 98 and m.id &lt; 13 
   or m.thumbs_up &lt; 98
order by m.thumbs_up desc, m.id desc 
-- limit N 
  ;


I would expect an index on (thumbs_up, id) to be used by this.