Efficient way to keep a count of entries within a timeframe? e.g. How many actions did user do in the last 7 days
That's a pretty common way of doing things, and PostgreSQL is designed to handle aggregative queries for large datasets very well. Though adding an index on the user_id and timestamp columns would improve performance, if you have that ability.