I'm working on a forum. When
it displays a forum index, it gets all the topics and depending on the
offset, displays only ten at a time. Now that's a single query. But
problem comes when I display how many replies each post has. So far, when
it does the while loop, it does a query for each item.
Marcjon, I think you have asked this question before. there are replies
to it, have you checked those?
Marcjon Louwersheimer wrote:
I'm working on a forum. When
it displays a forum index, it gets all the topics and depending on the
offset, displays only ten at a time. Now that's a single query.
I have IIS 4.x and MySQL running on the same machine. So do queries use
up bandwidth? Does it matter if I have 20 queries per page? Will that
slow it down if many people started using my site? Currently only I, and
some friends for testing, use it.
--
Marcjon
--
PHP Database Mailing List
Think of bandwidth as the volume of data returned by the web server to the
browser, not machine cycles.
MySQL will use machine cycles, but there's more to it than that. For
fastest response the fields you are running the query against should be
indexed.
What pushes you to 20 queries per page?
If both services are running on the same machine then no, the number of
queries per page will not affect bandwidth. It will however, affect you
processor usage. Without having seen your code, I can only make
generalizations. 20 queries is a bit excessive but it's still manageable
if the server