8000 💡 Efficient bulk-loading of morph relations · Issue #488 · cycle/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
💡 Efficient bulk-loading of morph relations #488
Open
@rauanmayemir

Description

@rauanmayemir

I have an idea!

Example relation:

class Parent
{
    #[Cycle\Relation\Morphed\BelongsToMorphed(
        target: ChildInterface::class,
        innerKey: 'child_id',
        morphKey: 'child_type',
    )]
    public ?ChildInterface $child = null;

When querying multiple parents with $select->load('child'), I want cycle to efficiently split up all child_type's and bulk-query each of them. I.e: if I have 50 parents with 20 childs of child1 and 30 childs of child2, it will take only 2 queries to load them: 1 for child1 and 1 for child2.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0