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 ?

page: 1
5
<<   2 >>

log in

join
share:

posted on Jun, 12 2023 @ 05:12 PM
link   
It is what it is but seems a simple fix , I've never been getting DM's other then a Thread of yours moved trashed, You have been slapped by a mod , But recently I've missed a few messages /Friends adds .

The revamp and fixing of the uploads is great ATS is rolling in the right direction . just a simple Icon number would be nice on the envelope .


Thanks !



posted on Jun, 12 2023 @ 05:26 PM
link   
I would like that , that one message i get every 10 year or so i missed by a few weeks.



posted on Jun, 12 2023 @ 05:28 PM
link   
a reply to: TheGreazel

It's True makes them more valuable aged messages !
edit on 12-6-2023 by Ravenwatcher because: (no reason given)



posted on Jun, 12 2023 @ 06:07 PM
link   


How hard is it to fix the Inbox notification ?


As many years as it's been non-functional, I'd guess really hard.



posted on Jun, 12 2023 @ 07:10 PM
link   

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.

Hah! 1st thought that entered my mind



posted on Jun, 12 2023 @ 10:26 PM
link   

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.
Maybe, but my guess was different.

"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.

Whether doing that still bogs down the server depends on how much traffic ATS still gets, but I would also note that server capabilities in general go up every year, so that the servers in use today on average are far more capable than the servers that were in use back when the notification was disabled or broken.

It was a nice feature for the envelope to turn white when we had a private message. Now that it no longer does that, I try to remember to check once a month or so, but that doesn't allow for a very timely response if I find someone asked me a question 3 weeks ago.

edit on 2023612 by Arbitrageur because: clarification



posted on Jun, 13 2023 @ 12:00 AM
link   
a reply to: Arbitrageur

Good response! I'm about three thousand mile from being computer savvy, so you guess makes a whole lot more sense than mine!



posted on Jun, 13 2023 @ 06:03 AM
link   
The following is my opinion as a member participating in this discussion.



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.

That's also my impression, that it was disabled because it used too many server resources, which means that it was badly written (either the code or the database itself), so it probably really needs a fix.



As an ATS Staff Member, I will not moderate in threads such as this where I have participated as a member.



posted on Jun, 13 2023 @ 10:04 AM
link   
var messageIcon = document.getElementByClassName("icon-envelope");

// Check if there is an unread message
var hasUnreadMessage = true; // Replace this with your actual condition

// Change the color if there is an unread message
if (hasUnreadMessage) [
messageIcon.style.color = "red"; // Replace "red" with the desired color
]
edit on 13-6-2023 by AwakenWithMe because: (no reason given)



posted on Jun, 13 2023 @ 02:24 PM
link   
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.



posted on Jun, 13 2023 @ 03:16 PM
link   

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.


Don't do that... databases have count methods which are pretty efficient.

SELECT COUNT([messageid]) FROM [messages] WHERE [userid] = [userid]

No reason to maintain another table.
edit on 13-6-2023 by rounda because: (no reason given)



posted on Jun, 13 2023 @ 07:52 PM
link   
The following is my opinion as a member participating in this discussion.

a reply to: rounda
I know that databases have count methods and I wasn't talking about a new table, I was talking about a specific field in an existing, less populated and used table.

Although efficient, a count has to look up all rows, reading just one field from one record should be faster.

And don't forget that the count needs to conditions and is applied to a table with millions of records:
SELECT COUNT([messageid]) FROM [messages] WHERE [userid] = [userid] AND [read]=True

Or something like that.

I was thinking about something like this, applied to a table with thousands of records:

SELECT [newmessages] FROM [memberdata] WHERE [userid]=[userid]

Another thing I was thinking was that it could be more efficient the update of the information, as, once again, the update would be done on a smaller database.

But all this is irrelevant without knowing the database structure, sometimes a well applied index solves this kind of problems.




As an ATS Staff Member, I will not moderate in threads such as this where I have participated as a member.



posted on Jun, 14 2023 @ 11:56 AM
link   
a reply to: ArMaP

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]
edit on 14-6-2023 by rounda because: (no reason given)



