High volume data aggregation
I would write the raw data to a very basic table without indexes or constraints, not even a primary key.

If you can, insert many rows at once, that's faster than single-row inserts.

If you can afford loosing some data in a catastrophic event, make that an unlogged table, that's faster.

If you can afford loosing some data in a catastrophic event and all inserts can run in a single session, make that a temporary table, that's even faster. Probably not possible, though.

Start a new partition every time unit of your choice (daily?) and aggregate the old partition into permanent storage at some opportune moment.