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 1lVvoQ-0007JQ-Oa for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Apr 2021 12:37:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lVvoP-00035O-Mt for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Apr 2021 12:37:05 +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 1lVvoP-0002zX-GJ for pgsql-hackers@lists.postgresql.org; Mon, 12 Apr 2021 12:37:05 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lVvoM-0001mU-St for pgsql-hackers@postgresql.org; Mon, 12 Apr 2021 12:37:04 +0000 Received: by mail-ej1-x632.google.com with SMTP id w23so4173401ejb.9 for ; Mon, 12 Apr 2021 05:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=1RxynIq+oth8Ual8WvTjUFMYZA67x2plubHNje8M634=; b=X+3R4BMm3nJPTrNQQ34x1Gxj2TmuKrfRlZrtiZEclDvevv/QwESu8BhGDSSBHiNI21 NNZwAmweHOtD4nzgWH2UUU09rdygczDQtdv/Ej/RjlCVddM2dgCLoVu77ee3Z8qVtVQl SFRqWG1hmF7JRSTQewxPCzytKt4jp/3ZWGSavE1fUoH02N7lGZafnOqmHUYSej8Zl7ys wRtde62mRUqu91He4P7KG1qfddmXHq4j1rxhWq3j0cX3hRw85hEz3FryEdUjcibzxf5s 9vvlmT681hrMDqO2TrdmYMqZoRpXUh+nV4NrV+KX/KaPxv2gtHYZBvROJehOLoaL6OZj rYPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1RxynIq+oth8Ual8WvTjUFMYZA67x2plubHNje8M634=; b=e09etlyGy2QV7lywBrTnmj2B9Kxb2MyRGNWzyb+HfK//KwWmfjtMpA8Zwv5D0e9Mbt vBnhsd1SreqF/eqmZyLAqxe7e28/44kbiy9GaB62S2DeB6tShK3xed4tl+x1wbyv22ez 7GRlKMNw8gUhDPbTAAUDBKtjPRfNnXFWjC5ztF5MMLEGTEBOc7tU3I69jX2VHHZTjdnm eeFxINg38Pqhdsc1y11E5x7uSiTWGAiLm04tYNt35fPOfYNVJHqV0UO4a/5gfbqrFtWL EwAQwTbSwB5+t9ZHl32KjS9qotsxoUDaBZHIM51h76n36Rz4WTFfboK2IZq8jUEHsVoe vaAg== X-Gm-Message-State: AOAM532xhbziq0UF09Tr9S34h1VqePR5TwjJZTmz54pH0bJ5oNM5s9NH 7pxFJt9fAMN0gC+iFrNlF2Vc54bsn6UormvVH/NruGlYZFaV5NK8BmaSFXkbyuCjACcrVaJ9HiJ ecrQlT3H7pqfWRqMDTLp5/qQPk7SoonGjZSFECJKb3ceRz3q/Q35hqFFFwGH3qWmb1/8mvfao0d lFePOpd0r8DajpzMsw4JtyUdxGTLgOoqb5mdhjr58JCDUuaZhQ8kFKFGVLpcW7HktQgeU+QTbxJ bzmYpZclLfDmAJnemlGVuMq9rTZ9E+yEx3YOGwH X-Google-Smtp-Source: ABdhPJwY+fxsdMl1A2JkbylpPF8zbXbxAveG2ptdjKziP6vXQagUao3eNq9vtNFySbYfkYBOEJxCjA== X-Received: by 2002:a17:907:2177:: with SMTP id rl23mr8140413ejb.160.1618231021082; Mon, 12 Apr 2021 05:37:01 -0700 (PDT) Received: from [10.137.0.20] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id q16sm6647556edv.61.2021.04.12.05.36.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Apr 2021 05:37:00 -0700 (PDT) Subject: Re: "could not find pathkey item to sort" for TPC-DS queries 94-96 To: Luc Vlaming , PostgreSQL-development References: <91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com> From: Tomas Vondra Message-ID: Date: Mon, 12 Apr 2021 14:36:58 +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: <91f3ec99-85a4-fa55-ea74-33f85a5c651f@swarm64.com> 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/12/21 2:24 PM, Luc Vlaming wrote: > Hi, > > When trying to run on master (but afaik also PG-13) TPC-DS queries 94, > 95 and 96 on a SF10 I get the error "could not find pathkey item to sort". > When I disable enable_gathermerge the problem goes away and then the > plan for query 94 looks like below. I tried figuring out what the > problem is but to be honest I would need some pointers as the code that > tries to matching equivalence members in prepare_sort_from_pathkeys is > something i'm really not familiar with. > Could be related to incremental sort, which allowed some gather merge paths that were impossible before. We had a couple issues related to that fixed in November, IIRC. > To reproduce you can either ingest and test using the toolkit I used too > (see https://github.com/swarm64/s64da-benchmark-toolkit/), or > alternatively just use the schema (see > https://github.com/swarm64/s64da-benchmark-toolkit/tree/master/benchmarks/tpcds/schemas/psql_native) > Thanks, I'll see if I can reproduce that with your schema. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company