Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkUYP-0002ys-SU for pgsql-general@arkaria.postgresql.org; Mon, 08 Jul 2019 14:23:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkUYO-0001tB-NI for pgsql-general@arkaria.postgresql.org; Mon, 08 Jul 2019 14:23:40 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkUYO-0001t3-Cl for pgsql-general@lists.postgresql.org; Mon, 08 Jul 2019 14:23:40 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkUYM-00010M-1L for pgsql-general@lists.postgresql.org; Mon, 08 Jul 2019 14:23:40 +0000 Received: from [192.168.127.1] (port=12171 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1hkUYJ-0002no-2y; Mon, 08 Jul 2019 14:23:35 +0000 Received: from [127.0.0.1] (port=50003 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1hkUYI-0002EA-Cj; Mon, 08 Jul 2019 14:23:34 +0000 From: Andrew Gierth To: Tom Mercha Cc: "pgsql-general\@lists.postgresql.org" Subject: Re: Measuring the Query Optimizer Effect: Turning off the QO? In-Reply-To: (Tom Mercha's message of "Sun, 7 Jul 2019 23:22:21 +0000") Message-ID: <875zoc7h29.fsf@news-spur.riddles.org.uk> References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Mon, 08 Jul 2019 15:23:34 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Tom" == Tom Mercha writes: Tom> Hi All Tom> As we know, a query goes through number of stages before it is Tom> executed. One of these stages is query optimization (QO). That's not really true at all. One of the stages is query _planning_, which takes the (rewritten) query as input and converts it to something that the executor can take action on. There isn't actually any separate "optimization" phase. -- Andrew (irc:RhodiumToad)