Re: PostgreSQL 11 global index

From: legrand legrand <legrand_legrand(at)hotmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: PostgreSQL 11 global index
Date: 2018-08-13 22:39:44
Message-ID: 1534199984998-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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
<http://www.postgresql-archive.org/file/t348768/test_gbl_index.sql>

Regards
PAscal

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2018-08-13 22:44:49 Re: PostgreSQL 11 global index
Previous Message Ilyass Kaouam 2018-08-13 21:10:03 Re: Secure dump file