Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aJLUV-0005LW-1M for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jan 2016 13:29:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aJLUU-0006dY-KC for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jan 2016 13:29:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aJLT9-0002qR-80 for pgsql-hackers@postgresql.org; Wed, 13 Jan 2016 13:28:11 +0000 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aJLT6-0005fA-MS for pgsql-hackers@postgresql.org; Wed, 13 Jan 2016 13:28:10 +0000 Received: by mail-lb0-x234.google.com with SMTP id cl12so73094502lbc.1 for ; Wed, 13 Jan 2016 05:28:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joh-to.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=US5apO/sh9GOuDeAfmoDvLxwtYb6JjPANV6aibwfBuA=; b=cxFdol8y1z9UyXh1ps/Zd+xCB/d4C7ZVvTmRO7wju27d3Cngiu9TdoiINUc6oyyYi4 aFrLOgfuujLt0AAdnAWctyHb2KQaDNoYOCxlqGoGGcdq4nxICBH4o35hPZjDDseM0uMg HFKX7PdPrIL9Z4Zl1D+ZK1TDylXRTnxmt95huHkt/+LS9vixNw+30Ew9gcTIlKRSwvpp TnWfRBnF1h6Nr16mfDa22GXN5hlNyKG/uf4G9PxjOftgW7vnrfq+cg9F/GDkJ62IH7x+ qxVE/7Z1aYP1xhLV6XZhWHWppzS5gPj/BoZe7/W8wDCrJ9H+9z8kPtkpjC8+sgSdfDyy 9z4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=US5apO/sh9GOuDeAfmoDvLxwtYb6JjPANV6aibwfBuA=; b=Jb0uqTjRble+JSpQAi0MgF53v3paybv/R77HZ6/X0JLv+F1wi34wTQlvQrtzS3/9st f1p83NnD6x3gLNsd7l8R1WUr7ctqeZcB8RcgMEgHMTgWkZY9KD5mgNB89xsXgu0Wmd0/ GdVV/1FCeuOxej9p8L3OL7Ol/ZFFvkyNMImuiDU89v43YTndDHfHJrZqEeqPkP+8QkFU kIaKF0aBky4+2KudwZ/JMoEaQ99ZWOhyTRkCtmmHFdqMKIDq3THvmgsF2sMy8hO7zyqx aqxTc34yHPTXjTWOVJMzMGoPm2wvDQmSJZ1kx1OGmGr1rOF6gVcGtDhjzoP0qt6Iv1V4 qldQ== X-Gm-Message-State: ALoCoQnN3PqWrKB1HIFbw0UuvfDaWzfvkdb/h2HjjWtBkPLbt2PBiJ5g5zjcUL3xvsgQt4tZTgwK6oNROrQ4cMaayI142ICo2g== X-Received: by 10.112.235.71 with SMTP id uk7mr45826778lbc.39.1452691687368; Wed, 13 Jan 2016 05:28:07 -0800 (PST) Received: from Markos-MacBook-Pro.local ([46.246.117.202]) by smtp.googlemail.com with ESMTPSA id a67sm187852lfe.6.2016.01.13.05.28.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 05:28:06 -0800 (PST) Subject: Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102 To: Pavel Stehule , Vladimir Sitnikov References: <5694EE5B.1030203@joh.to> Cc: Albe Laurenz , PostgreSQL-development , Dave Cramer From: Marko Tiikkaja Message-ID: <569650E5.1020102@joh.to> Date: Wed, 13 Jan 2016 14:28:05 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 13/01/16 14:12, Pavel Stehule wrote: > so the strategy - if cost of generic plan is less than some MAGIC CONSTANT > (can be specified by GUC), then use generic plan. Elsewhere use a custom > plan everytime. > > It allow to controll the plan reusing. When MAGIC CONSTANT = 0 .. use > custom plan everytime, When MAGIC CONSTANT = M, then use generic plan > always. I don't think that would solve even the original problem without effectively disabling generic plans, despite the problem being relatively simple. The generic plan appears to be really cheap, because the planner doesn't have the concept of a "worst case". .m -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers