Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eX8d2-0002fq-Ig for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jan 2018 16:44:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eX8d1-0001YR-Si for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jan 2018 16:44:27 +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 1eX8d1-0001YH-Lm for pgsql-hackers@lists.postgresql.org; Thu, 04 Jan 2018 16:44:27 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eX8cu-0007yP-5q for pgsql-hackers@postgresql.org; Thu, 04 Jan 2018 16:44:26 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id AA88420ABC; Thu, 4 Jan 2018 11:44:16 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Thu, 04 Jan 2018 11:44:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=fUENDf LMFXGVgk1JRKlwscjeLf3zNG6qx2cxsW7XfmY=; b=rOA7sDgLF1ltOocHcHuDb/ PJrsOsecteqEsb9eIu1BQxxVfttxF8wcKegVwxQh3Y86CmHzh7YYccVg8eFhgBD6 GLB1imG7TG4sooFKQgh76G+OQCS1Uu7lWYQFqQEYx83nHr2TUcZXyDSQcsoVL8/u yjcnBRbn0mcu3g+lGnY9omvWE5ej8YYkGV4M0zhFQUzFUtxb/w+fU+oVo6HE5axh vElDZVtrkRy12HFIJp9j7RnqVrcbikSFUvLcM127xRkX9jqwl7DjQxYctXgyjvBb 7qYd64fSY+hm9IO0gr0WcBA2vtiIkvXJqaB38z1yod4bEWkZ2O4f4RkPDkkyabMw == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id EF4B97E351; Thu, 4 Jan 2018 11:44:15 -0500 (EST) Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table To: Alvaro Herrera , Amit Langote References: <20171229175930.3aew7lzwd5w6m2x6@alvherre.pgsql> Cc: Jesper Pedersen , Robert Haas , David Rowley , Simon Riggs , Pg Hackers , Maksim Milyutin From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <239c2d51-2762-4e03-339b-d36f2f69edca@2ndquadrant.com> Date: Thu, 4 Jan 2018 11:44:15 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20171229175930.3aew7lzwd5w6m2x6@alvherre.pgsql> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/29/17 12:59, Alvaro Herrera wrote: >> Maybe we need a new "auto internal" deptype with a mix of semantics of >> the other two deptypes. It seems a bit ugly and I'm not sure it'd work >> either ... I'll try to code it tomorrow. > > This seems to work pretty well, much to my surprise. I was a bit scared > of adding a new deptype, but actually the only affected code is > findDependentObjects() and the semantics of the new type is a subset of > the existing DEPTYPE_INTERNAL, so I think it's okay. I need to fill in > its description in docs and comments though -- I left it out because the > real difference between INTERNAL and INTERNAL_AUTO is not something that > is covered by the existing description of INTERNAL, so maybe I'll need > to expand that one. So this patch appears to implement what was agreed upon earlier in the thread. Documentation and tests seem pretty comprehensive. The new dependency type obviously needs to be explained in detail. CompareIndexInfo() doesn't compare indexes' operator classes and collations. I'm not sure why this feature of automatically picking up matching indexes even exists. Is it for some specific workflows or upgrade scenarios? It's kind of a surprising feature in a way. The catalog representations of partitioned tables and partitioned indexes are completely different, which may or may not be desirable. As mentioned elsewhere already, the tests fail because \di shows the owner, which can vary between sites. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services