当前位置:   article > 正文

PG重建索引_pgsql加上索引失效,重新设置索引

pgsql加上索引失效,重新设置索引
postgres=# select version();
                                                        version                                                         
------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.1.22 on x86_64-unknown-linux-gnu, compiled by GCC gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
(1 row)

注意:reindex 会造成全表锁。


postgres=# reindex index t_idx;    -->重建单个索引
REINDEX


postgres=# reindex table test;     -->重建和表test有关的索引
REINDEX


postgres@linux-o8rc:~> reindexdb postgres    -->重建postgres数据库下所有的索引
NOTICE:  table "pg_class" was reindexed
NOTICE:  table "pg_class" was reindexed
NOTICE:  table "sql_features" was reindexed
NOTICE:  table "sql_features" was reindexed
NOTICE:  table "sql_implementation_info" was reindexed
NOTICE:  table "sql_im
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/741192
推荐阅读
相关标签
  

闽ICP备14008679号