Martijn Houtman <[EMAIL PROTECTED]> wrote: > > In order words, no need to use element="document" in these cases, which > > looks nicer, and would be more efficient for the database too. > > > Because I often don't need all fields of a document node, I would use > something like: > > <mm:related path="posrel,documents" fields="document.description" > orderby="posrel.pos" directions="UP">
That would be more efficient then using element="documents" because no extra queries are required. > Do you think that is more efficient in the case you need only certain > fields? I am not sure about the caching of MMBase. Does it work only on > nodes or does it work for any generated sql? I think most important is the number of queries, and the number of fields might be marginal, certainly when this number is small in any case. All types of queries are cached, though different caches may be used. mm:relatednodes result end up in the NodeListCache en mm:related results will be cached in the 'MultilevelCache'. I myself prefer to use 'real' nodes as much as possible, because I think it is easier to understand, and you cannot accidentily forget specifying fields and so on. Michiel -- Michiel Meeuwissen Mediacentrum 140 H'sum +31 (0)35 6772979 nl_NL eo_XX en_US mihxil' [] ()
