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 1i8RLn-0006kA-Qs for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2019 15:49:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i8RLl-0007L8-7J for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Sep 2019 15:49:37 +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 1i8RLk-0007Kv-Uo for pgsql-hackers@lists.postgresql.org; Thu, 12 Sep 2019 15:49:36 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i8RLi-0006nh-4v for pgsql-hackers@lists.postgresql.org; Thu, 12 Sep 2019 15:49:36 +0000 Received: by mail-qk1-x744.google.com with SMTP id p10so6951185qkg.8 for ; Thu, 12 Sep 2019 08:49:33 -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:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=3e/9EMeQuJ/bmOlOrM1a6fa613mj6panp7jYebZprho=; b=07ezgoJFNh5ZUWVUy8/BdA6FB6nJTTM2veDvX35HxhWeA0mngQzvV4BW90YeR27/tP jrrPTjhlHmillgMT4D3ZoXc7mrl2S2WLWnOUCGsziwJAXgR8+jd7KE4K2sYFyVCdexkk 3Vq4m4HJ7cpwgPWZhWCieyeUTxzPV+tApaB8UUvAjiVgCDKV2wIMfDPSW5KxTdBHTZCR WoNEOClU2u7AoBUEmajktkj34hdVyGDr23ld38QkkrzbaRPDIjve5Y4UMm8byNdReiOc /e9GS1LrIY/WOXbl9vesh5aivdlU7rlkq+krcU6S5WZnKAcAqWgldwnX+TPO85CXurOm TBtg== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=3e/9EMeQuJ/bmOlOrM1a6fa613mj6panp7jYebZprho=; b=j8Ebv4CnOgDjOHaoHDsacIalMXMjB3mysCaQiYuC75nV1Ksm5mzD35u5f7eCi50RwA WNDpG6cefPqNMKcGS9E/tqaCvHT9W6yezayMzAmbJbS6FDfqAyIMQr/oU+pUQw83r49i TLSUCpupW/OwwE8TptB7L35NpOClTEcL5zcRZm3QI6cAozzrKRcihSYeQ6un8iP49zJ0 TU5W8DY9troNEve3kFlRC2ZBiTFPTkdqOsw1+iLzK28vt3pD98wTIxv/1ACNqW9+vOL8 PWDKMDDCt8nr8HDsjMFc6pUVvr7YAlBpCOxUMFUk4nvG8lNBjyBHE6QCunsaaKa111so KPGg== X-Gm-Message-State: APjAAAUTNcXLFIbAW+rPqWD0o3PiQsRK2yhRIuNmykR3gNvGSqVDO8f9 6+sib/d/8fnHXhlEw37iNZ5dLQ== X-Google-Smtp-Source: APXvYqxDYCkfWogEFGs/oZvv1qZ3HCixVGNw/IoABLpB0ywYavEzKrJDYLvBkpd7ZPAPPMmxbqo0pA== X-Received: by 2002:a37:515:: with SMTP id 21mr5091704qkf.87.1568303372058; Thu, 12 Sep 2019 08:49:32 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([179.56.30.174]) by smtp.gmail.com with ESMTPSA id m19sm12289352qke.22.2019.09.12.08.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 08:49:31 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id BF87C12090A; Thu, 12 Sep 2019 12:49:29 -0300 (-03) Date: Thu, 12 Sep 2019 12:49:29 -0300 From: Alvaro Herrera To: Tomas Vondra Cc: James Coleman , Peter Geoghegan , Simon Riggs , Rafia Sabih , Shaun Thomas , Dmitry Dolgov <9erthalion6@gmail.com>, Alexander Korotkov , Tom Lane , PostgreSQL Developers Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort) Message-ID: <20190912154929.GA2254@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190730001711.hprrcx3ntk57wuqv@development> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jul-30, Tomas Vondra wrote: > On Sun, Jul 21, 2019 at 01:34:22PM +0200, Tomas Vondra wrote: > > > > I wonder if we're approaching this wrong. Maybe we should not reverse > > engineer queries for the various places, but just start with a set of > > queries that we want to optimize, and then identify which places in the > > planner need to be modified. [...] > I've decided to do a couple of experiments, trying to make my mind about > which modified places matter to diffrent queries. But instead of trying > to reverse engineer the queries, I've taken a different approach - I've > compiled a list of queries that I think are sensible and relevant, and > then planned them with incremental sort enabled in different places. [...] > The list of queries (synthetic, but hopefully sufficiently realistic) > and a couple of scripts to collect the plans is in this repository: > > https://github.com/tvondra/incremental-sort-tests-2 > > There's also a spreadsheet with a summary of results, with a visual > representation of which GUCs affect which queries. OK, so we have that now. I suppose this spreadsheet now tells us which places are useful and which aren't, at least for the queries that you've tested. Dowe that mean that we want to get the patch to consider adding paths only the places that your spreadsheet says are useful? I'm not sure what the next steps are for this patch. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services