You are here: Re: The best way to traverse a tree « All PHP « IT news, forums, messages
Re: The best way to traverse a tree

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]


Удаленная работа для программистов  •  Как заработать на 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

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