查詢索引的有效性
創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè),郎溪企業(yè)網(wǎng)站建設(shè),郎溪品牌網(wǎng)站建設(shè),網(wǎng)站定制,郎溪網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,郎溪網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力。可充分滿足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
select d.tablename,a.relname,(case c.indisvalid when true then '有效' else '無效' end) isvalid ,c.indkey from pg_class a ,pg_namespace b ,pg_index c ,pg_indexes d where a.relkind = 'i' and a.relname=b.oid and b.nspname='public' and a.oid = c.indexrelid and d.indexname=a.relname order by d.tablename;
表查詢
select * from pg_table where schemaname = 'xxx';
查詢索引或者表的大小
select pg_size_pretty(pg_relaion_size('test'));
統(tǒng)計(jì)表的行數(shù)
select a.relname,a.reltuples::int from pg_class a ,pg_namespace b where a.relnamespace=b.oid and b.nspname='public' and a.relkind='r' order by a.relname;