잠시만 기다려 주세요

     '시장이나 돌면서 가짜 민생 외치는 이재명을 규탄한다. 싸우지 않을 거면 내려와라... 거기는 당신의 방탄이나 하는 자리가 아니다.'
전체검색 :  
이번주 로또 및 연금번호 발생!!   |  HOME   |  여기는?   |  바다물때표   |  알림 (25)  |  여러가지 팁 (1111)  |  추천 및 재미 (165)  |  자료실 (25)  |  
시사, 이슈, 칼럼, 평론, 비평 (948)  |  끄적거림 (144)  |  문예 창작 (719)  |  바람 따라 (75)  |  시나리오 (760)  |  드라마 대본 (248)  |  
살인!


    postgresql

postgresql - 인덱스 확인, 생성, 삭제, index create, 재인덱싱, 인덱스 사용빈도 확인
이 름 : 바다아이   |   조회수 : 11134         짧은 주소 : 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 .. 바다아이 2362
44 postgresql , count(*) .... 바다아이 9295
43 postgresql How to do an update + join in PostgreSQL?, 바다아이 8435
42 postgresql sequence(퀀) 바다아이 11116
현재글 postgresql , , , index create, , 바다아이 11135
40 postgresql postgresql log_timezone .... 바다아이 8941
39 postgresql postgresql SEQUENCE reset .... 바다아이 10944
38 postgresql [PostgreSql] WITH , , Operator 바다아이 10502
37 postgresql postgresql for, foreach , 바다아이 12016
36 postgresql postgresql , , into ... 바다아이 12148
35 postgresql postgresql PL/pgSQL - SQL Procedural Language, , 바다아이 13815
34 postgresql postgresql ... .. , , 바다아이 15599
33 postgresql postgresql CSV export/import 바다아이 11571
32 postgresql postgresql tablespace , .... 바다아이 16698
31 postgresql postgresql 10 partitioning, ... , ... 바다아이 12095
30 postgresql Using PostgreSQL Arrays, ... ... 바다아이 12266
29 postgresql PostgreSQL (TRIGGER) (function) 바다아이 11356
28 postgresql Optimize and Improve PostgreSQL Performance with VACUUM, ANALYZE, and REINDEX 바다아이 12114
27 postgresql postgresql tuple . vacuumdb .. , . 바다아이 11865
26 postgresql postgresql , .. 바다아이 11839
25 postgresql postgresql , size, 바다아이 13910
24 postgresql postgresql , , .... 바다아이 10696
23 postgresql PostgreSQL Replication, , , master, slave 바다아이 14452
22 postgresql postgresql case 바다아이 10777
21 postgresql postgresql with 바다아이 11204
20 postgresql postgresql , , string 바다아이 15278
19 postgresql Postgresql partitioning table , , , 바다아이 11419
18 postgresql PostgreSQL 바다아이 13166
17 postgresql postgresql vacuumdb, psql, pg_dump password crontab , pgpass 바다아이 13125
16 postgresql postgresql sequence 퀀 auto_increment . 바다아이 12101
| |









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