gin_clean_pending_list() 是一个系统函数,用于将待处理 GIN 条目的列表移入主索引结构。
gin_clean_pending_list() 添加于 PostgreSQL 9.6。
用法
gin_clean_pending_list (indexregclass) →bigint
返回从待处理列表中移除的页面数。
此函数对禁用了 fastupdate 选项的 GIN 索引没有影响,并且在该类索引上执行时将始终返回 0。
如果提供的索引不是 GIN 类型或不存在,则会引发 ERROR。
请注意,GIN 待处理列表的页面数可以使用 pgstatginindex() 函数查询,该函数在 pgstattuple 扩展中可用。
变更历史
- PostgreSQL 9.6
- 添加于 (提交 7f46eaf0)
示例
gin_clean_pending_list() 的基本用法示例
postgres# SELECT gin_clean_pending_list('content_ts_vector_ix');
gin_clean_pending_list
------------------------
46
(1 row)
尝试在不存在的索引上执行 gin_clean_pending_list()
postgres# SELECT gin_clean_pending_list('foo_ix');
ERROR: relation "foo_ix" does not exist
LINE 1: SELECT gin_clean_pending_list('foo_ix');
尝试在非 GIN 索引上执行 gin_clean_pending_list()
SELECT gin_clean_pending_list('content_version_pkey');
ERROR: "content_version_pkey" is not a GIN index
尝试在非索引上执行 gin_clean_pending_list()
postgres# SELECT gin_clean_pending_list('content_version');
ERROR: "content_version" is not an index
参考资料
- PostgreSQL 文档: 索引维护函数
