-
Notifications
You must be signed in to change notification settings - Fork 47
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
Implement lazy joins and Lazy fields #118
Comments
see #208,. |
Suggested syntax: $model->addExpression('bleh', ['..complex formula', 'lazy'=>true]);
$model->addField('blob', ['lazy'=>true']); Unlike A difference to onlyFields would be if lazy field is accessed: $model->load(1);
echo $model['blob']; Then model would specifically load the field. In most cases this is a reasonable trade off for a lazy field. This mechanic will NOT work for fields that are omitted by onlyFields, because otherwise this can cause sigificant application slow-down when accessing a field, which ought to be system. |
Use case: password field could be lazy, because we don't like loading passwords. |
very simillar feature request: #319 |
related with #1093 |
Lazy Fields and Lazy Joins are those optional fields that will not be loaded unless requested. The logic should be like this:
Adding a lazyJoin will make it's field lazy too. If you have not requested any of the "lazy" fields from the join, then join won't be performed either.
As suggested on reddit - we should make our 'leftJoin' optional.
adding leftJoin does not impact the scope of the model. So if no fields have been selected (through onlyFields) from the joined table, then there is no need to join it. This can be a good optimisation if we:
The text was updated successfully, but these errors were encountered: