Skip to content

Instantly share code, notes, and snippets.

View Stafox's full-sized avatar
🇺🇦

Stas K Stafox

🇺🇦
View GitHub Profile
SELECT
nspace.nspname AS schema,
class.relname AS relation,
pg_catalog.pg_total_relation_size(class.oid) AS total_size,
pg_catalog.pg_relation_size(class.oid) AS heap_size,
CASE class.reltoastrelid WHEN 0 THEN NULL ELSE pg_catalog.pg_total_relation_size(class.reltoastrelid) END AS toast_size,
pg_catalog.pg_indexes_size(class.oid) AS idx_size,
stat_t.seq_scan AS seqscan,
stat_t.idx_scan AS idxScan,
CASE (stat_t.n_live_tup+stat_t.n_dead_tup) WHEN 0 THEN 0 ELSE (stat_t.n_tup_upd/(stat_t.n_live_tup+stat_t.n_dead_tup)::float4 * 100)::int END AS changed,
<?php
namespace AppBundle\Extensions\Doctrine\ORM;
use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Connections\MasterSlaveConnection;
use Doctrine\DBAL\DBALException;
class ReopeningConnectionWrapper extends MasterSlaveConnection
{