@Moops
@lemmy.worldI had an interesting conversation at work where someone questioned my use of DENSE_RANK and suggested I use LAST_VALUE. We had a good conversation about it, but ultimately agreed to disagree about the specific scenario. My code was accurate with no performance issues warranting a rewrite. My feeling was the person I was talking too was less familiar with DENSE_RANK and so favored LAST_VALUE. I get preference, I have my own, but I try to be aware of what's preference vs. what's technically superior.
I'm curious about people's thoughts on when to use LAST_VALUE() vs MAX() KEEP(DENSE_RANK LAST ORDER BY ). To my mind, both solve a similar problem. I lean towards DENSE_RANK largely out of preference due to the syntax being shorter (literally just less characters to type), and I also like that since DENSE_RANK is an aggregate function it outputs distinct results without needing to use the DISTINCT keyword. I haven't intentionally run tests comparing the two, but anecdotally I've never noticed a performance difference between the two when writing comparable queries.
Surprisingly I couldn't really find any detailed articles or discussions online comparing these two functions and I'm curious what thoughts are out there in the wild.
I've been in a great mood for the last week. Like, so much so I've even noticed a couple times and thought to myself "wow, I'm in a really positive mood." I've long minimized my use of social media and recently left that other site, interacting exclusively on Lemmy for my online community interactions.
I noticed my attitude of always being on guard whenever I say/comment/post anything here or IRL, expecting someone to roll through and light me up, has diminished and I'm generally feeling more confident and enjoying interactions both here but also IRL
I'm sure there's more to it than simply an online community change but holy shit. Seeing the effect ebb into my real life is amazing. You always hear about the negative impacts of social media on mental health but to experience it in real time is something else.