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 1g9sXG-0007fz-FD for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Oct 2018 13:58:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9sXE-0003EX-51 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Oct 2018 13:58:52 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9sWo-00018w-RD for pgsql-hackers@lists.postgresql.org; Tue, 09 Oct 2018 13:58:26 +0000 Received: from mail-qt1-f195.google.com ([209.85.160.195]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g9sWg-0006JM-Sn for pgsql-hackers@lists.postgresql.org; Tue, 09 Oct 2018 13:58:25 +0000 Received: by mail-qt1-f195.google.com with SMTP id d8-v6so1633313qtk.13 for ; Tue, 09 Oct 2018 06:58:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KG3W7aRUO22tJFJg+4Fw9+ASv0fGLiW/bbxVy2oBbrc=; b=Z9o9s1HTCw5tQVbdHgNWQDO7bQb5oPusmnnoCSQpTKQJc9eB4KBh2rgRWiVlrKaI8m JxhNv82gLLiAlRwwp5d1wSH8ZKvrF3lcPckWt47L/p8R8v0eR1CZ5hQOxxLQ6gin2x3t WXXKiZZOZcHtH8bx3Ah0TmRzChDqy3AUE+buvNW2oVebz2MS/re75H7X7OXAvjdOB2xo ElAEV2LCEuBNOYHXTIUbTCoKMUiWwfZezxjWbk2aIh2BtqJ5w+8Ntrtu6TZRoJzPXrzi C2Zz+vAE35l6N+oEXGoHq1DiQvZN4fYBLiQW2oNcQajd3iOc4SAHk3lv1H+AGzP9J29q 6Iqw== X-Gm-Message-State: ABuFfoiZ/DFuFriQ8W+L7yx4fXWBrmW3weMRA6ae0JlAwgSVe27XABap MISoTMOtPkXxOr00ftKsloYs9w== X-Google-Smtp-Source: ACcGV60FuCWd0HA6VzmGJNcxqVGJ91H2lrw8g3UhyPzCRVjcViPv1PqekMPEVRiz4dMAnOIuHMnRgQ== X-Received: by 2002:ac8:37a2:: with SMTP id d31-v6mr23275160qtc.20.1539093497293; Tue, 09 Oct 2018 06:58:17 -0700 (PDT) Received: from localhost.localdomain (c-24-61-8-151.hsd1.ma.comcast.net. [24.61.8.151]) by smtp.gmail.com with ESMTPSA id m13-v6sm4229481qtm.20.2018.10.09.06.58.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 06:58:16 -0700 (PDT) Reply-To: jesper.pedersen@redhat.com Subject: Re: Index Skip Scan To: Pavel Stehule Cc: pgsql-hackers@lists.postgresql.org, Thomas Munro References: <707b6f68-16fa-7aa7-96e5-eeb4865e6a30@redhat.com> <153909254478.1479.11809244127214809171.pgcf@coridan.postgresql.org> From: Jesper Pedersen Organization: Red Hat Message-ID: Date: Tue, 9 Oct 2018 09:58:09 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <153909254478.1479.11809244127214809171.pgcf@coridan.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Pavel, On 10/9/18 9:42 AM, Pavel Stehule wrote: > I tested last patch and I have some notes: > > 1. > > postgres=# explain select distinct a10000 from foo; > +-------------------------------------------------------------------------------------------+ > | QUERY PLAN | > +-------------------------------------------------------------------------------------------+ > | Unique (cost=0.43..4367.56 rows=9983 width=4) | > | -> Index Skip Scan using foo_a10000_idx on foo (cost=0.43..4342.60 rows=9983 width=4) | > +-------------------------------------------------------------------------------------------+ > (2 rows) > > In this case Unique node is useless and can be removed > > 2. Can be nice COUNT(DISTINCT support) similarly like MIN, MAX suppport > > 3. Once time patched postgres crashed, but I am not able to reproduce it. > Please, send that query through if you can replicate it. The patch currently passes an assert'ed check-world, so your query clearly triggered something that isn't covered yet. > Looks like very interesting patch, and important for some BI platforms > Thanks for your review ! Best regards, Jesper