Topic_views vs Topic.views

Topic.views is integer count which includes both user and anonymous traffic.

SELECT COUNT(*) FROM topic_views WHERE topic_id = X is used to track topic views by registered users. It will have below details.

https://github.com/discourse/discourse/blob/cb824a6b338b32216baef9021fe508a290e99bbe/app/models/topic_view_item.rb#L59-L62

10 Likes