One query can wreck your database performance. Find out how I found this silent killer and sped up my apphttps://schneems.com/2017/07/18/how-i-reduced-my-db-server-load-by-80/ …
-
-
Replying to @schneems
I've got some ideas for how we could fix this in Active Record in the long term, what do you think ?https://www.reddit.com/r/ruby/comments/6o1wk9/how_i_reduced_my_db_server_load_by_80/ …
4 replies 1 retweet 3 likes -
Replying to @schneems
It would be nice of db constraints and rails validations could be auto-in-sync.
4 replies 1 retweet 3 likes -
Replying to @davetron5000 @schneems
The issue is that `valid?` can't work that way. Also determining which column was affected is ugly on not-PG
2 replies 0 retweets 0 likes -
Replying to @sgrif @davetron5000
What if we caught the error, and then re-ran validations to figure out which column had the problem...
1 reply 0 retweets 0 likes -
...So validations are still done in db and ruby level, but not always triggered via Ruby first?
1 reply 0 retweets 0 likes -
For if we enforced both ruby + database constraint then for the case of `valid?` explicit calls, we could execute the ruby validations.
1 reply 0 retweets 0 likes -
In cases like `save` where we know we will try to persist the object, skip the ruby validation, and catch db exception instead
2 replies 0 retweets 0 likes
Happy to pair on it
-
-
I probably ask too much, but this is the kind of subject I would love to follow on twitch.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.