query all table size in postgresql
2024-05-06
query table size
2024-05-05
query database size
2024-05-03
今日想同大家分享一個 PostgresSQL Database maintenance script 用來 reclaim 返 D space 解決方法: VACUUM (FULL, FREEZE, VERBOSE, ANALYZE, SKIP_LOCKED, INDEX_CLEANUP, TRUNCATE); hope you find it useful
2022-08-13
有時候個SQL script 太大.. 如果用 SQL editor 去 run 個 .sql file 好大機會 會crash 我地可以用 command 來 execute 呢個 .sql 我就用呢個方法去Restore database backup 解決方法: psql -h [`hostname`] -U [`username`] -d [`database_name`] -f [`sql_script.sql`] psql -h localhost -U postgres -d local-db -f dump-local-db-20220701150001.sql hope you find it useful
2022-07-03
今日想和大家分享一個 幾有用的TSQL Command, 去 Release 返一些SQL Server 佔用的空間 Transaction log 和Database file -- select database USE Production; -- Change the recovery mode to SIMPLE, to clear the transaction log ALTER DATABASE Production SET RECOVERY SIMPLE ; -- shrink database to release space DBCC SHRINKDATABASE (Production, 1); Hope you find it useful
2018-02-06