Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are using ASP.NET MEmbership and the Anonymous Provider for anonymous users, then each anonymous user gets a row created in aspnet_Users table as soon as you say Profile.Save(). In that case, you can track both anon and registered users viewing certain Page. All you need to do is record the aspnet_user's UserID and the QuestionID.</p> <p>However, I strongly discourage doing this at database level since it can blow up your database. If you have 10,000 questions and 1,000 registered users and 100,000 anonymous users, and assuming each user visits 10 questions on an average, then you end up having 1M rows in the tracking table. Quite some load. </p> <p>Moreover, doing a SELECT COUNT() on the tracking table is quite some load on the database, especially you are doing this almost every page view on your forum. Best is to keep a total counter at the Question table against each question. Whenever you get a unique user looking at a page, you just increase the counter. </p> <p>Also don't create a FK relationship to the user table from the tracking table. You will need to cleanup the aspnet_users table as it piles up a lot of anonymous users over time who will most likely never come back. So, the tracking page needs to just have the userID field, and no FK. Moreover, you will have to cleanup the tracking table over time as well as it will keep getting millions of rows. That's why the TotalView counter needs to be at the Question table and never use SELECT COUNT() to calculate the number of views while displaying the page.</p> <p>Does this answer your question?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload