6 ms·
" ORDER BY tweet.time DESC " sign me up
by joewrong 7y ago
"
ORDER BY tweet.time DESC
"
sign me up
- mc3 7y agoWhether it is the lack of an ORM or lack of a "algorithm" that pleases you, this comment has made my day :-).
- npo9 7y agoIt’s the pure simplicity.
- anonytrary 7y agoPure simplicity works well when you have little to no users. It's reasonable to think that ORDER BY tweet.time DESC would result in a impractical experience for a site that has millions of DAU.
- lvturner 7y agoOnly if you subscribe to everything - if you keep your follower list small, the individual experience doesn't change regardless of the overall size of the platform.
- Nextgrid 7y agoWhy would it be? It'll naturally keep your list of followings small (as a large one will be unmanageable) and promote quality over quantity.
- hombre_fatal 7y agoI believe they're referring to the lack of algorithmic sorting.
- Jaxan 7y agoI’m not even sure what to think of the term “algorithmic sorting.” Is quicksort considered as algorithmic sorting ... ?
- hombre_fatal 7y agoI'm referring to "algorithmic" in its negative usage as short-hand for what you can see as of late with regard to Twitter, Youtube, and Facebook's suggestion engines where more complex sorting and filtering is happening than a simple ORDER_BY. Sure, not the best short-hand, but it seems most people understood what I meant. For example, https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=algorithm%20youtube&sort=byPopularity&type=story https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que... Like this submission: https://news.ycombinator.com/item?id=20184282 https://news.ycombinator.com/item?id=20184282 where people will shorten the "evil" to just "the algorithm".
- redwall_hp 7y agoThat SQL statement is literally algorithmic sorting...
- mc3 7y agoYes, I hate it when they manipulate the masses like that. They're so time-ist! Show me that old stuff!
- dblohm7 7y agoPersonally, I’m pleased by both!
- nkozyra 7y agoI'll never understand why the stream cannot just default to logic like this or [my follows]+[non-rt/replies]+[desc by time] Best I can come up with is it'd make promoted comment more apparent?
- MagnumPIG 7y agoThat's exactly the reason. Ads can much more easily be camouflaged as real content this way.
- WilTimSon 7y agoIf only they weren't inane. I think Twitter is probably the worst in terms of 'promoted content' because it always seems to serve up the same ad several days in a row and it's always something surprisingly off-topic. I'd be browsing my feed full of political news, movie trailers, and animal photos... and get an ad for ketchup. How on Earth could I confuse that for a real tweet or something my friends would retweet? A ketchup ad? Mental.
- hombre_fatal 7y agoThis doesn't make much sense to me. You don't need complicated algorithmic sorting and filtering to inject an ad space after every fifth tweet. Even the client can do that.
- megous 7y agoClient does that. If you consume twitter via their API, you'll notice there are no ads there.
- hirundo 7y agoYou see many more outlier tweets with thousands of likes when your feed is interspersed with "most liked by follows and follows of follows", as opposed to just "tweeted by follows". I think that improves the signal to noise ratio of the feed. But yeah, I wish a simple timeline was the default, and twitter stopped switching away from it.
- sam_lowry_ 7y agoFenix seems to have that.
- jamroom 7y agoI'm not an PG user but there does not appear to be an index on tweet.time - and even if there was wouldn't it better to do ORDER BY tweet.id DESC? I assume ordering by primary key is going to be the fastest, and would (ideally) prevent maintaining an index on tweet.time.
- chaps 7y agoSure, but you're making some assumptions in doing so. For example, that the time and id columns will remain constant. It might be a decent assumption in the beginning, but once you start doing updates on the table, all bets are off.
- WorldMaker 7y agoYup, as soon as you need to change ID schemes, you risk breaking query logic. Sure things like v1 UUIDs and Snowflakes (and ULIDs and so forth) try to maintain temporal ordering in their ID formats, but what if you need v4 UUIDs for better clustering in some hash-table or SHA-256 hashes for some sort of content addressing scheme? Also, it's just a very premature optimization in a world where CLUSTERED INDEXes exist. The database engine doesn't have to cluster by primary key, it can cluster directly by time (or any other index) if you ask it to. The power of doing it that way is that you can flexibly change it based on real performance issues (how do your execution plans look?) and characteristics (are you read heavy or write heavy? which ones are your bottle necks?), whereas if your application makes assumptions about ID format it's a lot harder to on-the-fly tune queries that all need to be rewritten.
- axaxs 7y agoAssuming that every tweet.time is unique, what benefit would you gain from indexing it?
- vntok 7y agoWhy would it be unique?
- 7y ago
- mipmap04 7y agoI was working on creating an rss reader with a reddit-like interface that allowed follows, voting, comments, etc. The computational expense of a fancy sort algorithm based on factors other than just one non-computed column is immense once you get to a decent number of users. I ended up removing the algo just to lower my hosting bills. Of course, there were other potential solutions, but for a side project, this was easiest.
- robobro 7y agoPleroma, part of the fediverse (3,500,000+ users) has exactly this.
- singron 7y agoIs "Latest" sorting in the twitter UI not this?
- WA 7y agoJust create a private list on Twitter, put all people you follow in there. Bam, done. Reverse-chronological order, no ads.
- kgthegreat 7y agoFeel free to take this for a spin - http://trysensible.com/ http://trysensible.com/ It has that and more! Open source - https://github.com/kgthegreat/sensible https://github.com/kgthegreat/sensible