<div dir="ltr"><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Hello,<div><br></div><div>At first, I&#39;m sorry I&#39;m not good at English.</div><div><br></div><div><br></div><div>I&#39;d installed Pgpool 3.7.2 and two Postgres 10.3 instances, and configure a master-slave mode cluster. I turned on also load_balancing_mode.</div><div><br></div><div>When I was testing and looking into logs, I found that pgpool sent backend0 several extray queries &quot;SELECT count(*) ...&quot; for every simple select query:</div><div><br></div><div><br></div><div># what I did: (23140 is pgpool port)</div><div>$ psql -h 127.0.0.1 -p 23140 -U postgres test -c &quot;select * from mytable;&quot;</div><div><br></div><div><br></div><div># what the pgpool log showed (timestamp omitted)</div><div><div><div><div>pid 1583: LOG:  DB node id: 0 backend pid: 469 statement: SELECT count(*) from (SELECT has_function_privilege(&#39;<wbr>postgres&#39;, &#39;to_regclass(cstring)&#39;, &#39;execute&#39;) WHERE EXISTS(SELECT * FROM pg_catalog.pg_proc AS p WHERE p.proname = &#39;to_regclass&#39;)) AS s</div><div><br></div><div>pid 1583: LOG:  DB node id: 0 backend pid: 469 statement: SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = &#39;pg_namespace&#39;</div><div><br></div><div>pid 1583: LOG:  DB node id: 0 backend pid: 469 statement: SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.oid = to_regclass(&#39;&quot;mytable&quot;&#39;) AND c.relnamespace = n.oid AND n.nspname = &#39;pg_catalog&#39;</div><div><br></div><div>pid 1583: LOG:  DB node id: 0 backend pid: 469 statement: SELECT count(*) FROM pg_catalog.pg_class AS c, pg_attribute AS a WHERE c.relname = &#39;pg_class&#39; AND a.attrelid = c.oid AND a.attname = &#39;relistemp&#39;</div><div><br></div><div>pid 1583: LOG:  DB node id: 0 backend pid: 469 statement: SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.relname = &#39;mytable&#39; AND c.relnamespace = n.oid AND n.nspname ~ &#39;^pg_temp_&#39;</div><div><br></div><div>pid 1583: LOG:  DB node id: 0 backend pid: 469 statement: SELECT count(*) FROM pg_catalog.pg_class AS c, pg_catalog.pg_attribute AS a WHERE c.relname = &#39;pg_class&#39; AND a.attrelid = c.oid AND a.attname = &#39;relpersistence&#39;</div><div><br></div><div>pid 1583: LOG:  DB node id: 0 backend pid: 469 statement: SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.oid = to_regclass(&#39;&quot;mytable&quot;&#39;) AND c.relpersistence = &#39;u&#39;</div><div><br></div><div>pid 1583: LOG:  DB node id: 1 backend pid: 2312 statement: select * from mytable;</div></div></div></div><div><br></div><div><br></div><div>I tried more cases and observed:</div><div>1) INSERT and UPDATE queries do not make these extra queries. Only SELECT query does.</div><div><br></div><div>2) The extra queries were always sent to backend#0, regardless of whether it was primary or standby.</div><div><br></div><div><br></div><div>I&#39;d like to ask:</div><div>1) Is this a normal operation or some signal that something is wrong?</div><div><br></div><div>2) If it is a ordinary operation, is it ok? I mean, couldn&#39;t it be too much overhead, if 7 more queries are sent for every 1 &quot;SELECT&quot; query?</div><div><br></div><div><br></div><div><br></div><div>Thank  you.</div><div>gypark from South Korea.</div></div>

<br></div>