Re: Doesn't PostgreSQL clean data in data file after delete records form table?

Поиск
Список
Период
Сортировка
Искать
От
hubert depesz lubaczewski
Тема
Re: Doesn't PostgreSQL clean data in data file after delete records form table?
Дата
Msg-id
20160323103324.GC24410@depesz.com
Ответ на
Список
Дерево обсуждения
Doesn't PostgreSQL clean data in data file after delete records form table? zh1029 <zh1029@sina.com>
Re: Doesn't PostgreSQL clean data in data file after delete records form table? hubert depesz lubaczewski <depesz@depesz.com>
Re: Doesn't PostgreSQL clean data in data file after delete records form table? zh1029 <zh1029@sina.com>
On Wed, Mar 23, 2016 at 03:27:45AM -0700, zh1029 wrote:
> Hi,
>   we are using PostgreSQL 9.3.6 version and observe data file size is not
> decreased after we deleted records from the table. It looks quite abnormal.
> Is it as PostreSQL designed? 
> 
> DBTestPostgres=# select count (*) from test_data ;
>      0
> 
> # ls -l
> total 788932
> .............
> -rw------- 1 _nokfssystestpostgres root *801067008* Mar 23 17:51 32768

Yes, that's perfectly OK. It is due to MVCC mechanisms.

subsequent vacuum (at least in your case) should free the disk space,
and if it doesn't, check other ways, described here:
http://www.depesz.com/2011/07/06/bloat-happens/

Best regards,

depesz

-- 
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

В списке pgsql-general по дате отправления
От: zh1029
Дата:
От: mariusz
Дата:
Сообщение: Re: Including SQL files
FAQ