On Thursday, May 14, 2015 at 2:39:38 AM UTC-7, Janko Marohnić wrote:
>
> Maybe it would be useful to implement `dataset.first` in terms of 
> `dataset.limit(1).all.first`, do you think there would any downsides to 
> this?
>

That doesn't work if you are using eager_graph in the same query.  I 
suppose without eager_graph it may work, but it requires modifying 
Dataset#first to check that :eager is being used and :eager_graph is not 
being used, which will hurt performance of all Dataset#first calls, even 
ones that don't use eager loading.  In general I think the current simple 
approach is best, where you have to call Dataset#all if you want to eager 
load.  In general, if you are calling Dataset#first, there is no reason to 
eager load anyway.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to