Link Details

Link 957719 thumbnail
User 448255 avatar

By dotCore
via dhruvasagar.com
Submitted: Apr 20 2013 / 05:15

Recently I was working on Issue#1 of my Soulmate Rails gem, which is a very simple and obvious optimization that I should have thought of myself. Thanks to lephyrius though for pointing it out. In my search method I was looping through the search results and calling find on each to get it from db. The fix involved to instead use a single where for all ids so that it translates to a single db call. A simple fix as well as an optimization.
  • 1
  • 0
  • 76
  • 56

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (1)



Voters Against This Link (0)



    Spring Integration
    Written by: Soby Chacko
    Featured Refcardz: Top Refcardz:
    1. Search Patterns
    2. Python
    3. C++
    4. Design Patterns
    5. OO JS
    1. PhoneGap
    2. Spring Integration
    3. Regex
    4. Git
    5. Java