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 1lMZWN-0006CG-31 for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Mar 2021 16:59:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMZWK-00026n-TH for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Mar 2021 16:59:44 +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 1lMZWK-00026e-K9 for pgsql-hackers@lists.postgresql.org; Wed, 17 Mar 2021 16:59:44 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <9erthalion6@gmail.com>) id 1lMZWH-0006Pf-Kl for pgsql-hackers@postgresql.org; Wed, 17 Mar 2021 16:59:44 +0000 Received: by mail-ej1-x62d.google.com with SMTP id p8so3735414ejb.10 for ; Wed, 17 Mar 2021 09:59:41 -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=Z85sNAHvkqHTZ1pKsueIUbq2eCFlZ9oLCxacYxH4WjA=; b=c5tLv1sg0oQpLe5wO2ynQfooDi0JQyh1s84t8hB4S2MUg0KYBWAXFYvBzA4xFPmgVZ MP/TduXe57m1AJ26jkx0lAVsHv0RnJd5G12kv/P1GO1XzQadeY13EFYssUSGdZcYbd59 8j37wsF8Zsgvnci/f4DQw9EzKyqc2qYDLm3UdO9y7Jgbf8v9RL3ORNRmIJL61/QDD2ON pSx43pXBpWYdIHhciQ82BDoTIP8Fs0jciy1BBt5VSJAdnW1E4xCGjKyUJ2sirJLnmMap QwndBPf5JElVGBu3qoyY/ayPIAE9LQukYmpbqojNrQR6XkfPSnCO2TgpO0lxLfzgtXyT wDsA== 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=Z85sNAHvkqHTZ1pKsueIUbq2eCFlZ9oLCxacYxH4WjA=; b=GN2b131PBpK1Deh/xg5/20Umqos5cQX9w9UC3YrURKY1Kshp3sbTqB5xBQmjwSR1eG qtgx+s5Tw+Ib6AsJt3L+5ZdI6sXjQPZbuATQ1eleqiiT7w624SUvt392Pg2dO9Ooz4pK uBjW1HHWJcWEBAyopBrasvBky6NSIGJlDCfc+ND55G7yHQh3W48xu8TFylUD4EEGyvjS suYHbgfLJmnKHTzaJkhFgfKSnL/6/MpNZG1isFUW3k8QeHBQ7lnr5OOpfml2BmA0VyPR d8qGPuNlmfJuvc64zyHUBE0Er764Nhgrl+P4aSX7AydujUaFObUaauIMEjkZTfcMYgGc WC0w== X-Gm-Message-State: AOAM533goLAJIdjRkGRoXJG/3IxqkAo8R/2nkYts9xKsfXgN3WMaxOcX ZtrfX+L4Sp90adPe1xSOfg8= X-Google-Smtp-Source: ABdhPJxwfhxEtWFVxufKjo3mB3Rx36gr33Lcw+mCe0LQqtNqeuq3VB/e9euGoyNicQeKT6ftFcgZjA== X-Received: by 2002:a17:906:1155:: with SMTP id i21mr35924892eja.218.1616000381069; Wed, 17 Mar 2021 09:59:41 -0700 (PDT) Received: from localhost (dslb-094-222-016-066.094.222.pools.vodafone-ip.de. [94.222.16.66]) by smtp.gmail.com with ESMTPSA id y24sm13495387eds.23.2021.03.17.09.59.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Mar 2021 09:59:40 -0700 (PDT) Date: Wed, 17 Mar 2021 18:02:16 +0100 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Tomas Vondra Cc: Heikki Linnakangas , Peter Geoghegan , PostgreSQL-development , Jesper Pedersen , David Rowley , Floris Van Nee , Kyotaro Horiguchi , Thomas Munro , Tomas Vondra , Andy Fan , Dilip Kumar Subject: Re: Index Skip Scan (new UniqueKeys) Message-ID: <20210317170216.esq7xikcis62tg6e@localhost> References: <20200815141240.wuyc6ijkmnywywtn@localhost> <20201006152039.xs2ul7il52sowhlu@localhost> <20201024164553.tel5uynf2dzyh4az@localhost> <598ff988-5ebb-f6f7-0c9d-82208dff3bbd@iki.fi> <20201201202119.jcsr7z6cdiffuops@localhost> <6020ad2b-357f-da90-de7b-60b79452fc66@iki.fi> <20201205175542.fqrhbhp3co7cgvkj@localhost> <20210314144833.tbfnn3pbrpjgl56z@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: Archived-At: Precedence: bulk > On Wed, Mar 17, 2021 at 03:28:00AM +0100, Tomas Vondra wrote: > Hi, > > I took a look at the new patch series, focusing mostly on the uniquekeys > part. It'd be a bit tedious to explain all the review comments here, so > attached is a patch series with a "review" patch for some of the parts. Great, thanks. > Most of it is fairly small (corrections to comments etc.), I'll go over > the more serious part so that we can discuss it here. I'll keep it split > per parts of the original patch series. > I suggest looking for XXX and FIXME comments in all the review patches. > > > 0001 > ---- > > .... > > 0002 > ---- > In fact both 0001 & 0002 belong to another thread, which these days span [1], [2]. I've included them only because they happened to be a dependency for index skip scan following David suggestions, sorry if it's confusing. At the same time the author behind 0001 & 0002 is present in this thread as well, maybe Andy can answer these comments right here and better than me. > 0003 > ---- > > Just some comments/whitespace. > > > 0004 > ---- > > I wonder why we don't include this in explain TEXT format? Seems it > might make it harder to write regression tests for this? It's easier to > just check that we deduced the right unique key(s) than having to > construct an example where it actually changes the plan. Yeah, good point. I believe originally it was like that to not make explain too verbose for skip scans, but displaying prefix definitely could be helpful for testing, so will do this (and address other comments as well). [1]: https://www.postgresql.org/message-id/flat/CAKU4AWpQjAqJwQ2X-aR9g3+ZHRzU1k8hNP7A+_mLuOv-n5aVKA@mail.gmail.com [2]: https://www.postgresql.org/message-id/flat/CAKU4AWrU35c9g3cE15JmVwh6B2Hzf4hf7cZUkRsiktv7AKR3Ag@mail.gmail.com