It looks like you're using an Ad Blocker.
Please white-list or disable AboveTopSecret.com in your ad-blocking tool.
Thank you.
Some features of ATS will be disabled while you continue to use an ad-blocker.
How hard is it to fix the Inbox notification ?
Maybe, but my guess was different.
originally posted by: nugget1
How hard is it to fix the Inbox notification ?
As many years as it's been non-functional, I'd guess really hard.
originally posted by: Arbitrageur
"Fix" implies it's broken, but I was wondering if maybe it's not broken, but was intentionally disabled, because it used too many server resources to keep it constantly updated. In that case, it would be really easy to just re-enable it if it was disabled.
originally posted by: ArMaP
The following is my opinion as a member participating in this discussion.
a reply to: AwakenWithMe
The more difficult part (and probably what was using too many resources) is to see if there are unread messages.
For example, counting how many unread messages exist for a specific member takes longer than just reading a counter that could be on a different table, like the table where the member's profile is stored, that is incremented every time a message is received and decremented every time one message is read.
Reading a specific value from a smaller table takes much less resources than counting how many records follow a specific condition (two conditions, in fact, the message state and the member id).
PS: I don't know a thing about the code or database design.
As an ATS Staff Member, I will not moderate in threads such as this where I have participated as a member.
originally posted by: rounda
But you're not doing it for millions of records.
You're doing it for a user on login, and for notifications, you only care about the most recent and unread.
select count [messageid] from [messages] where ([userid] = [userid]) and ([isread] = 0) order by [date]
originally posted by: rounda
You're not scanning millions of rows. You're filtering out millions of rows that don't match your criteria, and databases are optimized to do that.
Allowing the database to do what its built to do is going to be more efficient than constant transactions that are just incrementing a column.
originally posted by: ArMaP
a reply to: rounda
I know all that, and I'm used to work with Microsoft's SQL Server and the SQL Management Studio, which has an option to show the execution plan of the executed command, I use it to optimize my queries precisely because what we expect, some times, is not how the database engine works.
But, regardless of that, the only way of the database engine knowing which records follow a specific condition is to look at all of them. Less records take less time.
originally posted by: ASrubWhoDiedAgain
Not really. Yes at some point a full scan needs to occur (mysql for example does a full scan after a cold start and populates the innodb buffer pool if using that engine). When its required really depends on too many factors (pk existing, how many? indexes rebuilt lately? any fks here? How often does this query occur? etc...).
Ex: select column from table where primary_key_column = val;
Mysql doesnt need to read all the data, it can actually pick any arbitrary location on disk and seek from there - of course this could actually end up being much slower than a full scan if the table is small.
This should scale well. If notifications got turned off due to load then I'd imagine the backend is in a bad spot.