PostgreSQL and RAM usage
PostgreSQL, performance for queries with grouping
PGDay UK 2016 -- Performace for queries with grouping