행위

선택도 카디널리티 Selectivity vs. Cardinality

DB CAFE

Dbcafe (토론 | 기여)님의 2023년 1월 3일 (화) 22:10 판 (새 문서: == 선택도 와 카디날리티 조회 SQL == <source lang=sql> select column name , num_distinct , num_nulls , 1/num distinct selectivity , round (1/num distinct...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
thumb_up 추천메뉴 바로가기


선택도 와 카디날리티 조회 SQL[편집]

select column name
     , num_distinct
     , num_nulls
     , 1/num distinct selectivity
     , round (1/num distinct * t.num rows, 2) cardinality
  from user_tables t
     , user tab columns c
 where t.table name = :tbl
   and c.table_name = t.table name
 order by column id ;