[wp-trac] [WordPress Trac] #14397: slow sql query from probably is_blog_installed
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 25 20:58:38 UTC 2010
#14397: slow sql query from probably is_blog_installed
--------------------------+-------------------------------------------------
Reporter: mark-k | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Performance | Version: 3.0
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
Comment(by jimmcq):
In my tests with a large number of blogs, "SHOW TABLES LIKE
'{$blog_prefix}%'" was still pretty slow (30 seconds as opposed to 2
minutes for a generic "SHOW TABLES")
It seems a little backwards to first get the list of all tables and then
see if a query exists... wouldn't it make more sense to iterate through
the list of queries and then see if the table for each query exists?
A query like "SELECT COUNT(*) AS count FROM information_schema.tables
WHERE table_schema = '$database' AND table_name = '$tablename'" on each
table seemed to be much faster, but information_schema is only supported
in MySQL 5, so it may have to wait for WordPress 3.2
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14397#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list