Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brrC7-0005oT-1H for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Oct 2016 18:45:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1brrC6-0000NU-KE for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Oct 2016 18:45: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.84_2) (envelope-from ) id 1brrC4-0000Lt-UL for pgsql-hackers@postgresql.org; Wed, 05 Oct 2016 18:45:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1brrBn-0004tO-Dm for pgsql-hackers@postgresql.org; Wed, 05 Oct 2016 18:45:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u95Iir17023492; Wed, 5 Oct 2016 14:44:53 -0400 From: Tom Lane To: Robert Haas cc: Amit Kapila , Anastasia Lubennikova , Andrey Borodin , pgsql-hackers , Anastasia Lubennikova Subject: Re: WIP: Covering + unique indexes. In-reply-to: References: <56168952.4010101@postgrespro.ru> <20160814171131.21390.75752.pgcf@coridan.postgresql.org> <8d6b5b13-9c41-bd41-9c86-497e4e6a46ab@postgrespro.ru> <374642a5-b84e-faab-5d5c-18e558bde195@postgrespro.ru> Comments: In-reply-to Robert Haas message dated "Wed, 05 Oct 2016 12:59:41 -0400" Date: Wed, 05 Oct 2016 14:44:53 -0400 Message-ID: <23491.1475693093@sss.pgh.pa.us> X-Pg-Spam-Score: -4.5 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: > On Wed, Oct 5, 2016 at 9:04 AM, Amit Kapila wrote: >> Okay, but in that case I think we don't need to store including >> columns in non-leaf pages to get the exact ordering. As mentioned >> upthread, we can use truncated scan key to reach to leaf level and >> then use the complete key to find the exact location to store the key. >> This is only possible if there exists an opclass for columns that are >> covered as part of including clause. So, we can allow "order by" to >> use index scan only if the columns covered in included clause have >> opclass for btree. > But what if there are many pages full of keys that have the same > values for the non-INCLUDING columns? I concur with Robert that INCLUDING columns should be just dead weight as far as the index is concerned. Even if opclass information is available for them, it's overcomplication for too little return. We do not need three classes of columns in an index. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers