Hello
It is little bit strange - can you send a info about your PostgreSQL version, send a query, and table description?
In this case, PostgreSQL should to use a hash aggregate, but from some strange reason, pg didn't do it.
Second strange issue is speed of external sort - it is less than I can expect.
What I know - a usual advice for MS Win is setting minimal shared bufferes - 512MB can be too much there.
Regards
Pavel Stehule