Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.1
-
Fix Version/s: 1.2.0
-
Component/s: Nested Set
-
Labels:None
Description
How to reproduce
- fetch a tree with nested set
$root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId());
- issue
$root->getNode()->getChildren(); or there will be a total query mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> .... <?php endforeach; ?> ...
Problem is described more verbosely here – http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/
What behavior is expected
An already fetched record instance is returned, without calling database and without causing query flooding.
Like in propel.
In propel if you are calling ....::retrieveTree($id) it returns the root
with completed, pooled (cached) and linked tree.
What happens
An additional query is issued
This is a big slip in architecture of Doctrine`s nested set implementation.
Activity
Andrei Dziahel
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Summary | Normal nested set pooling implementation | Eliminate queries produced by Doctrine_Node_NestedSet::getDescendants() when possible |
| Description |
There is no normal nested set pooling in Doctrine. $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); $root=$tree[0]; After every $root->getNode()->getChildren() there is a unnecessary queue to DB. Please, we need to implement normal nested set without flooding queues. |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); {code} h3. What behavior is expected An already fetched record instance is returned, without calling database h3. What happens An additional query is issued |
| Priority | Critical [ 2 ] | Major [ 3 ] |
alex
made changes -
| Description |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); {code} h3. What behavior is expected An already fetched record instance is returned, without calling database h3. What happens An additional query is issued |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); or there will be a total mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> <?php foreach($child->getChildren() as $childChild): ?> <?php endforeach; ?> <?php endforeach; ?> ... {code} h1. Problem well described here: http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/ h3. What behavior is expected An already fetched record instance is returned, without calling database. h3. Like in propel. In propel if you are calling ....::retrieveTree($id) it returns the root with completed, pooled (cached) and linked tree. h3. What happens An additional query is issued This is a big slip in architecture of Doctrine`s nested set implementation. Thank you. |
alex
made changes -
| Description |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); or there will be a total mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> <?php foreach($child->getChildren() as $childChild): ?> <?php endforeach; ?> <?php endforeach; ?> ... {code} h1. Problem well described here: http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/ h3. What behavior is expected An already fetched record instance is returned, without calling database. h3. Like in propel. In propel if you are calling ....::retrieveTree($id) it returns the root with completed, pooled (cached) and linked tree. h3. What happens An additional query is issued This is a big slip in architecture of Doctrine`s nested set implementation. Thank you. |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); or there will be a total query mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> .... <?php endforeach; ?> ... {code} h5. Problem well described here: http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/ h3. What behavior is expected An already fetched record instance is returned, without calling database and without causing query flooding. h3. Like in propel. In propel if you are calling ....::retrieveTree($id) it returns the root with completed, pooled (cached) and linked tree. h3. What happens An additional query is issued This is a big slip in architecture of Doctrine`s nested set implementation. Thank you. |
Andrei Dziahel
made changes -
| Comment | [ Rewrote ticket description ] |
Andrei Dziahel
made changes -
| Description |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); or there will be a total query mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> .... <?php endforeach; ?> ... {code} h5. Problem well described here: http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/ h3. What behavior is expected An already fetched record instance is returned, without calling database and without causing query flooding. h3. Like in propel. In propel if you are calling ....::retrieveTree($id) it returns the root with completed, pooled (cached) and linked tree. h3. What happens An additional query is issued This is a big slip in architecture of Doctrine`s nested set implementation. Thank you. |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); or there will be a total query mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> .... <?php endforeach; ?> ... {code} Problem is described more verbosely here -- http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/ h3. What behavior is expected An already fetched record instance is returned, without calling database and without causing query flooding. h3. Like in propel. In propel if you are calling ....::retrieveTree($id) it returns the root with completed, pooled (cached) and linked tree. h3. What happens An additional query is issued This is a big slip in architecture of Doctrine`s nested set implementation. Thank you. |
alex
made changes -
| Description |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); or there will be a total query mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> .... <?php endforeach; ?> ... {code} Problem is described more verbosely here -- http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/ h3. What behavior is expected An already fetched record instance is returned, without calling database and without causing query flooding. h3. Like in propel. In propel if you are calling ....::retrieveTree($id) it returns the root with completed, pooled (cached) and linked tree. h3. What happens An additional query is issued This is a big slip in architecture of Doctrine`s nested set implementation. Thank you. |
h3. How to reproduce # fetch a tree with nested set {code} $root = Doctrine::getTable($model)->getTree()->findRoot($rootId); $treeObject= Doctrine::getTable($model)->getTree()->fetchTree($root->getId()); {code} # issue {code} $root->getNode()->getChildren(); or there will be a total query mess in a lambda function with a loop getChildren(). ... <?php foreach($root->getChildren() as $child): ?> .... <?php endforeach; ?> ... {code} Problem is described more verbosely here -- http://codeutopia.net/blog/2008/08/30/understanding-doctrines-nestedset-feature/ h3. What behavior is expected An already fetched record instance is returned, without calling database and without causing query flooding. h3. Like in propel. In propel if you are calling ....::retrieveTree($id) it returns the root with completed, pooled (cached) and linked tree. h3. What happens An additional query is issued This is a big slip in architecture of Doctrine`s nested set implementation. |
Roman S. Borschel
made changes -
| Assignee | Roman S. Borschel [ romanb ] | Jonathan H. Wage [ jwage ] |