https://github.com/lll-lll-lll-lll/postgresql-memo
postgresqlに関する適当なメモ
https://github.com/lll-lll-lll-lll/postgresql-memo
Last synced: about 2 months ago
JSON representation
postgresqlに関する適当なメモ
- Host: GitHub
- URL: https://github.com/lll-lll-lll-lll/postgresql-memo
- Owner: lll-lll-lll-lll
- License: mit
- Created: 2024-07-13T10:21:40.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-15T03:49:33.000Z (10 months ago)
- Last Synced: 2025-01-26T02:52:30.971Z (4 months ago)
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postgresql-memo
postgresqlに関する適当なメモデータベースクラスタの初期化
https://www.postgresql.jp/docs/9.4/app-initdb.html
ディレクトリの親の権限がrootだと実行できないので、ユーザを変更して実行できるようにするためのコマンド
```sh
mkdir -p /usr/local/pgsql/data
chown -R myuser:myuser /usr/local/pgsql
su - myuser
/usr/lib/postgresql/16/bin/initdb -D /usr/local/pgsql/data
```## バキューム処理についてまとめる
VACUUM処理は更新削処理の実行後に不要なデータを削除機能なぜ不要なデータを削除する必要があるのか。
そもそも更新削除なら物理的にデータを更新削除すればこの処理は必要ではないのではないのか?
この疑問の答えはpostgresqlのアーキテクチャを理解すると納得する。参考
https://gihyo.jp/dev/feature/01/dex_postgresql/0002
https://devcenter.heroku.com/ja/articles/postgresql-concurrency