Hello, I have a technical question about VACUUM I assume all table data is kept in a single file and each index has its single file also. Also I assume that VACUUM cleans the file of 'dead pages' that consist of dead rows only. How does it manage to reduce file size without any locks ? Or which locks are applied ? -- Best regards, Ilia mailto:algolist@manual.ru
Ilia Kantor <algolist@manual.ru> writes:
> How does it manage to reduce file size without any locks ?
It doesn't. The file can only be shortened while holding
AccessExclusiveLock (otherwise we could cause serious problems for
concurrent seqscans). VACUUM FULL has such a lock anyway,
plain VACUUM only tries to truncate if it can acquire such
a lock for a short time at the end of the VACUUM run.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера