db
mysql 모든 table, key, index...etc 확인
sunny___
2022. 5. 19. 11:23
반응형
- 테이블확인
- select * from information_schema.tables where table_name='tb_rc_term_multi_lang';
- foreign key, primary key, unique (idx) 등 테이블에 있는 constraint 이름과 타입 확인
- select * from information_schema.table_constraints where table_name='tb_rc_term_multi_lang';
- 각 constraint가 어떤 테이블, 컬럼, 순서로 구성되는지 확인
- select * from information_schema.KEY_COLUMN_USAGE where referenced_table_name='tb_rc_term'
- 특정 테이블을 사용하는 모든 foreign key 확인가능 -> 외래키때문에 테이블 삭제 안될 때 유용
- index 상세정보 확인
- select * from information_schema.STATISTICS where table_name='tb_rc_term_multi_lang';
반응형