Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viTn1-007VY6-31 for pgsql-general@arkaria.postgresql.org; Wed, 21 Jan 2026 08:42:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1viTn0-0060cL-2U for pgsql-general@arkaria.postgresql.org; Wed, 21 Jan 2026 08:42:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viTk3-005wSu-0a for pgsql-general@lists.postgresql.org; Wed, 21 Jan 2026 08:39:07 +0000 Received: from mail-10627.protonmail.ch ([79.135.106.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1viTk0-001gVk-2O for pgsql-general@lists.postgresql.org; Wed, 21 Jan 2026 08:39:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seinlet.com; s=protonmail3; t=1768984740; x=1769243940; bh=oDLYmGbDs5qRJyQsku4XP+RLG/9KdOUc0bcEVLKfY/k=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=aeW6mbWnwHKXYV4yhrtTK3aIi30AbqFMQZVbArqPs9ZNfv5gSmwgHxhFS3oK3wv2P FlhipTCTYCMxNCUO8pA8IKqnbSQX5p5jYt0ll1DuKXMjTMPdfLboEYyBF48h6BfSLW nBvMZqGQix7q7oLuRP6XLcBazbV2+8CLDffp6CzAbrRoZoSTeFSm50+S7099CSyItT NKVPy4yGudk6OqnwVZMqGlHWjEWak1IQ67w8r5NCe5ob9wat+XEAgY8OVQdg6czoWO N0r8/tH/PEl39tydS7ocfSXQKrVE508sN4Zg0s0U6cr43QkiQMoQzRUHIFvxsu5SS2 tZIMJrm4u4avg== Date: Wed, 21 Jan 2026 08:38:56 +0000 To: "pgsql-general@lists.postgresql.org" , Adrian Klaver From: Nicolas Seinlet Subject: Re: pg_trgm upgrade to 1.6 led to load average increase Message-ID: In-Reply-To: References: Feedback-ID: 32582315:user:proton X-Pm-Message-ID: 2b2f2b7da70670f4441a7d8a18bebef784032eb1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tuesday, January 20th, 2026 at 17:34, Adrian Klaver wrote: >=20 >=20 > On 1/20/26 00:50, Nicolas Seinlet wrote: >=20 > > Hello, > >=20 > > we've upgraded the pg_trgm extension from 1.0 to 1.6 on our production > > database, while sticking our postgresql cluster version to 16. This led > > to an increase in the load average of the server (twice the load averag= e > > on our use case). After investigation, we found our issue was linked to= : > > https://github.com/postgres/postgres/ > > commit/935f6666502250abde8615bc7805a6e5aa05a066 > postgres/postgres/commit/935f6666502250abde8615bc7805a6e5aa05a066> > >=20 > > We issue queries like : > > SELECT model, res_id FROM ir_model_data WHERE module=3D'base' AND > > name=3D'public_user'; >=20 >=20 >=20 > You need to provide the table definition, including indexes. >=20 Hello, here is the table definition: Table "public.ir_model_data" Column | Type | Collation | Nullable | = Default -------------+-----------------------------+-----------+----------+--------= ----------------------------------- id | integer | | not null | nextval= ('ir_model_data_id_seq'::regclass) create_uid | integer | | | create_date | timestamp without time zone | | | timezon= e('UTC'::text, now()) write_date | timestamp without time zone | | | timezon= e('UTC'::text, now()) write_uid | integer | | | noupdate | boolean | | | false name | character varying | | not null | module | character varying | | not null | model | character varying | | not null | res_id | integer | | | Indexes: "ir_model_data_pkey" PRIMARY KEY, btree (id) "ir_model_data_create_uid_idx" btree (create_uid) WHERE create_uid IS N= OT NULL AND (create_uid <> ALL (ARRAY[1, 208196])) "ir_model_data_model_name_multilang_index" btree (name) WHERE model::te= xt =3D ANY (ARRAY['account.account'::character varying::text, 'account.grou= p'::character varying::text, 'account.tax'::character varying::text, 'accou= nt.fiscal.position'::character varying::text]) "ir_model_data_model_res_id_index" btree (model, res_id) "ir_model_data_module_name_uniq_index" UNIQUE, btree (module, name) "ir_model_data_name_idx2" gist (name gist_trgm_ops) "ir_model_data_write_uid_idx" btree (write_uid) WHERE write_uid IS NOT = NULL AND (write_uid <> ALL (ARRAY[1, 208196])) Check constraints: "ir_model_data_name_nospaces" CHECK (name::text !~~ '% %'::text) > > Thanks in advance, > >=20 > > Nicolas >=20 >=20 >=20 > -- > Adrian Klaver > adrian.klaver@aklaver.com