Like stats tweaks

Try these changes. :smile_cat: 
I had to merge the main branch because of some broken stuff all around... :-\

Probably performances wise is not perfect, honestly I don't know, but it **seems** to work on both mysql and postgre.