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 1lX8Rq-0002fB-LN for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Apr 2021 20:18:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lX8Rn-0004bF-Iv for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Apr 2021 20:18:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX8Rn-0004b6-6r for pgsql-hackers@lists.postgresql.org; Thu, 15 Apr 2021 20:18:43 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lX8Ri-0007aS-UK for pgsql-hackers@postgresql.org; Thu, 15 Apr 2021 20:18:42 +0000 Received: by mail-ed1-x52f.google.com with SMTP id d21so9501265edv.9 for ; Thu, 15 Apr 2021 13:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=+pSzeayOWsxNnAouTV9qSKnLpWOes7E2v46eB8wVR/Y=; b=SUgEBExpFtCs9fHSYhN0aCewsHlzYdDjZ4JQwzzD/hrJ12pUQyvOef89CNZx8vc/s1 csUMH/3G/RaKcxtrzIXqfPhsPZmTvRL/hFCPpRR3DEx9sfyGRr9STULfC8w/u+IYt5DV NGRvzJZek3E0M0Rs+hcwgnTeewzeZRWgMNrPH49s7lkFaTfXGNARg6p3UaVmD7VRZGJ5 q84dYJkqnEUhQwyqbF6vm1ltw6zlaqyvmoVqI3yrGm9uLHBz/1piiBihki7Jg36FXehR P4BLvhByEcO/Gab4solcd4S7qG18fy4MbKLYL5IvEBC69WhOI7W5Qi0v9Y4QE8YOMK/y qscw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+pSzeayOWsxNnAouTV9qSKnLpWOes7E2v46eB8wVR/Y=; b=TjnK77k5CCE37uOzNOHNWP4tcEU8St8B2vEhDG0+f4DuT3W7LutH+IjSDUXT+PAIjD nIUbePbARRodfuXR4VVIfdPG7W2GY5tC7XLNoE9Kqu4oN3SUUgCUQAoVW5efolu6l/nK Ye2et8eQLVUVCRIyNHILuM+tV1Fa8uQZsFF7C/KyCh2GRQ4edmRuMxko6J7I37cQuQkG R9CZBnoLpBR7FtzbuewdmLlCeXOWNjjNodacVn4Rxo7yCAaNb3evJhS04zRzRGGU5veI 8QIIyISpcQKnJEzQLCBYzNBTER2Jq5j+4zt3azq2vWYblxhuJN0z8vqtcNRRwNxZEWBB 5xYQ== X-Gm-Message-State: AOAM533WzviGRDKN+n3udR+rTwRmznbr1DpGbvbV5HuPaA7Iyq8q9BS0 g2bITh/w2LLNxXntzcUB3G8qsx2FSmu9PlYsVOiOVxWlN7eogrHIbX7T7h4lpUUHNaq6Dv2akts +p4K9TXVWO7sgCWqq/uNMTemlajhva3uLNTqrMkq+kky9im5z/ZZ+ErCFPOAqz4rN6lNlug0S+/ AzdPiCua1MI3yTZCb0VSsvHtKrfDhaOQi5AaQ8yZ020a34pRIb5qIOyDHoym1Oqra32HYOL+3Xy PU7TkhVQDiYduDkrV3435v0v6222QJeqHb6/hVB X-Google-Smtp-Source: ABdhPJzQCmn/f6Z7g0JE2ZJCLg+I+x80+D7PXaoZxSQVSKOQDtN0i1ouEWczWA28d85uJE8i/98BGQ== X-Received: by 2002:a05:6402:440d:: with SMTP id y13mr6417586eda.316.1618517917307; Thu, 15 Apr 2021 13:18:37 -0700 (PDT) Received: from [10.137.0.4] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id l15sm3261816edb.48.2021.04.15.13.18.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Apr 2021 13:18:36 -0700 (PDT) Subject: Re: "could not find pathkey item to sort" for TPC-DS queries 94-96 To: Robert Haas , James Coleman Cc: Luc Vlaming , PostgreSQL-development References: <91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com> From: Tomas Vondra Message-ID: Date: Thu, 15 Apr 2021 22:18:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/15/21 2:21 AM, Robert Haas wrote: > On Wed, Apr 14, 2021 at 8:20 PM James Coleman wrote: >>> Hmm, could be. Although, the stack trace at issue doesn't seem to show >>> a call to create_incrementalsort_plan(). >> >> The changes to gather merge path generation made it possible to use >> those paths in more cases for both incremental sort and regular sort, >> so by "incremental sort" I read Tomas as saying "the patches that >> brought in incremental sort" not specifically "incremental sort >> itself". > > I agree. That's why I said "hmm, could be" even though the plan > doesn't involve one. > Yeah, that's what I meant. The difference to pre-13 behavior is that we now call generate_useful_gather_paths, which also considers adding extra sort (unlike plain generate_gather_paths). So now we can end up with "Gather Merge -> Sort" paths that would not be considered before. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company