Zoomerdevs >>> Boomerdevs

:#zoomer:

>be zoomerdev

>knowledge of programming comes from "how to program in python" tutorials

>hasn't even heard of the word efficiency

>write programs that could be done in 0.01s in 5s

>collect massive salary for being a "cloud data specialist" or something

:#boomer:

>be boomerdev

>went to college, learned how to program in ASM

>obsessive about efficiency

>spend hours creating an alorithim to solve a problem 500x faster than zoomerdev

>no one cares, in fact, they think zoomerdev is better (if it takes longer it must be doing more)

>gets fired for being obsolete

@TwoLargeSnakesMating @DrClaus Aevann discuss

104
Jump in the discussion.

No email address required.

I prefer SQL tbh I just write my schizoquery and let the schizoengine come out with a fast implementation @TwoLargeSnakesMating discuss

Jump in the discussion.

No email address required.

ahhh the good old days of 4000 sprocs and 5000 "compiled views" 3000 triggers

Jump in the discussion.

No email address required.

fun fact: this :marseysharksoup: is the SQL query that generates the leaderboard on https://rdrama.net/events/worldcup2022/leaderboard ( @TwoLargeSnakesMating wrote it as a quick lil thing)

WITH bet_options AS (
	SELECT p.id AS submission_id, so.id AS option_id, so.exclusive, cnt.count
	FROM submission_options so
	JOIN submissions p ON so.submission_id = p.id
	JOIN (
		SELECT option_id, COUNT(*) FROM submission_option_votes
		GROUP BY option_id
	) AS cnt ON so.id = cnt.option_id
	WHERE p.author_id = 30 AND p.created_utc > 1668953400
		AND so.exclusive IN (2, 3)
),
submission_payouts AS (
	SELECT
		sq_total.submission_id,
		sq_winners.sum AS bettors,
		floor((sq_total.sum * 200) / sq_winners.sum) AS winner_payout
	FROM (
		SELECT submission_id, SUM(count)
		FROM bet_options GROUP :marseymarseyloveorgy: BY submission_id
	) AS sq_total
	JOIN (
		SELECT submission_id, SUM(count)
		FROM bet_options WHERE :marseydrama: exclusive = 3 GROUP :marseymarseyloveorgy: BY submission_id
	) AS sq_winners ON sq_total.submission_id = sq_winners.submission_id
),
bet_votes AS (
	SELECT
		opt.option_id AS option_id,
		opt.exclusive,
		sov.user_id,
		CASE
			WHEN opt.exclusive = 2 THEN :marseytransflag: -200
			WHEN opt.exclusive = 3 THEN :marseytransflag: (submission_payouts.winner_payout - 200)
		END payout
	FROM submission_option_votes sov
	LEFT OUTER JOIN bet_options AS opt
		ON opt.option_id = sov.option_id
	LEFT OUTER JOIN submission_payouts
		ON opt.submission_id = submission_payouts.submission_id
	WHERE opt.option_id IS NOT NULL
),
bettors AS (
	SELECT
		COALESCE(bet_won.user_id, bet_lost.user_id) AS user_id,
		(COALESCE(bet_won.count_won, 0)
			+ COALESCE(bet_lost.count_lost, 0)) AS bets_total,
		COALESCE(bet_won.count_won, 0) AS bets_won
	FROM (
		SELECT user_id, COUNT(*) AS count_won FROM bet_votes
		WHERE exclusive = 3 GROUP :marseymarseyloveorgy: BY user_id) AS bet_won
	FULL OUTER JOIN (
		SELECT user_id, COUNT(*) AS count_lost FROM bet_votes
		WHERE exclusive = 2 GROUP :marseymarseyloveorgy: BY user_id
	) AS bet_lost ON bet_won.user_id = bet_lost.user_id
)
SELECT
	bettors.user_id,
	bettors.bets_won,
	bettors.bets_total,
	bet_payout.net AS payout
FROM bettors
LEFT OUTER JOIN (
	SELECT user_id, SUM(payout) AS net FROM bet_votes GROUP :marseymarseyloveorgy: BY user_id
) AS bet_payout ON bettors.user_id = bet_payout.user_id
ORDER BY payout DESC, bets_won DESC, bets_total ASC;

(this is excluding the part where :marseydrama: it gets user data)

Jump in the discussion.

No email address required.

At no point in your rambling, incoherent post were you even close to anything that could be considered a rational thought. Everyone on this site is now dumber for having read it. May God have mercy on your soul.

Jump in the discussion.

No email address required.

you keep :marseykys2: bullying me on the aoc threads smdh :marseybruh2:

Jump in the discussion.

No email address required.

WHERE exclusive = 3 GROUP :marseymarseyloveorgy: BY user_id) AS bet_won

kek is this the marsify effect?

also nice easily understandable query :) also I was talking about the days when stored procedures were basically used as rest api endpoints

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.