Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aJLm5-0006YP-31 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jan 2016 13:47:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aJLm4-0000sH-8h for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jan 2016 13:47:44 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aJLm3-0000pw-8n for pgsql-hackers@postgresql.org; Wed, 13 Jan 2016 13:47:43 +0000 Received: from mail-lb0-x22b.google.com ([2a00:1450:4010:c04::22b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aJLm0-0004du-Oh for pgsql-hackers@postgresql.org; Wed, 13 Jan 2016 13:47:42 +0000 Received: by mail-lb0-x22b.google.com with SMTP id bc4so290026568lbc.2 for ; Wed, 13 Jan 2016 05:47:40 -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=/x1wAhMwDLngWGqJcG4bysyAwyv78Wd9dEVErEuThjg=; b=wNOtqWXiIioQe46EUf2w75mMxlOeQXA9AAy7WDXTSWhMe8uFb874OIkgA2mHmXUIc4 acTgv/OhDVxZmO1ldnR2kbssEHLHLHoQNnscUpZoAkwsOXETOat+mPoR4qA/l4u0qBJl IACkQ730lmAcPeUTNsHSkdWdIVEGFmyfvp/eOfS2MY+qkvfGzMT1Eho8AaFMJGYuiwox u8YqajTzYj7WjXSALesg1e3eUJBsZwYvrBdRvu61C8Xug5565MSXKCVVcgBuMU9uFqs9 gYQiH0mbR9zklbg0kw569ThNlySSRvGQnXwxA+N78vX+x1r48UTYIpQ7Jjcv+SZLixXy Jggw== 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=/x1wAhMwDLngWGqJcG4bysyAwyv78Wd9dEVErEuThjg=; b=XTfn/hacx9RshEbr+72f1FC8QwOyY/ZlBB9V3oesn7siEKEdDBvVgAD95Wb5Sap7q4 3OzErTcu+j7Cxec0LKw405XjsUX21QQ8JITAGo/70Mc53nOHapClpqNwNpAJPvcZoSCK W2qmOQElOWZO+OA/q97WkaVJbf4F+uvpFxpTxh3VVJSK/ngPaERagiHXPg/cF2YUmW2D nP2ar5E3gpx7Wexq7VgeGvRCZnCNH6oN8cksc5/l13DZLa0ByJjx99tjbJXfspi9M4b8 hRKSgprxc5hqNGemD1jgwp4R3WKtvZ3wfaxkQs3bS03BhSa03N0AyQqUUNx4gbwsqrDI hfQw== X-Gm-Message-State: ALoCoQkZiWMMBX9kI/ctu3UY8CvXhGzcIGUl4yajR+g2ckzLNmmG5npQT9ctapEHy1h/tftSLu/jrGS6vSSJJfUVvL9aDEdoLQ== X-Received: by 10.112.141.165 with SMTP id rp5mr8259347lbb.9.1452692858941; Wed, 13 Jan 2016 05:47:38 -0800 (PST) Received: from Markos-MacBook-Pro.local ([46.246.117.202]) by smtp.googlemail.com with ESMTPSA id o9sm198957lfe.15.2016.01.13.05.47.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jan 2016 05:47:38 -0800 (PST) Subject: Re: Fwd: [JDBC] Re: 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102 To: Vladimir Sitnikov References: <5694EE5B.1030203@joh.to> <56965183.1080707@joh.to> Cc: Pavel Stehule , Albe Laurenz , PostgreSQL-development , Dave Cramer From: Marko Tiikkaja Message-ID: <56965579.1020909@joh.to> Date: Wed, 13 Jan 2016 14:47:37 +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:36, Vladimir Sitnikov wrote: >> Say you already have a plan which looks like this: >> Now the plan gets invoked with $1 = 5. What exactly in your mind would happen here? > > A sequential scan with $1=5 condition. What else could be there? I don't know, it's your proposal :-) But it looks like I misunderstood. > Note: I do not suggest changing already cached plans yet. > I suggest looking into "6th bind values" when building a cached plan. But that wouldn't have helped your case. The custom plan is *more expensive*; I'm guessing because the generic plan gambles on a better average case instead of preparing for the 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