<div dir="ltr"><div>I have just cut out some parts of the log, as it generates mbs of logs a minute as I believe this is what you want, as you can see it doesn&#39;t seem to be caching:</div><div><br></div>2013-12-04 07:02:19 LOG:   pid 17148: DB node id: 0 backend pid: 6475 statement: SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = &#39;table&#39; AND c.relpersistence = &#39;u&#39;<br>
<div>2013-12-04 07:02:19 LOG:   pid 17173: DB node id: 0 backend pid: 6463 statement: SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = &#39;table&#39; AND c.relpersistence = &#39;u&#39;<br></div><div>2013-12-04 07:02:19 LOG:   pid 17179: DB node id: 0 backend pid: 6462 statement: SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = &#39;table&#39; AND c.relpersistence = &#39;u&#39;<br>
</div><div><br></div><div>let me know if this is not what you wanted, we are currently using pgpool: 3.3.0 with postgres 9.1</div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(34,34,34)"><b>Nathan Brennan</b> </span><span style="color:rgb(34,34,34)"><i>BCS</i></span><div><span style="color:rgb(34,34,34)">Lead Developer</span></div><div><br></div><div><b>T:</b> <a value="+61894823986" style="color:rgb(17,85,204)">+61 8 9482 3981</a> | <b>E:</b> <a href="mailto:nathan@healthengine.com.au" style="color:rgb(17,85,204)" target="_blank">nathan@healthengine.com.au</a><div>
<div style="color:rgb(34,34,34)"><br></div><div style="color:rgb(34,34,34)"><a href="http://healthengine.com.au/" style="color:rgb(17,85,204)" target="_blank"><img src="http://healthengine.com.au/images/emailsig-helogo.png"></a>     <a href="https://twitter.com/healthengine" style="color:rgb(17,85,204)" target="_blank"><img src="http://healthengine.com.au/images/emailsig-twitter.png"></a>  <a href="https://www.facebook.com/HealthEngine" style="color:rgb(17,85,204)" target="_blank"><img src="http://healthengine.com.au/images/emailsig-facebook.png"></a><br>
</div></div></div><div style="color:rgb(34,34,34)"><br></div><div style="color:rgb(34,34,34)"><img src="http://healthengine.com.au/images/emailsig-no1.png"></div></div></div></div>
<br><br><div class="gmail_quote">On Wed, Dec 4, 2013 at 2:40 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">&gt; ok thanks,<br>
&gt;<br>
&gt; I have disabled the check_temp_table as we don&#39;t use temp tables which<br>
&gt; removes the pg_temp queries, however there is still alot of queries for<br>
&gt; SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = &#39;table&#39; AND<br>
&gt; c.relpersistence = &#39;u&#39; to me this seems like a check to see if the table<br>
&gt; exists, is there a way to cache this ?<br>
<br>
</div>I thought this one is cached. Can you show me pgpool.log with<br>
log_per_node_statement enabled?<br>
<div class="im">--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
</div>&gt; *Nathan Brennan* *BCS*<br>
&gt; Lead Developer<br>
&gt;<br>
&gt; *T:* <a href="tel:%2B61%208%209482%203981" value="+61894823981">+61 8 9482 3981</a> | *E:* <a href="mailto:nathan@healthengine.com.au">nathan@healthengine.com.au</a><br>
&gt;<br>
&gt; &lt;<a href="http://healthengine.com.au/" target="_blank">http://healthengine.com.au/</a>&gt;      &lt;<a href="https://twitter.com/healthengine" target="_blank">https://twitter.com/healthengine</a>&gt;<br>
&gt; &lt;<a href="https://www.facebook.com/HealthEngine" target="_blank">https://www.facebook.com/HealthEngine</a>&gt;<br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Dec 4, 2013 at 12:51 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Is there a way to cache these queries or turn them off as pgpool is doing<br>
&gt;&gt; &gt; thousands of them a second.I tried setting relcache_expire=60 but it<br>
&gt;&gt; &gt; doesn&#39;t seem to help.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; example queries:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.relname =<br>
&gt;&gt; &gt; &#39;table&#39; AND c.relnamespace = n.oid AND n.nspname = &#39;pg_catalog&#39;<br>
&gt;&gt; &gt;  SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.relname =<br>
&gt;&gt; &gt; &#39;table&#39; AND c.relnamespace = n.oid AND n.nspname ~ &#39;^pg_temp_&#39;<br>
&gt;&gt;<br>
&gt;&gt; You can avoid temp table related queries by turning check_temp_table<br>
&gt;&gt; to off (of course you need to be sure that you are not using temp<br>
&gt;&gt; tables).<br>
&gt;&gt;<br>
&gt;&gt; Also relcache_expire = 0 will be more effective if you want to reduce<br>
&gt;&gt; the number of queries.<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>