잠시만 기다려 주세요

     '책임지지 않는 윤석열 정부를 규탄한다. 입만 벌리면 거짓말.. 범죄 의혹 한트럭... 자신들의 범죄 의혹을 철저히 숨기는 윤석열 정부를 탄핵하자.'
전체검색 :  
이번주 로또 및 연금번호 발생!!   |  HOME   |  여기는?   |  바다물때표   |  알림 (19)  |  여러가지 팁 (1095)  |  추천 및 재미 (163)  |  자료실 (28)  |  
시사, 이슈, 칼럼, 평론, 비평 (799)  |  끄적거림 (142)  |  문예 창작 (719)  |  바람 따라 (75)  |  시나리오 (760)  |  드라마 대본 (248)  |  
살인!


    postgresql

postgresql - 인덱스 확인, 생성, 삭제, index create, 재인덱싱, 인덱스 사용빈도 확인
이 름 : 바다아이   |   조회수 : 10249         짧은 주소 : https://www.bada-ie.com/su/?941591778368
인덱스 확인


SELECT * FROM pg_indexes WHERE tablename = '테이블이름';


인덱스 생성


CREATE INDEX 인덱스이름 ON 테이블이름 USING btree(컬럼1, 컬럼2);


참고) 여러개 칼럼 묶으시면 왼쪽부터 적용됩니다. 검색시 조건에서 컬럼1 빼고 컬럼2 쪽만 있으면 인덱스 폭망입니다.


만약 UNIQUE 중복금지 지정하려면


CREATE UNIQUE INDEX 인덱스이름 ON 테이블이름 USING btree(컬럼1, 컬럼2);


인덱스 삭제


DROP INDEX 인덱스이름


인덱스 다시 재인덱싱....  (인덱스가 손상될 수가 있습니다. 이때 다시 함)


REINDEX INDEX 인덱스명
REINDEX TABLE 테이블명
REINDEX DATABASE 데이타베이스명



인덱스 사용빈도 확인


select schemaname, relname, indexrelname, idx_scan as idx_scan_cnt from pg_stat_user_indexes order by idx_scan;



p.s
PRIMARY KEY 는 자동으로 생성시 인덱스가 잡힙니다.
또한 자동 UNIQUE 지정됩니다.


 
| |





      1 page / 2 page
번 호 카테고리 제 목 이름 조회수
45 postgresql postgresql ... postgresql 14 .. postgresql.conf port 5432 .. 바다아이 1852
44 postgresql , count(*) .... 바다아이 8522
43 postgresql How to do an update + join in PostgreSQL?, 바다아이 7798
42 postgresql sequence(퀀) 바다아이 10260
현재글 postgresql , , , index create, , 바다아이 10250
40 postgresql postgresql log_timezone .... 바다아이 8297
39 postgresql postgresql SEQUENCE reset .... 바다아이 10228
38 postgresql [PostgreSql] WITH , , Operator 바다아이 9441
37 postgresql postgresql for, foreach , 바다아이 11227
36 postgresql postgresql , , into ... 바다아이 11356
35 postgresql postgresql PL/pgSQL - SQL Procedural Language, , 바다아이 12930
34 postgresql postgresql ... .. , , 바다아이 14468
33 postgresql postgresql CSV export/import 바다아이 10600
32 postgresql postgresql tablespace , .... 바다아이 15816
31 postgresql postgresql 10 partitioning, ... , ... 바다아이 11144
30 postgresql Using PostgreSQL Arrays, ... ... 바다아이 11180
29 postgresql PostgreSQL (TRIGGER) (function) 바다아이 10739
28 postgresql Optimize and Improve PostgreSQL Performance with VACUUM, ANALYZE, and REINDEX 바다아이 11365
27 postgresql postgresql tuple . vacuumdb .. , . 바다아이 10955
26 postgresql postgresql , .. 바다아이 11156
25 postgresql postgresql , size, 바다아이 13077
24 postgresql postgresql , , .... 바다아이 9920
23 postgresql PostgreSQL Replication, , , master, slave 바다아이 13505
22 postgresql postgresql case 바다아이 9977
21 postgresql postgresql with 바다아이 10422
20 postgresql postgresql , , string 바다아이 14365
19 postgresql Postgresql partitioning table , , , 바다아이 10790
18 postgresql PostgreSQL 바다아이 12429
17 postgresql postgresql vacuumdb, psql, pg_dump password crontab , pgpass 바다아이 12409
16 postgresql postgresql sequence 퀀 auto_increment . 바다아이 11353
| |









Copyright ⓒ 2001.12. bada-ie.com. All rights reserved.
이 사이트는 리눅스에서 firefox 기준으로 작성되었습니다. 기타 브라우저에서는 다르게 보일 수 있습니다.
[ Ubuntu + GoLang + PostgreSQL + Mariadb ]
서버위치 : 오라클 클라우드 춘천  실행시간 : 0.36849
to webmaster... gogo sea. gogo sea.