[wp-hackers] siteurl option queried from database on every load
ryan at boren.nu
Sun Jan 15 21:48:58 GMT 2006
On Sun, 2006-01-15 at 08:36 -0500, Mark Jaquith wrote:
> The siteurl option is queried individually on every page load:
>  => Array
>  => SELECT option_value FROM wp_options WHERE
> option_name = 'siteurl'
>  => 0.0012500286102295
> It is line 124 in wp-settings.php:
> $db_check = $wpdb->get_var("SELECT option_value FROM $wpdb->options
> WHERE option_name = 'siteurl'");
> The options cache is up and running at this point... but the wp-
> include files haven't been uploaded... so get_option() is
> unavailable. Can we move this check to a later point, so that the
> option can be grabbed the the cache with get_option()? Looks to me
> like an easy way to trim one query from every page load... every
> little bit helps!
We need something to serve as a DB sanity check. What that check is and
how early we execute it are debatable.
More information about the wp-hackers