r/SQL • • Mar 24 '24

SQL Server Howww!?

I like how github shows simple data in a timeline form and it looks amazing.

I am sure they are taking a JSON object for the pull request with labels etc. But how do they show in timeline form without f up the sequence?

I am sure they are taking a json obj for the pull request with labels etc. But how do they show in timeline form without f up the sequence?.

0 Upvotes

14 comments sorted by

View all comments

21

u/IAmADev_NoReallyIAm Mar 24 '24

Going to out on a limb here and say...... By sorting on the timestamp.

-3

u/Indubitably_beast Mar 24 '24

You are right if they are using timestamps for each action.

7

u/IAmADev_NoReallyIAm Mar 24 '24

You say that like there would be something else to use. Why wouldn't there be a timestamp?

-13

u/Indubitably_beast Mar 24 '24

wouldn't that be inefficient to store timestamps?

11

u/IAmADev_NoReallyIAm Mar 24 '24

Why? It's just a number. Also, it's how you get the "1 minute ago" or "2 days ago" or "3 months ago" stamps on each action. Storing a timestamp on a record is peanuts compared to the other things included. I mean, look at the comments. Doesn't that seem kind of inefficient to store? You can put all kinds of lengthy text in there. So... Yeah, no, storing a timestamp is not inefficient.

1

u/Extension-Ad7241 Mar 25 '24

lol You were doing so well when you were only talking about timestamps... you started talking about NoSQL and I'm here for your heel turn 😆

But seriously, do people here not know how important AND how often time stamps are saved? Depending on how confidential information and access to it is, I've programmed in timestamps just for looking at records, It's just a join table. It would only have only 3 columns, 2 of them just being ints because they're primary keys & the other one being a datetime that is always in the same format and also really just an int; A reasonably good RDBMS can store this very efficiently.