To answer myself, this seems to work decently:
SELECT word, count(*)
FROM ( 
  SELECT regexp_split_to_table(raw, ' ') as word
  FROM posts
  order by id desc
  limit 100000
) t
GROUP BY word
order by count(*) desc
            To answer myself, this seems to work decently:
SELECT word, count(*)
FROM ( 
  SELECT regexp_split_to_table(raw, ' ') as word
  FROM posts
  order by id desc
  limit 100000
) t
GROUP BY word
order by count(*) desc