воскресенье, 13 января 2019 г.

Понимание производительности Postgres

Понимание производительности Postgres
pg-extras
heroku-pg-extras
pg-extras


python-pgextras
python-pgextras-doc

#$ git clone https://github.com/scottwoodall/python-pgextras.git
#$ cd python-pgextras
#$ sudo python setup.py install
$ sudo apt install python-pip
$ pip install pgextras
$ pip install --upgrade pip
$ pip install psycopg2-binary --user
$ pgextras -dsn "dbname='demo' user='postgres' host='localhost' port=5432 password='pass'" -methods cache_hit

cache_hit
###############################################################################
+----------------+------------------------+
| name           | ratio                  |
+----------------+------------------------+
| index hit rate | 0.98541833443308223331 |
| table hit rate | 0.91440228445786790547 |
+----------------+------------------------+
$ free -m
              total        used        free      shared  buff/cache   available
Память:       16040        1470       12091         217        2478       13973
Подкачка:           0           0           0








$ pgextras -dsn "dbname='demo' user='postgres' host='localhost' port=5432" -methods total_table_size

+-----------------------------+------------+
| name                        | size       |
+-----------------------------+------------+
| _accumrg12451               | 189 MB     |
| _inforg33069                | 154 MB     |
| _crg665                     | 140 MB     |
| config                      | 134 MB     |
| _accumrg12028               | 133 MB     |
| _accumrg12274               | 106 MB     |
| _accumrgt12287              | 88 MB      |
| _accumrgtn12473             | 75 MB      |
| _accumrg12518               | 63 MB      |

Комментариев нет:

Отправить комментарий