설문조사
PostgreSQL/PPAS 관련 듣고 싶은 교육은


총 게시물 94건, 최근 0 건
   

Primary key 와 인덱스

글쓴이 : PostgresDBA 날짜 : 2013-07-01 (월) 15:09 조회 : 7060
PostgreSQL 도 Oracle 과 같은 타디비 처럼 primary key 생성시
해당 컬럼에 대해서 자동으로 인덱스가 생성됩니다.
확인해볼까요?

scottb=> create table test(col1 integer primary key);
CREATE TABLE

scottdb=> \d test
     "public.test" 테이블
 필드명 |  형태   | 기타 조건
--------+---------+-----------
 col1   | integer | not null
인덱스들:
    "test_pkey" PRIMARY KEY, btree (col1)


   

postgresdba.com