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 I have eleven queries. The result changes only once a year. How can I save this result so that I only need one query? Would I save the result as something in a field?
Which functions I can use to save the result?
What i do save? In which form?
In a finished version, i can do something:
If threads 1-10 are changed, set trigger to off
If page is called and trigger=off, do the queries, saave the result, set the trigger to yes, show the page.
As long the threads are not changed, i need one query fot the trigger and the result as a rwo in a table for example.
Are there any functions for this?
In which form I would save thread and posts, please?
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 I have eleven queries. The result changes only once a year. How can I save this result so that I only need one query? Would I save the result as something in a field?
Which functions I can use to save the result?
What i do save? In which form?
In a finished version, i can do something:
If threads 1-10 are changed, set trigger to off
If page is called and trigger=off, do the queries, saave the result, set the trigger to yes, show the page.
As long the threads are not changed, i need one query fot the trigger and the result as a rwo in a table for example.
Are there any functions for this?
In which form I would save thread and posts, please?