AMA*_*nc. 8 postgresql vacuum postgresql-9.3
I am running a vacuum on a very large table.
When I run it, it says:
bacula=# VACUUM FULL VERBOSE file_partition_19
bacula-# ;
INFO: vacuuming "public.file_partition_19"
INFO: "file_partition_19": found 16242451 removable, 21024161 nonremovable row versions in 900380 pages
DETAIL: 0 dead row versions cannot be removed yet.
CPU 5.14s/14.42u sec elapsed 19.61 sec.
VACUUM
Time: 163784.767 ms
bacula=#
Run Code Online (Sandbox Code Playgroud)
When it does this, it shows up to the CPU line fairly quickly, then waits a long time before it shows the final two lines (+ the prompt). This is reflected in the difference in time - "elapsed 19.61 sec", compared to to the "Time:" of 163 seconds (shown because I set \timing on).
虽然我还没有计时,但两次都是正确的 - 启动命令,等待20秒,然后显示"CPU"行,然后等待大约3分钟,然后打印其余部分.
这是正常的吗?为什么会这样?
它主要是重建表上的所有索引,这是它必须做的,因为基本上“VACUUM FULL”会完全重写表。如果您从表中删除所有索引,则“CPU”行之后几乎不会有延迟。
AFAICT,CPU 使用情况行由通用例程打印,该例程为其他(非完整)真空模式完成大部分工作。在“VACUUM FULL”情况下没有意义。
如果您担心这需要太长时间,我建议您查看PostgreSQL wiki 中的“何时使用 VACUUM FULL 以及何时不使用”。当人们使用 VACUUM FULL 时,十分之九的人实际上不应该使用 VACUUM FULL。
| 归档时间: |
|
| 查看次数: |
908 次 |
| 最近记录: |