How to speed up group by
Taking a simple approach:

Execute inside psql, enable \timing and run your query. Also check query execution plan:

explain select &lt;your query&gt;;


Then run vacuum for your table:

vacuum (full, analyze, verbose) employee_employee;


And check if query execution plan was improved, you'll see what's the costly stage:

explain select &lt;your query&gt;;


Considering that your query is a simple query, there's no much to do beyond that inside the database.
Optionally evaluate if a materialized view fits your need.