整理文档

This commit is contained in:
2022-11-01 23:53:13 +08:00
parent 32464821f2
commit 2a29b73926
10 changed files with 331 additions and 452 deletions

View File

@ -1,4 +1,4 @@
```
```postgresql
SELECT locker.pid,
pc.relname,
locker.mode,
@ -27,12 +27,18 @@ SELECT pg_terminate_backend(14448)
```
playboy=> select pg_size_pretty(pg_total_relation_size('test')); //查看表的总大小,包括索引大小
pg_size_pretty
```postgresql
-- 查看表的总大小,包括索引大小
select pg_size_pretty(pg_total_relation_size('test'));
playboy=> select pg_size_pretty(pg_relation_size('test')); //以KBMBGB的方式来查看表大小
pg_size_pretty
-- 以KBMBGB的方式来查看表大小
select pg_size_pretty(pg_relation_size('test'));
-- 查看最大连接数
show max_connections;
-- 查看当前连接数
SELECT COUNT(*) from pg_stat_activity;
```