Welcome Guest, Not a member yet? Register   Sign In
Building a Read vs Unread Status for a Forum
#21

[eluser]jedd[/eluser]
[quote author="AgentPhoenix" date="1257555038"]
Weird, I had the box checked to notify me of responses to the thread and it didn't.
[/quote]

I'm sure you'll be writing a much more considerate forum! Smile

Quote:Anyway, for the part of this that checks for unread topics within a given forum, it shouldn't be too much of an issue because you'll only ever be checking a certain number of threads anyway, right? For example, if you have 50 threads to a page, then you'll only have to check those 50 threads for unread state, not all 800,000 that exist in that forum (unless I'm not thinking of something). Of course, when checking the general read/unread state of a forum, I can see where it might get hairy.

Just so - and the same reasoning I used. 10 or perhaps 20 threads shown per page, means it's a fairly modest number of calls into the DB. Given you'd be indexing the relevant columns, and they're all integers, it should be pretty snappy.

Similarly I recall a problem that TheFuzzy0ne highlighted a while ago, viz the counting of unread messages in a forum - which I couldn't easily facilitate with my design. I had to loop (or do sub-selects) through all the threads within a forum - which is particularly expensive - and do a message count attached to those threads, totalling them all up. My response was that I didn't really care about trying to show the total number of unread (or even just a full total) messages within a forum - and I still tend to think that it's not terribly important information. I guess it depends what forum systems you're using to, and the way you interact with them. I wanted to avoid the idea of forum groups - as it would introduce a fourth layer to the architecture - but I know that some people find that design very appealing. Happily I was mostly writing my forum code a) to learn from experience, and b) for a custom 27-year coding project I'm slowly working on (ie. I'm not too fussed about how useful it would be in other environments).

In any case, what I think I'd do now is just denormalise the schema, and introduce a total_messages column in the forum table.


Messages In This Thread
Building a Read vs Unread Status for a Forum - by El Forum - 11-04-2009, 10:21 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-04-2009, 10:39 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 12:15 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 08:23 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 09:45 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 09:58 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 10:11 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 11:51 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 01:06 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 06:52 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 07:39 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:35 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:40 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 07:14 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:12 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:17 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:24 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:31 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 11:29 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 12:50 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:04 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 04:22 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 06:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB