<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pg_stat_all_indexes &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/pg_stat_all_indexes/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 31 May 2017 03:24:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>Greenplum: Script to find the size and usage statistics of Indexes</title>
		<link>https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/</link>
					<comments>https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 08 Jun 2017 16:16:56 +0000</pubDate>
				<category><![CDATA[Greenplum]]></category>
		<category><![CDATA[Greenplum DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Greenplum Administrator]]></category>
		<category><![CDATA[Greenplum Error]]></category>
		<category><![CDATA[Greenplum Monitoring]]></category>
		<category><![CDATA[Greenplum Performance Tuning]]></category>
		<category><![CDATA[Greenplum Programming]]></category>
		<category><![CDATA[Greenplum Query]]></category>
		<category><![CDATA[Greenplum Tips and Tricks]]></category>
		<category><![CDATA[index usage]]></category>
		<category><![CDATA[pg_stat_all_indexes]]></category>
		<category><![CDATA[PostgreSQL 8.2]]></category>
		<category><![CDATA[Statistics]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5373</guid>

					<description><![CDATA[In this post, I am sharing a script to find the size and usage statistics of Greenplum Indexes. Having the complete knowledge of our database indexes is imperative. We should check the size and usage of indexes. Recently, I started my work with Greenplum which based on PostgreSQL 8.2, so I am sharing a script [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20the%20size%20and%20usage%20statistics%20of%20Indexes" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20the%20size%20and%20usage%20statistics%20of%20Indexes" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20the%20size%20and%20usage%20statistics%20of%20Indexes" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20the%20size%20and%20usage%20statistics%20of%20Indexes" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20the%20size%20and%20usage%20statistics%20of%20Indexes" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes%2F&amp;linkname=Greenplum%3A%20Script%20to%20find%20the%20size%20and%20usage%20statistics%20of%20Indexes" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fgreenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes%2F&#038;title=Greenplum%3A%20Script%20to%20find%20the%20size%20and%20usage%20statistics%20of%20Indexes" data-a2a-url="https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/" data-a2a-title="Greenplum: Script to find the size and usage statistics of Indexes"></a></p><p>In this post, I am sharing a script to find the size and usage statistics of Greenplum Indexes. Having the complete knowledge of our database indexes is imperative. We should check the size and usage of indexes.</p>
<p>Recently, I started my work with Greenplum which based on PostgreSQL 8.2, so I am sharing a script to check index usage in Greenplum.</p>
<pre class="crayon-plain-tag">SELECT
    t.schemaname AS schema_name
    ,t.tablename AS table_name
    ,indexname AS index_name
    ,c.reltuples AS num_rows
    ,pg_size_pretty(pg_relation_size(quote_ident(t.tablename)::text)) AS table_size
    ,pg_size_pretty(pg_relation_size(quote_ident(indexrelname)::text)) AS index_size
    ,CASE WHEN indisunique THEN 'Y'
       ELSE 'N'
    END AS UNIQUE
    ,idx_scan AS number_of_scans
    ,idx_tup_read AS tuples_read
    ,idx_tup_fetch AS tuples_fetched
FROM pg_tables t
LEFT OUTER JOIN pg_class c ON t.tablename=c.relname
LEFT OUTER JOIN
( SELECT c.relname AS ctablename, ipg.relname AS indexname, x.indnatts AS number_of_columns, idx_scan, idx_tup_read, idx_tup_fetch, indexrelname, indisunique FROM pg_index x
   JOIN pg_class c ON c.oid = x.indrelid
   JOIN pg_class ipg ON ipg.oid = x.indexrelid
   JOIN pg_stat_all_indexes psai ON x.indexrelid = psai.indexrelid )
AS t1
ON t.tablename = t1.ctablename;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/06/greenplum-script-to-find-the-size-and-usage-statistics-of-indexes-pg_stat_all_indexes/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
