>-----Oorspronkelijk bericht-----
>Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Namens
>Ricardo Kustner
>Verzonden: zondag 11 augustus 2002 23:24
>Aan: [EMAIL PROTECTED]
>Onderwerp: Re: mm:list performance (was: number of objects)
>
>
>Hi,
>
>Andr� van Toly wrote:
>
>> I've had the same problem with the 10.000+ articles in NU.nl. Every news
>> article in NU.nl has an overview at the bottom with the latest � 50
>> articles which are related to the section to which the article belongs.
>> So a listing would be something like:
>> <mm:list node="art_node_number" path="section,article"
>> orderby="article.created" max="50">
>> We solved this problem by using constraints. MMBase seems to execute the
>> SQL constraints prior to selecting the articles. For example a list like
>> the following did the trick:
>> <mm:list node="art_node_number" path="section,article"
>> orderby="article.created" max="50" constraints="article.created > today
>> - 10 days">
>> I don't think upgrading to 1.5.1. will solve your problem (cause you
>> know very well yourself we'll be using 1.5.1 for NU.nl ;-), but maybe
>> the above solution will.
>
>Ah, thanks for the suggestion... a quick look at some of the
>article->reply pages revealed that the "max" isn't used as it shows all
>the related replies without restriction... some pages have quite a lot
>of replies, and they are slow at the first load, but not as slow as
>sometimes happens with other pages... just for fun I debugged one of
>those pages and I clocked more than 1500 SQL queries for a single page
>*yikes* :)
>So maybe in my case the max-problem is in another part of the site... I
>guess I'll need to dig deeper into it...
>Or maybe there are any other known (performance) surprises with certain
>mmbase tags?
>
>
>

The reason you clocked over 1500 requests is because you didn't add the
fields in
the query :

<mm:list node="art_node_number" path="section,article"
orderby="article.created" max="50">

The result is that i doesn't know all the fields from section and acticle in
the loop and will
be forced to get the node from the database per loop entry : say you have 50
items that would
mean instead of 1 query that gets all the needed data it does atleast : 1+50
(probably more
because it has to figure out what the node is about). Allways add the fields
you are going to
use inside the loop to the list (this was forced in scan but not in tags).

<mm:list node="art_node_number" path="section,article"
orderby="article.created" fields="aricle.created,article.title,section.name"
max="50">

for example.

We will have to research if we can 'find' the needed fields on the fly and
add them to the first query but
the developers who made the tags say thats very hard todo.

Daniel Ockeloen.








Reply via email to