Question

I am testing a very big database (perhaps wp_posts contains hundreds of thousands of rows). As such, the query time, especially the searching query, is extremely long. I'm thinking if there is any other way to split the WP database to multiple tables with different table prefix so that the url structure does not change compared to the original database.

I tried changing $table_prefix in wp_config to wpa_, then i created a sample posts with post name start with a. Then i changed $table_prefix in wp_config to wpb_, then i created a sample posts with post name start with b.

In the next step, i replace the $table_prefix line with

// if query for post start with a, it will go to wpa_ tables,
// if query for post start with b, it will go to wpb_ tables
$prefix = get_the_title(); 

if ($prefix(0) !== 'a') {

    $table_prefix  = 'wpb_';

} else {

    $table_prefix  = 'wpa_';

}

When i tried openning my domain, i got the error Fatal error: Call to undefined function get_the_title() in /home/todaytra/public_html/1/wp-config.php on line 62

I really need to perform this task, usual WPMU installation generates either subdomains or subfolders and it changes the permalink structure of all posts. I tried searching a lot but cannot find any information about this.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top