Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiKtX-0005GF-N8 for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jul 2018 14:36:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fiKtV-0004bc-Pc for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jul 2018 14:36:01 +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.89) (envelope-from ) id 1fiKtV-0004bV-Ei for pgsql-admin@lists.postgresql.org; Wed, 25 Jul 2018 14:36:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fiKtS-0003Qj-9o for pgsql-admin@lists.postgresql.org; Wed, 25 Jul 2018 14:36:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w6PEZVd2002095; Wed, 25 Jul 2018 10:35:32 -0400 From: Tom Lane To: =?gb2312?B?t7a5+sza?= cc: "pgsql-admin@lists.postgresql.org" Subject: Re: Where to change the column width in RelOptInfo data In-reply-to: References: Comments: In-reply-to =?gb2312?B?t7a5+sza?= message dated "Wed, 25 Jul 2018 01:29:58 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2092.1532529331.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 25 Jul 2018 10:35:31 -0400 Message-ID: <2093.1532529331@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?gb2312?B?t7a5+sza?=3D writes: > I use a postgres extension plugin pg_strom to generate the plan. I selec= t one column =C2=A1=C2=B0avg(c_acctbal)=C2=A1=C2=B1 in the SQL, and the ge= nerated plan changes to select two column =C2=A1=C2=B0c_acctbal, c_phone=C2= =A1=C2=B1. I think you'd be better off doing that sort of thing in the rewriter somewhere. Wherever you tried to put it in the planner is clearly too late. regards, tom lane