|
Posted by NC on 10/19/05 21:32
Naich wrote:
>
> I'm going to be putting a comments section on my site, similar to
> something like Slashdot, i.e. nested comments in a tree structure.
> My question is - is it better to get the entire set of comments
> in one MySQL call and then use PHP to sort out the tree or would
> it be more efficient to go up the branches with multiple MySQL calls?
The first approach may result in high memory requirements, the second
will be much slower.
The best approach woould be to figure out a database structure that
would allow you to retrieve all comments in one query in the correct
order, so no PHP sorting is required.
Cheers,
NC
Navigation:
[Reply to this message]
|