You can configure PDO v20 to automatically run an EXPLAIN plan on any query that crosses a specific execution time threshold, outputting the diagnostic data straight to your system logs for rapid debugging.

$options = [ PDO::ATTR_PERSISTENT => true, PDO::ATTR_POOL_SIZE => 20 ]; $pdo = new PDO('mysql:host=localhost', 'root', 'secret', $options); // Switch to Tenant A context $pdo->switchTenantContext('tenant_a_db'); $tenantData = $pdo->query("SELECT * FROM settings")->fetchAll(); // Switch to Tenant B context $pdo->switchTenantContext('tenant_b_db'); Use code with caution.

#[Entity(table: 'users')] class User #[Column(type:'integer', primary: true)] private int $id; #[Column(type:'string')] private string $email;