码迷,mamicode.com
首页 > 其他好文 > 详细

取某个表的索引明细

时间:2015-11-18 16:49:55      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:postgresql

select a.relname as indexname,b.attname as colname from pg_class as a, (select attname,attrelid from pg_attribute where attrelid in (select oid from pg_class where relname in (SELECT  c.relname AS index_name FROM (SELECT relname,indexrelid FROM pg_index i, pg_class c WHERE c.relname = ‘sku_attributes‘ AND indrelid = c.oid) t, pg_index i,pg_class c WHERE t.indexrelid = i.indexrelid AND i.indexrelid = c.oid))) as b where a.oid=b.attrelid group by indexname,colname;

取某个表的索引明细

标签:postgresql

原文地址:http://sunxin686.blog.51cto.com/637063/1713931

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!