RSS Feed/News Reducing Queries to one?

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
23,807
Points
823

Reputation:

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...
 
Status
Not open for further replies.
Top