Saturday, 28 September 2013

is it an issue to have 50-100 queries run on a single public facing page?

is it an issue to have 50-100 queries run on a single public facing page?

I want to create a page to list out thread names and participants. What I
am currently doing is running a query for the threads, then a query for
each thread to get its participants. What I am concerned about is the
number of queries that may run. For instance, if I list out 20
threads/page, then that's 21 queries for that page for this operation.
furthermore, if I want to get information for each user, then the number
of queries can rise significantly, unless I perform a join, which may/may
not be economical to do so.
Would you consider it to be an issue to have 50-100 queries run on a
single public facing page?
Would it be better to run one query for the threads, and another for the
particiants using WHERE IN(...), then sorting the users out in the
application?

No comments:

Post a Comment