Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJPlk-0007bz-Sd for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2020 22:54:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jJPlj-0007C7-Pk for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Mar 2020 22:54:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJPlj-0007C0-IK for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2020 22:54:03 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jJPlh-0006Jg-7b for pgsql-hackers@lists.postgresql.org; Tue, 31 Mar 2020 22:54:02 +0000 Received: by mail-wm1-x343.google.com with SMTP id a81so4991475wmf.5 for ; Tue, 31 Mar 2020 15:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MSe0T2sHiBhSeYhbxTlAxHHg1m8fZQQF/BI1mPlWV+U=; b=vHrq691X2yeuwPw6FfRWh5h4IabAnva5dJwqYzXaSqRrNhepbORfZZcpyiLSCGgqoy b8lUM4DGCKuRC6ddZCoVPc0qesRPJ4yqYBhOudY17bPQvp1BqMmKVKtM4AmLG5idmLQT irKeqR+WKNWQDTHauPLsfSpfvDVwteK6ttmhvEFEe5UmloH//VffA2HFohfVV019Vd40 rhO2U85FI9I8hojL+wNAbSOR/yGg8XojQ5dfC6h2vQ5Js0xeKbJxfhOHJIaSy27Zs/79 uHY0jm/hrnkZN4r3GCtsDW+waU721Yr4idHjHRlxl6F/v1IwIEdX/TFbcIl5ZIp3xsOu mXVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MSe0T2sHiBhSeYhbxTlAxHHg1m8fZQQF/BI1mPlWV+U=; b=Do0a4z8nyWaV7eB8g9dk95XsCDVzTTf1G3ryv0atJiKQVJBDL7BU2XTwIoqSQGJJ69 gLVSKO0/ID/d1sGqrze2SsPaAJa6PYnHbACEcae0oRmeHsRLeGczDHm5no3G+acld+OD mJxHtq7dmvP3PuUz1Y2R131FBM3VOyJ8jIPsSH+/ytTy6pH+bTxVrgJPK0uUGh68P0JU QVe8RErN9Q2kpGsS9BRp5xU/IqRzNo44cWVJK6Nuv1n9SZXX0sI1q1Bt+6IAFxI+ngz6 SfjzuKxA6YY0UYvZVtlH6FVz7IZsO6/me6d6SDTMtvA2inZRp5lViazxW7vqRxYt6454 osSQ== X-Gm-Message-State: AGi0PuZrs1BXQI1eKNXFUCeRrmyqGQEh7Ld64fDsFcYmpBw7xczq+eZx 8GtZrfJTvByTtQPmZgAchv0myg== X-Google-Smtp-Source: APiQypIGbAmrc+Nl1DaT1mWcwgqpYw9IJsqSRlrsv942sRHBSPV0rmDpIFBCCxuQsB0lw0ioHEl6mQ== X-Received: by 2002:a1c:99d3:: with SMTP id b202mr1162490wme.170.1585695239765; Tue, 31 Mar 2020 15:53:59 -0700 (PDT) Received: from localhost (ip-86-49-253-141.net.upcbroadband.cz. [86.49.253.141]) by smtp.gmail.com with ESMTPSA id u5sm259273wrq.85.2020.03.31.15.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 15:53:58 -0700 (PDT) Date: Wed, 1 Apr 2020 00:53:57 +0200 From: Tomas Vondra To: Tom Lane Cc: James Coleman , Alvaro Herrera , Michael Paquier , Rafia Sabih , Peter Geoghegan , Simon Riggs , Shaun Thomas , Dmitry Dolgov <9erthalion6@gmail.com>, Alexander Korotkov , PostgreSQL Developers , Andreas Karlsson Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort) Message-ID: <20200331225357.o4o55wjldlbx4kdt@development> References: <20200330014442.chqnwfmelm3ejsgr@development> <20200330122426.wjdfpqiatv4ybui7@development> <20200331011407.vwz3ektatgqyi6vy@development> <20200331215340.bbbrccbehmjb7dbx@development> <2608.1585694132@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <2608.1585694132@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Mar 31, 2020 at 06:35:32PM -0400, Tom Lane wrote: >Tomas Vondra writes: >> In general, I think it'd be naive that we can make planner smarter with >> no extra overhead spent on planning, and we can never accept patches >> adding even tiny overhead. With that approach we'd probably end up with >> a trivial planner that generates just a single query plan, because >> that's going to be the fastest planner. A realistic approach needs to >> consider both the planning and execution phase, and benefits of this >> patch seem to be clear - if you have queries that do benefit from it. > >I think that's kind of attacking a straw man, though. The thing that >people push back on, or should push back on IMO, is when a proposed >patch adds significant slowdown to queries that it has no or very little >hope of improving. The trick is to do expensive stuff only when >there's a good chance of getting a better plan out of it. > Yeah, I agree with that. I think the main issue is that we don't really know what the "expensive stuff" is in this case, so it's not really clear how to be smarter :-( One possibility is that it's just one of those regressions due to change in binary layout, but I'm not sure know how to verify that. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services