# Total Views Error

**URL:** <https://meta.discourse.org/t/total-views-error/119018>\
**Category:** Product Support\
**Created:** [May 29, 2019, 5:46pm UTC](https://meta.discourse.org/t/total-views-error/119018 "2019-05-29T17:46:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [May 30, 2019, 5:08pm UTC](https://meta.discourse.org/t/total-views-error/119018/3 "2019-05-30T17:08:00Z")

</div>

> [@ben.gerber](#):
>
> The total views reported on the site UI is different than what’s showing in Discourse DB’s topic\_views table

The topic view data that is displayed in the UI comes from the `views` column of the `topics` table. The `views` column is incremented once per `user_id` or `ip_address` per `topic_id` every 8 hours. The 8 hour period can be changed by overriding the default value of the `topic_view_duration_hours` site setting.

The `topic_views` table only gets a single entry per `topic_id` per `user_id` or `ip_address`. If a user views a topic multiple times, there will only be a single entry for them for the topic in the `topic_views` table. The data from this table is used internally by Discourse to check if a user has met the trust level 3 requirements for topics entered.

You can test this yourself by running the following query with a `:topic_id` from your site:

```sql
select
COUNT(user_id) AS views_per_user
FROM topic_views
WHERE topic_id = :topic_id
GROUP BY user_id
ORDER BY views_per_user DESC

```

You’ll see that `views_per_user` is always 1. This means that you can expect `topics.views` to return a higher value than the sum of `topic_views` for a particular topic ID.

---

_[View the full topic](https://meta.discourse.org/t/total-views-error/119018)._
