Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XOV6h-0008N0-29 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Sep 2014 17:09:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XOV6g-00046u-E5 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Sep 2014 17:09:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XOV6f-000450-2x for pgsql-hackers@postgresql.org; Mon, 01 Sep 2014 17:09:29 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XOV6b-0008TX-SO for pgsql-hackers@postgresql.org; Mon, 01 Sep 2014 17:09:28 +0000 Received: from [192.168.1.102] (62.175.246.114.static.riosat.com [62.175.246.114]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MdLEp-1XgzrI3tMh-00IVKb; Mon, 01 Sep 2014 19:09:20 +0200 Message-ID: <5404A83E.7010405@2ndQuadrant.com> Date: Mon, 01 Sep 2014 19:09:18 +0200 From: Hannu Krosing Organization: 2ndQuadrant Nordic =?windows-1252?Q?O=DC?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Andres Freund , Hannu Krosing CC: Tom Lane , Alvaro Herrera , Greg Stark , Pg Hackers Subject: Re: On partitioning References: <20140829155607.GF7705@eldon.alvh.no-ip.org> <21166.1409331142@sss.pgh.pa.us> <20140829171228.GG7705@eldon.alvh.no-ip.org> <21834.1409332516@sss.pgh.pa.us> <5400C280.8070305@2ndQuadrant.com> <20140901155225.GJ20990@awork2.anarazel.de> In-Reply-To: <20140901155225.GJ20990@awork2.anarazel.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:EjlycitPY2109faQQ8/QAwCw3b97DNo6Hx2D5soV+d5 Jo6uK5WLbRvN5YmGkZ4fEiFV/pyZl2hKXl2rbb2G1BF+eSNote U2PZrHIPnxweG//feTR9HkPyArfjC38Elhv9HH/sG5yhobl6u8 8h+jxkv18zVoD0nBUBS19lCyOikJg4fwni/P5av6Z3bjGy7Ypv k6umvjLmEY4uYDhrDDtY0Q4tlJeFtTjOHlPMtymrlacN/mVVkE qsHalLp/OJszp2ZiyNc5dvAl/mLfwVJC44j7ImjqlH6Y6PmE8u amPem4lkTN1+ybPdpEOLFAFh8h0PUs41jbwamkrUyhPSy2gNBZ 1f6In8QXWyIJk396yhK36bRdvoOJlUc6PUQs4DPm4 X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -2.7 (--) 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 09/01/2014 05:52 PM, Andres Freund wrote: > On 2014-08-29 20:12:16 +0200, Hannu Krosing wrote: >> It would need to replace plain tid (pagenr, tupnr) with triple of (partid, >> pagenr, tupnr). >> >> Cross-partition indexes are especially needed if we want to allow putting >> UNIQUE constraints on non-partition-key columns. > I actually don't think this is necessary. I'm pretty sure that you can > build an efficient and correct version of unique constraints with > several underlying indexes in different partitions each. The way > exclusion constraints are implemented imo is a good guide. > > I personally think that implementing cross partition indexes has a low > enough cost/benefit ratio that I doubt it's wise to tackle it anytime > soon. Also it has the downside of (possibly) making DROP PARTITION either slow or wasting space until next VACUUM. So if building composite unique indexes over multiple per-partition indexes is doable, I would much prefer this. Cheers -- Hannu Krosing PostgreSQL Consultant Performance, Scalability and High Availability 2ndQuadrant Nordic OÜ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers