Thank you all, I will try at first
shared_buffers = 16GB and
index on words_scores(uid, length(word) desc)