更新后 PostgreSQL 表是否会自动重新编制索引?
Are PostgreSQL tables automatically re-indexed after an update?
如果我索引一个 PostgreSQL table 然后更新它,我需要重新索引 table 还是它会自动重新索引?
有人可以提供 link PostgreSQL 文档以供进一步阅读吗?到目前为止我已经知道了:
https://www.postgresql.org/docs/9.1/static/sql-createindex.html
indexes in PostgreSQL do not need maintenance or tuning
您不需要手动重新索引。
更多详情请同时阅读
https://www.postgresql.org/docs/current/static/monitoring-stats.html
进一步阅读 PostgreSQL 文档:
Once an index is created, no further intervention is required: the
system will update the index when the table is modified, and it will
use the index in queries when it thinks doing so would be more
efficient than a sequential table scan. But you might have to run the
ANALYZE command regularly to update statistics to allow the query
planner to make educated decisions. See Chapter 14 for information
about how to find out whether an index is used and when and why the
planner might choose not to use an index.
参见:
https://www.postgresql.org/docs/current/static/indexes-intro.html
如果我索引一个 PostgreSQL table 然后更新它,我需要重新索引 table 还是它会自动重新索引?
有人可以提供 link PostgreSQL 文档以供进一步阅读吗?到目前为止我已经知道了: https://www.postgresql.org/docs/9.1/static/sql-createindex.html
indexes in PostgreSQL do not need maintenance or tuning
您不需要手动重新索引。
更多详情请同时阅读 https://www.postgresql.org/docs/current/static/monitoring-stats.html
进一步阅读 PostgreSQL 文档:
Once an index is created, no further intervention is required: the system will update the index when the table is modified, and it will use the index in queries when it thinks doing so would be more efficient than a sequential table scan. But you might have to run the ANALYZE command regularly to update statistics to allow the query planner to make educated decisions. See Chapter 14 for information about how to find out whether an index is used and when and why the planner might choose not to use an index.
参见: https://www.postgresql.org/docs/current/static/indexes-intro.html