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 1jpsWk-0008FU-M1 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jun 2020 12:04: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 1jpsWj-0007IZ-IZ for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Jun 2020 12:04:45 +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 <9erthalion6@gmail.com>) id 1jpsWj-0007IQ-94 for pgsql-hackers@lists.postgresql.org; Mon, 29 Jun 2020 12:04:45 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1jpsWh-00041K-5X for pgsql-hackers@postgresql.org; Mon, 29 Jun 2020 12:04:44 +0000 Received: by mail-ej1-x629.google.com with SMTP id l12so16266200ejn.10 for ; Mon, 29 Jun 2020 05:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+BvVUFTEiux0pZXge/9XyefiAgyH3ZuZfntzHxfmQX4=; b=EwMjOftWDIUjOSXPcGRswrKey0UAk8nvoOka3lwhnD6MeFvag4m35qcqgQ+RVpm7K8 AQwR1dhH92ElXdN95zScRDEi8dYPi3aoyNpmLUkPL8uumzJwLzpBAhC4RVin9eM6OWVI ZhPk5oYPV132IS9g6gQcO2ggXAvDXqfiE/lrdBZBtjnpkaVgo1w/jAA/9vyDt6M4/izG /D6N+P1J7SUETp2hvYN378pi3yUqf5YZZPwsN5wRXH2JNd0da6Icty4G0GGkTC1VQY95 542f1wcUPUsYtE39QppZwqqgfnc2UxUkB6fhVluMSii7Ot5wrGH9TgDMrCbgE/LeNJlV 4bgA== 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=+BvVUFTEiux0pZXge/9XyefiAgyH3ZuZfntzHxfmQX4=; b=rWNVla7shN6wP/ftZo5pywnii1IYR5G3eSkjPfc3QiHSCL2Fuxh+vWlM4d2cP01rYt gdkzSnbFnDB8hxD5fFwFIeGOWtp7hkdtahl0ry9zH9+RlDyDyi4U8hwd7sgOB5C1iwky xCGEZ0+8GorzkrGj8G39/4AsZWjaX8N5ynRxsL7Jl8auaOmAs8wGmvVXA8M1M5mJAJmT Lbd6kYAUJGWW0SNIvDDutZhRtZhs8Gich01pC3kOuaD134bMWZ/VI7mAYVFWl0gELorY m8i9n+r7922tVMhZtQ9ofOoJ3tdndpJrie2fj5NMf3aFvNwL2k7HA0yrg4w+JUtcfntq IM/Q== X-Gm-Message-State: AOAM533LNDew4dl1wBDOmubjFW7bm41MwMCMaZR3Grqh3513BDbt9Br6 1/+T40pvcpjWv3C5jNr55NA= X-Google-Smtp-Source: ABdhPJzmXOYW88bEwInsQY0DRzBztPZe/6sQIqSAoRVrrKnN7DRvDMuBQlt4qQrne4dxkTra9Vi3Kw== X-Received: by 2002:a17:906:c943:: with SMTP id fw3mr13408527ejb.55.1593432282012; Mon, 29 Jun 2020 05:04:42 -0700 (PDT) Received: from localhost (dslb-188-102-096-018.188.102.pools.vodafone-ip.de. [188.102.96.18]) by smtp.gmail.com with ESMTPSA id d20sm2767622edy.9.2020.06.29.05.04.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 05:04:41 -0700 (PDT) Date: Mon, 29 Jun 2020 14:07:09 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Andy Fan Cc: PostgreSQL-development , Jesper Pedersen , David Rowley , Floris Van Nee , Kyotaro Horiguchi , Peter Geoghegan , Thomas Munro , Tomas Vondra , Dilip Kumar Subject: Re: Index Skip Scan (new UniqueKeys) Message-ID: <20200629120709.52w2zi36mtzyliv2@localhost> References: <20200609102247.jdlatmfyeecg52fi@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On Thu, Jun 11, 2020 at 04:14:07PM +0800, Andy Fan wrote: > > I just get the rough idea of patch, looks we have to narrow down the > user cases where we can use this method. Consider the below example: Hi Not exactly narrow down, but rather get rid of wrong usage of skipping for index scan. Since skipping for it was added later than for index only scan I can imagine there are still blind spots, so good that you've looked. In this particular case, when index expressions do not fully cover those expressionse result need to be distinct on, skipping just doesn't have enough information and should not be used. I'll add it to the next version, thanks!