加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PG索引创建与Oracle的不同

发布时间:2020-12-12 15:17:32 所属栏目:百科 来源:网络整理
导读:刚发现个有趣的地方,pg可以给同一表的相同列创建相同索引N次!太疯狂了!postgres=# create table testind(id int);CREATE TABLEpostgres=# create index on testind (id);CREATE INDEXpostgres=# create index on testind (id);CREATE INDEXpostgres=# cre
刚发现个有趣的地方,pg可以给同一表的相同列创建相同索引N次!太疯狂了!


postgres=# create table testind(id int);
CREATE TABLE
postgres=# create index on testind (id);
CREATE INDEX
postgres=# create index on testind (id);
CREATE INDEX
postgres=# create index on testind (id);
CREATE INDEX
postgres=# create index on testind (id);
CREATE INDEX
postgres=# d+ testind
                       Table "public.testind"
 Column |  Type   | Modifiers | Storage | Stats target | Description 
--------+---------+-----------+---------+--------------+-------------
 id     | integer |           | plain   |              | 
Indexes:
    "testind_id_idx" btree (id)
    "testind_id_idx1" btree (id)
    "testind_id_idx2" btree (id)
    "testind_id_idx3" btree (id)

postgres=# 

那么以后创建索引的时候,要注意不要重复执行了。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读