2014-04-23 7 views
1

인덱스 및 테이블에 대한 fillfactor를 확인하는 기능이있을 수 있습니까? 이미 \ d +를 시도했지만 fillfactor 값이없는 기본 정의 만 있습니다.테이블 및 인덱스에 대한 fillfactor 설정 확인

 Index "public.tab1_pkey" 
Column | Type | Definition | Storage 
--------+--------+------------+--------- 
id  | bigint | id   | plain 
primary key, btree, for table "public.tab1" 

표가 없습니다. 테이블이 기본 이외의 FILLFACTOR로 만든 경우 :

CREATE TABLE distributors (
    did  integer, 
    name varchar(40), 
    UNIQUE(name) WITH (fillfactor=70) 
) 
WITH (fillfactor=70); 

그런 다음 \d+ distributors 표준이 아닌 FILLFACTOR를 보여줍니다.

      Table "public.distributors"                                   
Column |   Type   | Modifiers | Storage | Stats target | Description                            
--------+-----------------------+-----------+----------+--------------+-------------                           
did | integer    |   | plain |    |                               
name | character varying(40) |   | extended |    |                               
Indexes:                                              
    "distributors_name_key" UNIQUE CONSTRAINT, btree (name) WITH (fillfactor=70)                            
Has OIDs: no 
Options: fillfactor=70 

출력 파싱없이이 값을 얻을 수있는 방법이 있습니까?

답변

3

당신은 pg_class 시스템 테이블을 쿼리해야합니다

select t.relname as table_name, 
     t.reloptions 
from pg_class t 
    join pg_namespace n on n.oid = t.relnamespace 
where t.relname in ('tab11_pkey', 'tab1') 
    and n.nspname = 'public' 

reloptionsoption=value 정의를 포함하는 각 요소에, 배열입니다. 그러나 기본 옵션이있는 릴레이션의 경우 null이됩니다.