Nov. 18th, 2024

dybr

Nov. 18th, 2024 06:52 pm
juan_gandhi: (Default)
Ok, weird day. Eventually I got the command to get into prod db. And started with select count(1) from users;. After 10 minutes I asked the colleagues: what's up with the database. And Mike writes:"it's a very bad query". What's bad in it? He did not answer, except a remark that users table is often blocked by queries.

And Devon wrote that it's better to use another db server, a read-only copy, with a slightly different name.

Okay. It turned out we have 15M users. Now what, Do a join with a couple of other tables (I checked, one has 15M records, and another has 1M records). But then... then I simplified it, and we have just 47 users to delete. From an institution that has 850 users. Oh, whatever.

Went to the right db server - ha, I'm not allowed to do any changes.

Eventually it turned out that all I can do is send a pull request with a new file containing that query. Cool! What a life.
Meanwhile, Devon sent us, me and Esteban, a pull request to review. 156 files.

But the PR was good. Lots of improvements. Except some funny pieces that I suggested to sanitize.

One typical thing is:
someProcessor.someProcessing(params).flatMap(Ok(_)) - I suggested to extract this .flatMap(Ok(_)), being a typical pattern, to a method.

Another typical thing is this:

trait SomeCommonThing {
val x:X;
def y(a:A): B;

def doSomething(params: Params) =
this match {
case ia: ImplementationA => ia.dothisandthat(params)
case ib: ImplementationB => ib.dosomethingelse(params)
...
}
}

What, inheritance is forgotten? We are past OOP, and FP is learned just by the Red Book? Runar forgot to mention inheritance in his book? Hmm.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

September 2025

S M T W T F S
 1 2345 6
78 9 10 111213
14 151617181920
21222324252627
282930    

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 17th, 2025 03:47 am
Powered by Dreamwidth Studios