[wp-hackers] Avoid query_post on frontpage on wp initialization

Martin Widmann widmann.martin at gmail.com
Mon Dec 27 21:07:23 UTC 2010


Hi,

we are running on a pretty big WP database with a very large posts table with ~500k entries in the posts table. When going to the front page of the blog a query to the wp_posts table is made during WP initialization. This default query on the big table takes ~1sec. The data returned by this query is not required afterwards, so I'd like to avoid doing it. 

In wp->main() the query_posts() is always executed and I don't seem to have very much control of what is queried in there. I'd like to avoid querying anything at this stage at all. Later on in the page flow I'll query the database differently. Any idea?

Thank you,
Martin


More information about the wp-hackers mailing list