|
Posted by Stefan Rybacki on 10/19/05 15:50
Naich wrote:
> I've got a traditional LAMP setup, PHP4, MySQL3, running on Debian.
>
MySQL3 is old. Think about a newer version.
> 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?
Both ways, will work. A third one could be a different database model.
>
> While the site isn't too heavy traffic-wise, I'm wary about too much MySQL
> activity blocking the databases.
Selects don't lock a table, just updates and inserts do.
> On the other hand, with PHP being
> interpreted, presumably it'll be tying up more CPU time if I sort out the
> tree with PHP.
As always it depends ;) I would suggest to test it both of the ways you presented.
Regards
Stefan
>
> Any thoughts would be appreciated.
>
> Cheers, Naich.
Navigation:
[Reply to this message]
|