GreenPlum 색인 목록 가 져 오기

SELECT n.nspname as "Schema", c.relname as "Name", c2.relname as "Table"
FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_roles r ON r.oid = c.relowner
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid
LEFT JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid
WHERE c.relkind IN ('i','')
AND n.nspname NOT IN ('pg_catalog', 'pg_toast', 'pg_aoseg')
AND c2.relname NOT LIKE '%_prt_%'
ORDER BY 1,2;
 

좋은 웹페이지 즐겨찾기