PostgreSQL中的集群和非集群索引 [英] Cluster and Non cluster index in PostgreSQL

查看:573
本文介绍了PostgreSQL中的集群和非集群索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PostgreSQL 9.3版本来创建数据库。

I'm using PostgreSQL 9.3 version to create database.

我有一些列表列表的测试表。

I have the following table test with some columns list.

create table test
(
  cola varchar(10),
  colb varchar(10),
  colc varchar(10),
  cold varchar(10)
);

现在我想在某些列上创建索引。

Now I want to create a indexs on some columns.

例如:

我想为列 cola 和<$ c $创建聚簇索引c> colb 。

我想为列创建非聚集索引 colc

And I want to create non clustered index for columns colc and cold.

正如我提到的那样 this 这个,我发现PostgreSQL中没有聚集和非聚集索引。

As I referred this And this ,I come to know that there is no clustered and non clustered index in PostgreSQL.

我的问题:什么我可以使用的索引类型而不是PostgreSQL中的聚簇索引和非聚簇索引,它与集群索引和非聚簇索引的作用相同吗?

My Question: What type of index I can use instead of clustered and non clustered index in PostgreSQL,Which does the same job as clustered and non clustered indexes does?

推荐答案


我的问题:我可以使用什么类型的索引代替集群和非集群PostgreSQL中的ustered索引,它与集群索引和非集群索引的作用相同吗?

My Question: What type of index I can use instead of clustered and non clustered index in PostgreSQL,Which does the same job as clustered and non clustered indexes does?

PostgreSQL没有集群的概念索引。相反,所有表都是堆表,所有索引都是非聚簇索引。

PostgreSQL doesn't have the concept of clustered indexes at all. Instead, all tables are heap tables and all indexes are non-clustered indexes.

只需在创建聚簇索引时创建非聚集索引。

Just create a non-clustered index when you'd usually create a clustered index.

更多详情:

  • http://use-the-index-luke.com/sql/clustering/index-organized-clustered-index
    You might want to read the whole chapter to get proper understanding of these concepts.

这篇关于PostgreSQL中的集群和非集群索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