Neo4j-PHP-OGM icon indicating copy to clipboard operation
Neo4j-PHP-OGM copied to clipboard

Alternative to fetch eager / lazy ? Performances issues

Open t0F opened this issue 8 years ago • 0 comments

Hi, I have some entities with properties relations to a second node :

Class MainNode (
    /**
     * @OGM\ManyToOne(relation="linkSecondNode")
     */
    protected $secondNode;

    /**
     *
     * @return mixed
     */
    public function getSecondNode() {
        return $this->secondNode;
    }

When I make a query to return a list of MainNodes, and then use the getSecondNode method, I have poor performances. I assume that's because it need a query to get the secondNode data the first time we use the method.

In doctrine you can add a "fetch" annotations to define what need to be return by query. Is there a way to make something like that, in order to get all data need in one query ? Thanks for your time.

t0F avatar Sep 09 '16 08:09 t0F