Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxfo2-0004dD-Dn for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Oct 2016 19:48:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bxfo2-0002is-0J for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Oct 2016 19:48:42 +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.84_2) (envelope-from ) id 1bxfo0-0002i7-J9 for pgsql-hackers@postgresql.org; Fri, 21 Oct 2016 19:48:40 +0000 Received: from shout02.mail.de ([2001:868:100:600::217]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bxfnx-0005xk-Hq for pgsql-hackers@postgresql.org; Fri, 21 Oct 2016 19:48:39 +0000 Received: from postfix02.mail.de (postfix02.bt.mail.de [10.0.121.126]) by shout02.mail.de (Postfix) with ESMTP id C512E63317 for ; Fri, 21 Oct 2016 21:48:34 +0200 (CEST) Received: from smtp03.mail.de (smtp03.bt.mail.de [10.0.121.213]) by postfix02.mail.de (Postfix) with ESMTP id B0B3EC0353 for ; Fri, 21 Oct 2016 21:48:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde201610; t=1477079314; bh=QprB+iBNP59nZWV+OCLkLaO7SOFP3qujfBwduaEUPt8=; h=To:In-Reply-To:From:Subject:Date:From; b=c7bFN+ALrgetBrW8nXespjI86Re+v9ChCXzeJGcrtqRGCVijvSmoUckmkgF3Xa2US Q12LFIZaz6AKlIJyDwUXE2lNFcd3BA4K8aP59HJfLIlG/x4jpRdZA8xqXzof9GkL/V KrSPvbOqmiAxOF87NQG9fC59ilX0kPgAEEIW/Kjg= Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp03.mail.de (Postfix) with ESMTPSA id 53DAC4007B for ; Fri, 21 Oct 2016 21:48:34 +0200 (CEST) To: PostgreSQL-development In-Reply-To: From: "Sven R. Kunze" Subject: Re: Indirect indexes Message-ID: Date: Fri, 21 Oct 2016 21:48:33 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1190 X-purgate-ID: 154282::1477079314-0000085D-F9386B97/0/0 X-Pg-Spam-Score: -3.0 (---) 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 On 2016-10-18 20:04:32, Claudio Freire wrote: > You don't need that limitation (and vacuum will be simpler) if you add the PK as another key, akin to: > > CREATE INDIRECT INDEX idx ON tab (a, b, c); > > turns into > > CREATE INDEX idx ON tab (a, b, c, pk); I know I am late to this point but I wanted to present my mere user's point of view. First I liked it, as does not introduce yet another syntax to learn. However, after following the discussion, I see that indirect indexes have their disadvantages/slowdowns as well. If adding "pk" to the end of the column list just converts the index to an indirect index, I am unable to use a direct index which might be better in certain cases. So, from a "dumb" user's point of view, I wonder if PostgreSQL can make the right decision of direct/indirect reliably (which would be great). And if not, what would be the alternatives? Introducing CREATE DIRECT INDEX? Cheers, Sven PS: I mot saying I would be affected by this but IIRC we have (..., pk) indexes in production which then would be converted to indirect ones. But I cannot tell whether indirect indexes would do good or harm there. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers