Created
November 6, 2017 20:32
-
-
Save kingkool68/0bfde37a818e70de857ac95f0d4e0ea3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add `SQL_NO_CACHE` to every SELECT statement | |
// Helpful for debugging query performance | |
add_filter( 'query', function( $query ) { | |
$query = preg_replace( '/SELECT(\s)/i', 'SELECT SQL_NO_CACHE$1', $query, 1 ); | |
return $query; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment