I have a WPMU installation where loading a blank page (i.e. no Loop) generates ~25 queries. The loop and the sidebar add another 10 or so queries.
So ~35 in total.
I wanted to pull some blog posts from another blog so I used...
switch_to_blog( 2 );
{secondary loop here}
restore_current_blog()
The number of queries went through the roof. So I experimented with different situations and if I *only* switch to the second blog and restore the current blog (i.e. empty secondary loop) it generates another 25 queries.
Is this normal? It seems to map to the original 25 queries, implying that restore_current_blog() repeats the setup of the first blog from scratch.
If this is expected...
1. Is there another way to do a secondary loop without "switch_to..." - "restore_current..."?
2. Alternatively, is there a way to cache the first setup and not repeat those 25 queries?
Any insight would be much appreciated. My DB is groaning.