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 1fpLVB-0001PM-Pb for pgsql-admin@arkaria.postgresql.org; Mon, 13 Aug 2018 22:39:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpLVA-00074t-3s for pgsql-admin@arkaria.postgresql.org; Mon, 13 Aug 2018 22:39:52 +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.89) (envelope-from ) id 1fpLV9-00074m-Sj for pgsql-admin@lists.postgresql.org; Mon, 13 Aug 2018 22:39:51 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpLV5-00026i-Ho for pgsql-admin@postgresql.org; Mon, 13 Aug 2018 22:39:51 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 000EDE89F76D for ; Mon, 13 Aug 2018 15:39:44 -0700 (MST) Date: Mon, 13 Aug 2018 15:39:44 -0700 (MST) From: legrand legrand To: pgsql-admin@postgresql.org Message-ID: <1534199984998-0.post@n3.nabble.com> In-Reply-To: <20180806123050.1fab3011@firost> References: <20180806100201.42a3c794@firost> <20180806123050.1fab3011@firost> Subject: Re: PostgreSQL 11 global index MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, I was wondering if a simple trigger inserting ID values in a dedicated table with an UNIQUE key would have a chance to give similar performances than you trigger checking ID with SELECT count(1) > 1 FROM tabpart WHERE id = NEW.id knowing that both triggers gives the same concurrency benefits ... Find attached a little test case on my PostgreSQL 11beta2 on x86_64-w64-mingw32, compiled by gcc.exe (x86_64-win32-seh-rev1, Built by MinGW-W64 project) 7.2.0, 64-bit inserting 100.000 lignes in a non partitionned table with a unique KEY takes 627 ms inserting 100.000 lignes in a partitionned table (10 part) with "SELECT COUNT" trigger takes 6696 ms inserting 100.000 lignes in a partitionned table (10 part) with "INSERT ID values" trigger takes 1634 ms Is that ratio the same on a Linux box ? I'm suspecting parsing time for "SELECT count(1) > 1 FROM tabpart WHERE id = NEW.id", is that possible ? test_gbl_index.sql Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html