Lightning talk: The 6 Characters That Could Bring Down Your App
summary
A Rails app suffers huge Postgres CPU spikes and statement timeouts because an ActiveRecord relation uses count (translating to a slow COUNT query) to check existence on a table over 34 million rows with a 30s statement timeout. Replacing ".count > 0" with any? on Rails 5.2 drops CPU by about five to ten times. Also add timestamps, add monitoring, and use lower or per-query statement timeouts for long-running operations.
AI-written summary · about
related talks
14mDatabase Performance at Scale for RoR Applications
01h 01mNew Approach to Resolve objectrelational impedance mismatch
46mUse PostgreSQL, not Rails, to make Rails Faster!
20mCRUD! The Consequences of Not Understanding How ActiveRecord ...
42m3x Rails: Tuning the Framework Internals
25mPowerful Data: Making Rails Apps Faster with Aggregation
34mBeyond CRUD: the PostgreSQL techniques your Rails app is missing.
26mBiggish Data With Rails and Postgresql
