extract public to schema variable so we can use a constant later

This commit is contained in:
Matthew Bucci
2024-02-21 01:22:57 -08:00
parent ebbe2915c6
commit 61cfa6896d
5 changed files with 12 additions and 9 deletions
+2 -2
View File
@@ -358,7 +358,7 @@ class SelectSQLRewriter extends AbstractSQLRewriter
}
// This method is specifically to handle should_suggest_persistent_object_cache in wp site health
protected function postgresTableSizeRewrite()
protected function postgresTableSizeRewrite($schema = 'public')
{
$sql = <<<SQL
@@ -373,7 +373,7 @@ class SelectSQLRewriter extends AbstractSQLRewriter
INNER JOIN
pg_stat_user_tables S ON (S.relid = C.oid)
WHERE
N.nspname = 'public' AND
N.nspname = $schema AND
C.relname IN ('wp_comments','wp_options','wp_posts','wp_terms','wp_users')
GROUP BY
C.relname, pg_total_relation_size(C.oid), S.n_live_tup;