关于Postgres中的聚集索引

编程入门 行业动态 更新时间:2024-10-24 14:21:24
本文介绍了关于Postgres中的聚集索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用psql访问postgres数据库。在查看表的元数据时,是否可以查看表的索引是否为聚集索引?

I'm using psql to access a postgres database. When viewing the metadata of a table, is there any way to see whether an index of a table is a clustered index?

我听说表的PRIMARY KEY是

I heard that the PRIMARY KEY of a table is automatically associated with a clustered index, is it true?

推荐答案

请注意PostgreSQL使用术语聚集索引来模糊地使用某些东西吗?

Note that PostgreSQL uses the term "clustered index" to use something vaguely similar and yet very different to SQL Server.

如果已将特定索引指定为表的聚集索引,则psql的 \d 命令将指示聚集索引,例如,

If a particular index has been nominated as the clustering index for a table, then psql's \d command will indicate the clustered index, e.g.,

Indexes: "timezone_description_pkey" PRIMARY KEY, btree (timezone) CLUSTER

PostgreSQL默认不将索引指定为聚簇索引。即使这样命名,它也不会自动安排表数据与聚簇索引相关:必须使用CLUSTER命令来重新组织表数据。

PostgreSQL does not nominate indices as clustering indices by default. Nor does it automatically arrange table data to correlate with the clustered index even when so nominated: the CLUSTER command has to be used to reorganise the table data.

更多推荐

关于Postgres中的聚集索引

本文发布于:2023-10-25 08:57:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1526502.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:索引   Postgres

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!