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 1izheP-0006Zv-8b for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2020 13:57:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1izheO-0001kY-26 for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Feb 2020 13:57:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1izheN-0001hv-Jg for pgsql-hackers@lists.postgresql.org; Thu, 06 Feb 2020 13:56:59 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1izheL-0002Cz-3o for pgsql-hackers@postgresql.org; Thu, 06 Feb 2020 13:56:58 +0000 Received: by mail-pl1-x629.google.com with SMTP id c23so2387932plz.4 for ; Thu, 06 Feb 2020 05:56:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=IAAnfOT04mG+RwqrGCDuMTto1Pl2Ys91TXV/QZ40BM4=; b=iSlL/x+iCLjv5RyG9kJjstlZ93DD0TlS1vplWmDcdpLZ/Ik545Z8oiYmwd9DYWQN9v wWgFDB5IKvqbTr49zRj3noe+qUMRGgw/8YhdCTKhBPhjhiIFVdCA0nvQ+Z9Oqv2Susc+ UrIVfMCLOpCKceygb7nnTzt3PezyTfBoRmxrzsoRvfUFA9uHE5CvLV1goHFoD8FVadtR HVl8Eqs5P9AdkpgT2WdW538c+72UMm2otNrBNmnz5+bV1z2BNPj6ddq4r7NfIlqTAhWg z+xDgfDhGU3IvksSZUZ9LP1ObyBduqR4af/vD9i/DPwZu4oDapD6DfqdggI8RFxa44Kn xgHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=IAAnfOT04mG+RwqrGCDuMTto1Pl2Ys91TXV/QZ40BM4=; b=L5XX9kvQd/FO/9vQ9uoJQPlzrbamPsYxPQ+iN9Rs4EFxL01kfh6S+u1dyDbcm39H4e HhIfMsYe52sDhtRErJxEa+PZXbMpw+GZJFMjcza4c/wimggO9M/nyOHaCAQoDttAMWnH AHq3Ek6oE7fPkZ5E9+IT+mSOinYYVFPkM1WzJ2Mt8bD0If3SH8xsNofhoPl2yGS1rtAp blWhCC4cuKgCg00Ou8ff3W046ouvWLWZTcm2xpiD7GjjdzESUpikTcF4GLPv36iVuiuj Br4qwNJ1obyVkLPilNpgK7wdBuriobrEJSewVUKZfCZV5G4fkUeUgRb2lFBx1arMOaum T+rQ== X-Gm-Message-State: APjAAAWbsYF0twOpqFBLOkcqvtVyQAPo0ufUugu1oifyMiH2xpyuaH7F HK+emKPg7nKQ461ubOqZ9q8= X-Google-Smtp-Source: APXvYqwWcKJkv7b7WArb+j89Rs/EjozkuRh9EbNETRdLGdJvNd4/wDsng7SANEHXq4rNqZPj9vVCYQ== X-Received: by 2002:a17:90b:28f:: with SMTP id az15mr4375534pjb.4.1580997415945; Thu, 06 Feb 2020 05:56:55 -0800 (PST) Received: from [192.168.86.37] (w196209.dynamic.ppp.asahi-net.or.jp. [121.1.196.209]) by smtp.gmail.com with ESMTPSA id u1sm3367417pfn.133.2020.02.06.05.56.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 05:56:54 -0800 (PST) Subject: Re: Index Skip Scan From: Kyotaro Horiguchi To: 9erthalion6@gmail.com Cc: florisvannee@Optiver.com, pg@bowt.ie, jesper.pedersen@redhat.com, david.rowley@2ndquadrant.com, tomas.vondra@2ndquadrant.com, alvherre@2ndquadrant.com, thomas.munro@gmail.com, jtc331@gmail.com, rafia.pghackers@gmail.com, jeff.janes@gmail.com, bhushan.uparkar@gmail.com, pgsql-hackers@postgresql.org, a.korotkov@postgrespro.ru References: <20200205163730.eqvoxh6eb3do52r5@localhost> <20200206.102450.1514793516830965023.horikyota.ntt@gmail.com> <20200206105707.fuidmdsi6oapieoz@localhost> <20200206.212220.642002310227620136.horikyota.ntt@gmail.com> Message-ID: <77321c30-0d6b-3975-0a2f-40f28691a334@gmail.com> Date: Thu, 6 Feb 2020 22:56:40 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200206.212220.642002310227620136.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Sorry, I forgot to write more significant thing. On 2020/02/06 21:22, Kyotaro Horiguchi wrote: > At Thu, 6 Feb 2020 11:57:07 +0100, Dmitry Dolgov <9erthalion6@gmail.com> wrote in >>> On Thu, Feb 06, 2020 at 10:24:50AM +0900, Kyotaro Horiguchi wrote: >>> At Wed, 5 Feb 2020 17:37:30 +0100, Dmitry Dolgov <9erthalion6@gmail.com> wrote in >>> We could add an additional parameter "in_cursor" to >>> ExecSupportBackwardScan and let skip scan return false if in_cursor is >>> true, but I'm not sure it's acceptable. >> I also was thinking about whether it's possible to use >> ExecSupportBackwardScan here, but skip scan is just a mode of an >> index/indexonly scan. Which means that ExecSupportBackwardScan also need >> to know somehow if this mode is being used, and then, since this >> function is called after it's already decided to use skip scan in the >> resulting plan, somehow correct the plan (exclude skipping and try to >> find next best path?) - do I understand your suggestion correct? No. I thought of the opposite thing. I meant that IndexSupportsBackwardScan returns false if Index(Only)Scan is going to do skip scan. But I found that the function doesn't have access to plan node nor executor node.  So I wrote as the follows. >> I didn't thought so hardly, but a bit of confirmation told me that >> IndexSupportsBackwardScan returns fixed flag for AM. It seems that >> things are not that simple. regards. -- Kyotaro Horiguchi