Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g0XPk-0008AI-2G for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Sep 2018 19:36:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g0XPi-00029q-Ad for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Sep 2018 19:36:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g0XPi-00029j-0J for pgsql-hackers@lists.postgresql.org; Thu, 13 Sep 2018 19:36:30 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g0XPf-0001xb-1I for pgsql-hackers@postgresql.org; Thu, 13 Sep 2018 19:36:29 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 7B99221C2950; Thu, 13 Sep 2018 22:36:25 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.1.63] (unknown [81.200.23.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id D3FC121C2932; Thu, 13 Sep 2018 22:36:24 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1536867385; bh=4D6yqb7pFbW6MdwSpqfjjbZbpjWQEFJNBFpeZric1sc=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=mAvrRhM89GBfqWdsUn2GsUJX0jPkH4gFiAbzXlWliYoV8f3ibdMRweNW4jp4sJpCq Xe0dh80qoY6Fp+bQ/rRIi18w+M1CHTNZsgQDc9ByWysmY/WPE9O5504KmbBdAZq0ma WsvtEUYs1WJ6SP2ymkx50KHkewFOw9//dB/lWRZA= Subject: Re: Index Skip Scan To: jesper.pedersen@redhat.com Cc: Dmitry Dolgov <9erthalion6@gmail.com>, pg@bowt.ie, Thomas Munro , bhushan.uparkar@gmail.com, PostgreSQL-development , Alexander Korotkov References: <707b6f68-16fa-7aa7-96e5-eeb4865e6a30@redhat.com> <89F84E17-D684-4717-B66F-0F05CB00168E@gmail.com> <522092c7-3cb7-a1ec-410b-dfa97ae722f3@postgrespro.ru> <11b7c9d1-ae00-4385-97b2-fcd45f0a1a71@redhat.com> From: Alexander Kuzmenkov Message-ID: <3cfd317e-2a8b-8681-0833-8f2ead3af4d4@postgrespro.ru> Date: Thu, 13 Sep 2018 22:36:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <11b7c9d1-ae00-4385-97b2-fcd45f0a1a71@redhat.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 El 13/09/18 a las 18:39, Jesper Pedersen escribió: > > Yes, this doesn't look good. Using your test case I'm seeing that > unique is being chosen when the group size is below 34, and skip > above. This is with the standard initdb configuration; did you change > something else ? Or did you force the default plan ? Sorry I didn't mention this, the first column is indeed forced skip scan, just to see how it compares to index scan. > This is something to look at -- maybe there is a way to use > btpo_next/btpo_prev instead/too in order to speed things up. Atm we > just have the scan key in BTScanOpaqueData. I'll take a look after my > upcoming vacation; feel free to contribute those changes in the > meantime of course. > I probably won't be able to contribute the changes, but I'll try to review them. -- Alexander Kuzmenkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company