No, the explains don&#39;t use function. <div><br></div><div>This is the explain: </div><div><br></div><div><div><br></div><div><div>EXPLAIN SELECT a.adid AS a__adid, a.md5 AS a__md5, a.site AS a__site, a.published AS a__published, a.imported AS a__imported, a.year AS a__year, a.mileage AS a__mileage, a.price AS a__price, a.make AS a__make, a.model AS a__model, a.location AS a__location, a.title AS a__title, a.description AS a__description, a.specials AS a__specials, a.source_url AS a__source_url, a.image_url AS a__image_url, a.num_images AS a__num_images, a.version AS a__version, a.fuel AS a__fuel, a.colour AS a__colour, a.transmission AS a__transmission, a.body AS a__body, a.category AS a__category </div>
<div>FROM insertion a </div><div>WHERE (a.make = &#39;fiat&#39; AND a.i_fulltext @@ to_tsquery(&#39;italian&#39;, &#39;doblo&#39;) AND a.adid NOT IN (&#39;20120423.041004.362964&#39;) AND a.i_fulltext @@ to_tsquery(&#39;italian&#39;, &#39;(metano)&#39;) AND a.i_location @@ &#39;puglia&#39;::tsquery AND a.published &gt;= &#39;2012/06/11&#39;) ORDER BY a.published DESC NULLS LAST LIMIT 1000;</div>
<div><br></div><div><br></div><div>Result ---- Server A -------</div><div><br></div><div><br></div><div>Limit  (cost=713.46..713.46 rows=1 width=952)</div><div>   -&gt;  Sort  (cost=713.46..713.46 rows=1 width=952)</div><div>
         Sort Key: published</div><div>         -&gt;  Bitmap Heap Scan on insertion a  (cost=669.45..713.45 rows=1 width=952)</div><div>               Recheck Cond: ((i_fulltext @@ &#39;&#39;&#39;dobl&#39;&#39;&#39;::tsquery) AND (i_fulltext @@ &#39;&#39;&#39;met&#39;&#39;&#39;::tsquery) AND (i_location @@ &#39;&#39;&#39;puglia&#39;&#39;&#39;::tsquery))</div>
<div>               Filter: (((adid)::text &lt;&gt; &#39;20120423.041004.362964&#39;::text) AND (published &gt;= &#39;2012-06-11 00:00:00&#39;::timestamp without time zone) AND ((make)::text = &#39;fiat&#39;::text))</div>
<div>               -&gt;  BitmapAnd  (cost=669.45..669.45 rows=11 width=0)</div><div>                     -&gt;  Bitmap Index Scan on insertion_i_fulltext_idx  (cost=0.00..37.84 rows=184 width=0)</div><div>                           Index Cond: ((i_fulltext @@ &#39;&#39;&#39;dobl&#39;&#39;&#39;::tsquery) AND (i_fulltext @@ &#39;&#39;&#39;met&#39;&#39;&#39;::tsquery))</div>
<div>                     -&gt;  Bitmap Index Scan on insertion_i_location_idx  (cost=0.00..631.36 rows=59648 width=0)</div><div>                           Index Cond: (i_location @@ &#39;&#39;&#39;puglia&#39;&#39;&#39;::tsquery)</div>
<div>(11 rows)</div><div><br></div><div><br></div><div><br></div><div>Result ---- Server B -------</div><div><br></div><div><br></div><div> Limit  (cost=678.00..678.00 rows=1 width=957)</div><div>   -&gt;  Sort  (cost=678.00..678.00 rows=1 width=957)</div>
<div>         Sort Key: published</div><div>         -&gt;  Bitmap Heap Scan on insertion a  (cost=37.63..677.99 rows=1 width=957)</div><div>               Recheck Cond: ((i_fulltext @@ &#39;&#39;&#39;dobl&#39;&#39;&#39;::tsquery) AND (i_fulltext @@ &#39;&#39;&#39;met&#39;&#39;&#39;::tsquery))</div>
<div>               Filter: (((adid)::text &lt;&gt; &#39;20120423.041004.362964&#39;::text) AND (i_location @@ &#39;&#39;&#39;puglia&#39;&#39;&#39;::tsquery) AND (published &gt;= &#39;2012-06-11 00:00:00&#39;::timestamp without time zone) AND ((make)::text = &#39;fiat&#39;::text))</div>
<div>               -&gt;  Bitmap Index Scan on insertion_i_fulltext_idx  (cost=0.00..37.63 rows=163 width=0)</div><div>                     Index Cond: ((i_fulltext @@ &#39;&#39;&#39;dobl&#39;&#39;&#39;::tsquery) AND (i_fulltext @@ &#39;&#39;&#39;met&#39;&#39;&#39;::tsquery))</div>
<div>(8 righe)</div></div></div><div><br></div><div><br></div><div> I will resolve this problem (different result) soon. It&#39;s possible execute explain  only server A or only server B ? </div><div><br></div><div>Regards</div>
<div><br></div><div><br><div class="gmail_quote">2012/6/13 Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Do those failed &quot;complex&quot; EXPLAINs contain funcation calls, especially<br>
nextval or setval?  If so, I think it&#39;s the case where pgpool has a<br>
logical error I have just found. Pgpool first checks if the query is<br>
EXPLAIN (and not EXPLAIN ANALYZE). If so, it&#39;s ok to load<br>
balance. Problem is the next step. Pgpool looks into the EXPLAIN and<br>
if it finds a function call, it sends to all PostgreSQL nodes because<br>
the function might modify database. Of course this is nonsense, since<br>
plain EXPLAIN does nothing to database...<br>
<div class="HOEnZb"><div class="h5">--<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>
&gt; No, a few Explain cause errors.<br>
&gt; The trivial explain is ok. The complex explain causes this error :(<br>
&gt; In fact, as I have seen,  even if the table has the same row/index, the<br>
&gt; explain gives differen results. I will resolve this soon.<br>
&gt; I want that the explain gets only done on the master node. Only one node.<br>
&gt; Does  the configuration “replicate_explain = off” exist ???<br>
&gt;<br>
&gt; Thanks for your answer.<br>
&gt;<br>
&gt; Nicolas<br>
&gt;<br>
&gt; 2012/6/13 Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt;<br>
&gt;<br>
&gt;&gt; Even trivial explain like &quot;EXPLAIN SELECT 1&quot; causes errors?<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>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt; I would like to know if I can exclude the command EXPLAIN from the<br>
&gt;&gt; pgpool.<br>
&gt;&gt; &gt; It generates a lot of errors:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 2012-06-13 09:35:11 ERROR: pid 15204: read_kind_from_backend: 1 th kind C<br>
&gt;&gt; &gt; does not match with master or majority connection kind D<br>
&gt;&gt; &gt; 2012-06-13 09:35:11 ERROR: pid 15204: kind mismatch among backends.<br>
&gt;&gt; &gt; Possible last query was: &quot;EXPLAIN SELECT ...... &quot; kind details are: 0[D]<br>
&gt;&gt; &gt; 1[C]<br>
&gt;&gt; &gt; 2012-06-13 09:35:11 LOG:   pid 15204: do_child: exits with status 1 due<br>
&gt;&gt; to<br>
&gt;&gt; &gt; error<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; pool-II-3.1.3<br>
&gt;&gt; &gt; PostgreSQL 9.1.2<br>
&gt;&gt; &gt; both Server same Hardware.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Pgpool configuration:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; listen_addresses = &#39;*&#39;<br>
&gt;&gt; &gt; port = 5432<br>
&gt;&gt; &gt; socket_dir = &#39;/var/run/postgresql&#39;<br>
&gt;&gt; &gt; pcp_port = 9898<br>
&gt;&gt; &gt; pcp_socket_dir = &#39;/tmp&#39;<br>
&gt;&gt; &gt; backend_hostname0 = &#39;localhost&#39;<br>
&gt;&gt; &gt; backend_port0 = 5434<br>
&gt;&gt; &gt; backend_weight0 = 1<br>
&gt;&gt; &gt; backend_data_directory0 = &#39;/var/lib/postgresql/9.1/main&#39;<br>
&gt;&gt; &gt; backend_flag0 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt; backend_hostname1 = &#39;172.16.0.1&#39;<br>
&gt;&gt; &gt; backend_port1 = 5434 #doveva essere a 5434<br>
&gt;&gt; &gt; backend_weight1 = 1<br>
&gt;&gt; &gt; backend_data_directory1 = &#39;/var/lib/postgresql/9.1/main&#39;<br>
&gt;&gt; &gt; backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt; enable_pool_hba = off<br>
&gt;&gt; &gt; authentication_timeout = 60<br>
&gt;&gt; &gt; # - SSL Connections -<br>
&gt;&gt; &gt; num_init_children = 32<br>
&gt;&gt; &gt; max_pool = 10<br>
&gt;&gt; &gt; child_life_time = 300<br>
&gt;&gt; &gt; child_max_connections = 0<br>
&gt;&gt; &gt; connection_life_time = 0<br>
&gt;&gt; &gt; client_idle_limit = 0<br>
&gt;&gt; &gt; log_destination = &#39;stderr&#39;<br>
&gt;&gt; &gt; print_timestamp = on<br>
&gt;&gt; &gt; log_connections = off<br>
&gt;&gt; &gt; log_hostname = on<br>
&gt;&gt; &gt; log_statement = off<br>
&gt;&gt; &gt; log_per_node_statement = off<br>
&gt;&gt; &gt; log_standby_delay = &#39;none&#39;<br>
&gt;&gt; &gt; syslog_facility = &#39;LOCAL0&#39;<br>
&gt;&gt; &gt; syslog_ident = &#39;pgpool&#39;<br>
&gt;&gt; &gt; debug_level = 0<br>
&gt;&gt; &gt; pid_file_name = &#39;/var/run/pgpool/pgpool.pid&#39;<br>
&gt;&gt; &gt; logdir = &#39;/tmp&#39;<br>
&gt;&gt; &gt; connection_cache = on<br>
&gt;&gt; &gt; reset_query_list = &#39;ABORT; DISCARD ALL&#39;<br>
&gt;&gt; &gt; replication_mode = on<br>
&gt;&gt; &gt; replicate_select = off<br>
&gt;&gt; &gt; insert_lock = on<br>
&gt;&gt; &gt; lobj_lock_table = &#39;&#39;<br>
&gt;&gt; &gt; replication_stop_on_mismatch = off<br>
&gt;&gt; &gt; failover_if_affected_tuples_mismatch = off<br>
&gt;&gt; &gt; load_balance_mode =  off<br>
&gt;&gt; &gt; ignore_leading_white_space = on<br>
&gt;&gt; &gt; white_function_list = &#39;&#39;<br>
&gt;&gt; &gt; black_function_list = &#39;nextval,setval&#39;<br>
&gt;&gt; &gt; master_slave_mode = off<br>
&gt;&gt; &gt; sr_check_period = 0<br>
&gt;&gt; &gt; sr_check_user = &#39;nobody&#39;<br>
&gt;&gt; &gt; sr_check_password = &#39;&#39;<br>
&gt;&gt; &gt; delay_threshold = 0<br>
&gt;&gt; &gt; follow_master_command = &#39;&#39;<br>
&gt;&gt; &gt; parallel_mode = off<br>
&gt;&gt; &gt; enable_query_cache = off<br>
&gt;&gt; &gt; pgpool2_hostname = &#39;localhost&#39;<br>
&gt;&gt; &gt; system_db_hostname  = &#39;localhost&#39;<br>
&gt;&gt; &gt; system_db_port = 5434<br>
&gt;&gt; &gt; system_db_dbname = &#39;pgpool&#39;<br>
&gt;&gt; &gt; system_db_schema = &#39;pgpool_catalog&#39;<br>
&gt;&gt; &gt; system_db_user = &#39;pgpool&#39;<br>
&gt;&gt; &gt; system_db_password = &#39;&#39;<br>
&gt;&gt; &gt; health_check_period = 0<br>
&gt;&gt; &gt; health_check_timeout = 20<br>
&gt;&gt; &gt; health_check_user = &#39;nobody&#39;<br>
&gt;&gt; &gt; health_check_password = &#39;&#39;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ------------------------------------<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The answers about these questions are welcome.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Best Regards<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Nicolas<br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>