yii2-gallery-manager icon indicating copy to clipboard operation
yii2-gallery-manager copied to clipboard

Eager loading for images

Open Matvik opened this issue 6 years ago • 3 comments

There is a problem - because "images" is not a relation, we can not apply eager loading, for example, when displaying several products with their images. So, there will be a number of database queries executed. It is not good.

Matvik avatar Mar 28 '18 02:03 Matvik

if it is question about optimization - it should be possible to create that relation…

basically database structure is: object with galery --< gallery --< images

and image url generation is not complicated.


however this was not considered to be primary usecase for extension(in most cases I remember - there was just one gallery or very rare cases 10s of them… which is not significant)

zxbodya avatar Mar 28 '18 07:03 zxbodya

In the case of, for example, an online store, there may be many products on one page, and for each product the main photo is displayed. Other variants also happen

Matvik avatar Mar 28 '18 13:03 Matvik

yes, sure I do not argue there are cases for that, it just was not my case ;)

btw, for case with store - often for main photo, requirements are different (sizes of previews for example), and contexts where to use it also, are often different… so I have other extension for that - https://github.com/zxbodya/yii2-image-attachment

zxbodya avatar Mar 28 '18 13:03 zxbodya