post_views table
The post_views table in the Reddit Clone Database Schema schema has 4 columns, with 1 foreign key to posts.
Pre-aggregated per post per day, not one row per hit. Raw impression logs belong in an analytics pipeline, never in the table the site reads on every page load.
Columns (4)
| Column | Type | Constraints | Description |
|---|---|---|---|
| post_id | uuid | not null, references posts.id | |
| viewed_on | date | not null | |
| view_count | integer | not null | |
| unique_count | integer | not null |
Relationships
post_views.post_idreferencesposts.id