# Topic\_views vs Topic.views

**URL:** https://meta.discourse.org/t/topic-views-vs-topic-views/97175
**Category:** Development
**Created:** [September 14, 2018, 8:25am UTC](https://meta.discourse.org/t/topic-views-vs-topic-views/97175 "2018-09-14T08:25:31Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [September 14, 2018, 10:47am UTC](https://meta.discourse.org/t/topic-views-vs-topic-views/97175/2 "2018-09-14T10:47:52Z")

</div>

> [@Topic view count is inaccurate in topic index](https://meta.discourse.org/t/topic-view-count-is-inaccurate-in-topic-index/56764/8):
>
> Note that topic view counts are reset once per 8 hours per IP (for anons). So if you had a lot of anon visitors coming from the same IP that won’t show up in view counts.

`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>

---

_[View the full topic](https://meta.discourse.org/t/topic-views-vs-topic-views/97175)._
