R

Reducing Queries to one?

  • Thread starter Thread starter Robert9
  • Start date Start date

Visitor Greeting

Welcome to NullWarehouse.com... We are currently seeking Mod's and Contributors. If you wish to apply for a Mod position then please click on Members dropdown arrow, then click on Staff App and fill it out completely and submit it. If you want to be a Contributor then start contributing and we will have our eye on you and take notice, something great could come of it.

  • We have redone the forum. If you notice any issues or errors please open a Support Ticket under the Members dropdown and let us know.
R

Robert9

Guest

Can someone please tell me what and how I can do this to minimize the queries:

I am building a class that outputs a page. I fetch the titles of ten threads and then the individual posts from those threads.

These ten threads and posts are almost never changed.
My query looks something like this:
a) 1 query: Fetch threads with thread_id in [1...10]
b) 10 queries: Fetch posts from the individual threads
(Yes, could do this in one go, but I need an example to save a lot of queries)

So...

Read more

Continue reading...
 
Similar content Most view View more
Back
Top Bottom