Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eager Loading #65

Open
CubedEye opened this issue Aug 27, 2012 · 4 comments
Open

Eager Loading #65

CubedEye opened this issue Aug 27, 2012 · 4 comments

Comments

@CubedEye
Copy link
Contributor

Does LEAP do eager loading at all?

We've just been profiling our application and LEAP is making a extreme number of select statements.

Is there anyway to get LEAP to autoload all the relations when selecting objects, without all the select statements

@taai
Copy link

taai commented Aug 27, 2012

@CubedEye What do you mean by that? I think, that Leap executes SELECT query only once the related model is being accessed. Or may be you want all related models to get loaded in single query, like it's done in Kohana ORM (see $model->with() function)?

@CubedEye
Copy link
Contributor Author

I know about LEAP loading all the relations when they are required. I am looking for a way for LEAP to load all the relations in a single query, because at the moment we have way to many SELECTs going on.

Also, LEAP doesn't seem to be connected to Kohana's profiler model. I can make this a new ticket and I'll push the code we've used to get it to work.

@bluesnowman
Copy link
Member

@CubedEye Do you have any ideas of how we could implement eager loading? I agree this would be a nice addition to the LEAP ORM.

As for the profiler code, that would be totally awesome if you want to contribute that code. I would be nice if we could implement the profiler code in such a way to incorporate dependency injection so that users could choose select their own profiler but have Kohana's Profiler as the default.

@taai
Copy link

taai commented Dec 13, 2012

Look at Kohana ORM's with() function! Maybe we could implement this the same way...
https://github.com/kohana/orm/blob/3.3/master/classes/Kohana/ORM.php#L840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants