Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Some commonly used queries in postgresql10

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The validity of query index

Select d.tablenamefora.relname, (case c.indisvalid when true then 'valid' else 'invalid' 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.nspnamepromotional 'and a.oid = c.indexrelid and d.indexname=a.relname order by d.tablename

Table query

Select * from pg_table where schemaname = 'xxx'

Query the size of an index or table

Select pg_size_pretty (pg_relaion_size ('test'))

Number of rows in the statistical table

Select a.relname.reltuplesPart int from pg_class a, pg_namespace b where a.relnamespace=b.oid and b.nspnameplates publicized 'and a.relkindflowers' order by a.relname

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report