We will do it by calling the built in WordPress function get_num_queries . For WordPress via the Ac min panel we log in to the FTP server go to the directory of our default Twenty Twenty One theme and in the file footer.php at the very bottom before the body tag add p Number of queries to the MariaDB database php echo get_num_queries p By calling the above code when entering our WordPress website the result of the number of SQL queries that WordPress has performed will appear at the bottom.
The first time the result will not take into account Redis caching because according to what we said earlier the data must first go from the database to Redis and only on subsequent calls will the pages be read Phone Number List from it. When we first enter the page we get a result of SQL queries. So we refresh the page and the result is only ! So Redis reduced the number of database queries from to or by almost %! And we're talking about WordPress with virtually no content that has just been installed.
Number of SQL tasks in WordPress Website | n For the purposes of our tests let's take a closer look at an extensive store based on WooCommerce. We do not change the way we test the number of database queries. Here we also insert at the end of the footer.php file of the used theme a reference to the built in WordPress function get_num_queries . To load our store more with queries we also install sample data for WooCommerce. Time for a test. The first launch of the store gives us the result of SQL queries. Refreshing the page reads data from Redis.