posted on Jun, 14 2023 @ 06:58 PM
link   
The following is my opinion as a member participating in this discussion.


originally posted by: rounda
But you're not doing it for millions of records.

I don't know how many messages the table where the messages are store has. The last message I have on my inbox has an ID above 7 millions, so I am assuming the worst case.


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]

The database needs to access all the rows to count them, even if the field being counted is indexed it will always take time to perform an index seek.

Selecting just one field from a table (specially if that field is indexed) should be faster.

PS: you don't need the "ORDER BY" to count the records, right?




As an ATS Staff Member, I will not moderate in threads such as this where I have participated as a member.



posted on Jun, 14 2023 @ 10:09 PM
link   
a reply to: ArMaP

OK, drop the order by then.

Select count id from messages where userid = userid and isread =0.

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.
edit on 14-6-2023 by rounda because: (no reason given)



posted on Jun, 15 2023 @ 03:17 AM
link   
The following is my opinion as a member participating in this discussion.


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.

Optimized or not, doesn't a WHERE clause look into all the records of the table?

Isn't the time of the scan or seek related to the number of rows in the table?


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.

What constant transactions?
I was only talking about a select of a specific field on a smaller table instead of a select count on the messages table to see if there were any new messages.

When a new message is sent then there's more work to do, as besides the insert on the messages table it would also be needed to be executed an update on the other table, but new messages and reading messages happens with a much lower frequency than checking for unread messages, so moving the slower actions to them would not affect as much the server.

But, as I said before, without knowing how the database really is structured and knowing that neither one of us have access to the database and the code, all of this is irrelevant and, most likely, will be ignored by who can really make the changes.



As an ATS Staff Member, I will not moderate in threads such as this where I have participated as a member.



posted on Jun, 15 2023 @ 10:30 AM
link   
a reply to: ArMaP

When you execute your query in a db, it optimizes that query and figures out the best algorithms to use.

In other words; while you might look at a where clause and say "that's a for-loop," the database doesn't. The same way that when you look at the database, you see a table with rows... The database sees it as whatever data structure it's built around (mysql is a tree, for instance).

Most of those algorithms are built around the fact that the majority of data you're querying is not what you're looking for and can be dropped from the dataset.

I think there's an explain clause that will show what the database is planning to do for your query.
edit on 15-6-2023 by rounda because: (no reason given)



posted on Jun, 15 2023 @ 07:38 PM
link   
The following is my opinion as a member participating in this discussion.

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.



As an ATS Staff Member, I will not moderate in threads such as this where I have participated as a member.


edit on 16/6/2023 by ArMaP because: (no reason given)



posted on Jun, 15 2023 @ 08:46 PM
link   

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.


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.

Its really too many factors to make a blanket "requires looking at all".

Re: notifications, I think a good way (if we arent considering newer front end technologies where today this is likely to occur) is to normalize out the data into a seperate table. Each time a new message is sent, this table is updated.


create table Notifications - NotificationId (pk ai) MessageId (fk) Read(tinyint(1) add index) Dismissed(tinyint(1) add index)
Created(timestamp) Updated (timestamp)

Join this on your user object (or query separately) and get a count where read isnt 1 and dismissed isnt 1 (or count diff between users last login date and max(updated), likely too be slower, my DBA power level is too low)


Table is updated asynchronously when user dismisses the notification or reads the message. This should scale well. If notifications got turned off due to load then I'd imagine the backend is in a bad spot.



posted on Jun, 16 2023 @ 06:09 AM
link   
The following is my opinion as a member participating in this discussion.



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.

How can the database engine know how many records exist with a specific, arbitrary condition without reading that field in all records, either from the table itself or from an index?


This should scale well. If notifications got turned off due to load then I'd imagine the backend is in a bad spot.

As far as I know, the code and database were "adapted" from some old forum software, and I always thought that the database structure wasn't really planned, but, as we say in Portugal, "hammered" into shape, with the result usually seen in cases like this: it appears to work on lower loads but fails as the load increases.




As an ATS Staff Member, I will not moderate in threads such as this where I have participated as a member.




top topics



 
5
<<   2 >>

log in

join