Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX5cn-0005E1-Sd for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Apr 2021 17:17:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lX5cm-0000wn-L4 for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Apr 2021 17:17:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX5cm-0000wg-Ez for pgsql-bugs@lists.postgresql.org; Thu, 15 Apr 2021 17:17:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX5cg-0003j7-7J for pgsql-bugs@lists.postgresql.org; Thu, 15 Apr 2021 17:17:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13FHHien3794039; Thu, 15 Apr 2021 13:17:44 -0400 From: Tom Lane To: maxim.boguk@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16964: Quadratic performance degradation of INSERT and ADD CONSTRAINT for intarray/GIST EXCLUDE CONSTRAINT In-reply-to: <16964-5dd796d85c4846cd@postgresql.org> References: <16964-5dd796d85c4846cd@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 15 Apr 2021 10:16:41 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3794037.1618507064.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 15 Apr 2021 13:17:44 -0400 Message-ID: <3794038.1618507064@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > I found that combination of EXCLUDE CONSTRAINT with intarray GIST have > quadratic degradation with relation size. Hm, I couldn't reproduce any such problem using this data set: regression=3D# create table test (team_id int, user_ids int[]); CREATE TABLE regression=3D# insert into test select i, array[i*2,i*2+1] from generate_s= eries(1,4096) i; INSERT 0 4096 regression=3D# create extension btree_gist ; CREATE EXTENSION regression=3D# create extension intarray ; CREATE EXTENSION Time: 19.077 ms regression=3D# ALTER TABLE test ADD CONSTRAINT unique_user_parties_on_team EXCLUDE USING gist ( team_id WITH =3D, user_ids WITH && ); ALTER TABLE Time: 459.005 ms regression=3D# insert into test values (10, array[1,2]); INSERT 0 1 Time: 1.086 ms regards, tom lane