I am developing a self-service Wordpress Wordpress website.
On one of the pages, I launched a function that executes a query to the wordpress database to check that the message has already been published or not, I compare the header to check it.
Here is my request:
$wpdb->get_row("SELECT id FROM wp_posts WHERE post_title = '" . $title . "'", 'ARRAY_A');
So, I check if the $ header has been published or not, but I'm afraid if the number of messages grows, let it say 1 million messages, I am afraid that it will be very slow.
Any suggestion on how to make this query faster? I heard about CREATE INDEX and mysql caching, but I don’t understand how to implement it .. any explanations and recommendations on the links would be much appreciated.
source
share