[LRUG] Any words of wisdom please

james2mccarthy at gmail.com james2mccarthy at gmail.com
Thu Mar 9 06:43:49 PST 2017


 
 
I'm assuming you're seeing the n+1 in your log, so you know which iteration is causing it. You likely just need to eager load the association with an includes(:whatever) on your query.      
 
 
 
 
 

 
 
>  
> On Mar 9, 2017 at 9:32 pm,  <Michael Pavling (mailto:pavling at gmail.com)>  wrote:
>  
>  
>  
>  On 9 March 2017 at 13:57, Mark van Harmelen  <mark at hedtek.com>  wrote: 
> >  If anyone else is tempted please, two questions remain, one about future 
> >  optimisations of I think three (N+1) queries I used to generate the page at 
> >  https://markvan.me/categories/Computer 
> >  
> >  Am I actually doing three (N+1) queries for starters, and are there words I 
> >  can google that might lead me to some improvements, even via caching? 
>
> The Bullet gem can help identify N+1 queries, etc: 
>
> https://github.com/flyerhzm/bullet 
> _______________________________________________ 
> Chat mailing list 
> Chat at lists.lrug.org 
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org 
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org 
> List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org 
>          
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20170309/b8b1cbc4/attachment-0002.html>


More information about the Chat mailing list