post_views table

The post_views table in the Blog Database Schema schema has 6 columns, keyed by id, with 1 foreign key to posts.

Pre-aggregated per post per day per referrer, not one row per hit. Raw hit logs belong in an analytics pipeline, not the blog database.

Columns (6)

Columns of the post_views table
ColumnTypeConstraintsDescription
iduuidprimary key
post_iduuidnot null, references posts.id
viewed_ondatenot null
view_countintegernot null
unique_countintegernot null
referrer_hostvarchar(255)

Indexes (2)

  • (post_id, viewed_on, referrer_host) unique
  • (viewed_on)

Relationships