Reply to Re: The best way to traverse a tree

Your name:

Reply:


Posted by Stefan Rybacki on 10/19/05 23:32

NC wrote:
> 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.

The problem if such a structure is the overhead on inserting new data. And since he has a
comment system, insertion could be very often. Don't get me wrong I would prefer such a
structure but I'm not sure whether the OP get it to work or whether the insertion takes to
long.

Regards
Stefan

>
> Cheers,
> NC
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация