Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsvD8-0000aF-AA for pgsql-performance@arkaria.postgresql.org; Tue, 17 Dec 2013 14:01:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VsvD6-0008Kv-Sn for pgsql-performance@arkaria.postgresql.org; Tue, 17 Dec 2013 14:01:20 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsvD5-0008Kp-Tz for pgsql-performance@postgresql.org; Tue, 17 Dec 2013 14:01:20 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsvCz-0002pU-Tb for pgsql-performance@postgresql.org; Tue, 17 Dec 2013 14:01:19 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id E6FA85F7A9; Tue, 17 Dec 2013 09:01:28 -0500 (EST) Date: Tue, 17 Dec 2013 09:01:28 -0500 From: Stephen Frost To: Joe Van Dyk Cc: Tom Lane , "pgsql-performance@postgresql.org" Subject: Re: Adding an additional join causes very different/slow query plan Message-ID: <20131217140128.GT2543@tamriel.snowman.net> References: <18828.1387239245@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="j+Rb494BzBd9643b" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.8.0-34-generic (x86_64) X-Uptime: 08:59:46 up 6 days, 16:35, 4 users, load average: 0.11, 0.07, 0.05 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --j+Rb494BzBd9643b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Joe Van Dyk (joe@tanga.com) wrote: > On Mon, Dec 16, 2013 at 4:14 PM, Tom Lane wrote: > > Yup, that's what I was just about to suggest. You might want to use > > 10 or 12 in case some of your queries are a bit more complex than > > this one --- but don't go overboard, or you may find yourself with > > unreasonable planning time. > > >=20 > Is there a way to measure the planning time? It's not reported in 'explain > analyze' or 'explain analyze verbose', right? You can just run 'explain' and that'll more-or-less get you there (turn on \timing in psql). When reading this thread, I was thinking it might be useful to add plan time somewhere in explain/explain analyze output though.. Thanks, Stephen --j+Rb494BzBd9643b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJSsFk4AAoJEO1sijiDR2RVegEP/RsuDE2eXFT2X/RygFM50GFg 3ktI56hGiXWvj73aurr+67nJRpqi25W/0XKCpXSrQvxFWfzCW8trTiOBJC3E2q2S ST7SzIf7lHqeXmNIm8IHqAWZqjY4HQ8XuCiz3bFER5zj+gtwmftaLlWPsJRrfrlZ k0v8rT8vgp4uv05KJN3fT//gWk2M2NE4MxMnc6LO4wGJix0/+vTHuTNfVl0jhGv0 761IYVnaU0BHxXeb4MxBV4HD/b6j7TAWILtNEN/ZcM1vUbVT9790nTA2NY4KVIdy fM/3c6WiTEiQuE7+ngKc8+VEZlh4tfiypsIM4kCCSWotYG+LayhSEQJ8MiP/WjON U1FvvfZLyyWn4TJajBJF+SFs/QXQ0PGiMDI8gLIKqmAWhrylpyz5XIV1bweux8Uq es2wtnuJzmSASH/txVxk5xZkV6sM8UQedGPSsfSJ7QfzcSL3mjANxWxxPEEaZHhs u26IM7aoqXwEDFuJDz7MTpBK1KflgF/qjFnuVgjN925aC134ZZN/plaWi+MhH22I NDanmbc1drMpKuLeeWMPd66YLQ0fapxF8As4NrAKfYiFBbK2erwuxxTESj+WV3hQ RMqlcgs4E94oq04InpAwbqNhNWzgbcM+Tcm5QhvjVY2mUMVRTK4MXEStSyoVE78D 8pIQ5SyBDCxD+1Dk4cQr =PNiF -----END PGP SIGNATURE----- --j+Rb494BzBd9643b--