<?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>sessions &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/sessions/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>Tue, 16 Jan 2018 11:00:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>Greenplum: Find long running sessions with lock information</title>
		<link>https://www.dbrnd.com/2018/02/greenplum-find-long-running-sessions-with-lock-information-total-execution-time/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 01 Feb 2018 16:16:29 +0000</pubDate>
				<category><![CDATA[Greenplum]]></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[lock]]></category>
		<category><![CDATA[long running queries]]></category>
		<category><![CDATA[PostgreSQL 8.2]]></category>
		<category><![CDATA[sessions]]></category>
		<category><![CDATA[transactions]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4387</guid>

					<description><![CDATA[In this post, I am sharing a script to find long running queries or sessions with the lock information of Greenplum database server. In the below script, you can find the age column which gives you total execution time of running sessions. You can also find query lock related details. [crayon-6a9576285df15413132712/]]]></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%2F2018%2F02%2Fgreenplum-find-long-running-sessions-with-lock-information-total-execution-time%2F&amp;linkname=Greenplum%3A%20Find%20long%20running%20sessions%20with%20lock%20information" 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%2F2018%2F02%2Fgreenplum-find-long-running-sessions-with-lock-information-total-execution-time%2F&amp;linkname=Greenplum%3A%20Find%20long%20running%20sessions%20with%20lock%20information" 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%2F2018%2F02%2Fgreenplum-find-long-running-sessions-with-lock-information-total-execution-time%2F&amp;linkname=Greenplum%3A%20Find%20long%20running%20sessions%20with%20lock%20information" 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%2F2018%2F02%2Fgreenplum-find-long-running-sessions-with-lock-information-total-execution-time%2F&amp;linkname=Greenplum%3A%20Find%20long%20running%20sessions%20with%20lock%20information" 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%2F2018%2F02%2Fgreenplum-find-long-running-sessions-with-lock-information-total-execution-time%2F&amp;linkname=Greenplum%3A%20Find%20long%20running%20sessions%20with%20lock%20information" 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%2F2018%2F02%2Fgreenplum-find-long-running-sessions-with-lock-information-total-execution-time%2F&amp;linkname=Greenplum%3A%20Find%20long%20running%20sessions%20with%20lock%20information" 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%2F2018%2F02%2Fgreenplum-find-long-running-sessions-with-lock-information-total-execution-time%2F&#038;title=Greenplum%3A%20Find%20long%20running%20sessions%20with%20lock%20information" data-a2a-url="https://www.dbrnd.com/2018/02/greenplum-find-long-running-sessions-with-lock-information-total-execution-time/" data-a2a-title="Greenplum: Find long running sessions with lock information"></a></p><p>In this post, I am sharing a script to find long running queries or sessions with the lock information of Greenplum database server. </p>
<p>In the below script, you can find the age column which gives you total execution time of running sessions. You can also find query lock related details.</p>
<pre class="crayon-plain-tag">select 
	age(now(),pg_stat_activity.query_start) as "age",
	pg_stat_activity.datname, pg_stat_activity.usename,
	pg_stat_activity.client_addr, pg_stat_activity.application_name,
	pg_locks.transactionid, pg_locks.transaction,
	pg_stat_activity.procpid, pg_stat_activity.query_start,
	pg_locks.mode, pg_stat_activity.current_query
from  pg_stat_activity, pg_locks
where pg_locks.pid = pg_stat_activity.procpid
and procpid &lt;&gt; pg_backend_pid()
and pg_locks.transactionid = pg_locks.transaction
order by 1 desc;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
