BUG #14949: array_append() - performance issues (in update) - Mailing list pgsql-bugs

From jarda.urik@gmail.com
Subject BUG #14949: array_append() - performance issues (in update)
Date
Msg-id 20171206105000.21691.37546@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #14949: array_append() - performance issues (in update)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14949
Logged by:          Jaroslav Urik
Email address:      jarda.urik@gmail.com
PostgreSQL version: 10.1
Operating system:   Ubuntu server 16.04
Description:

Hello, 
I am having (time) issues with UPDATE of Array of INTEGERs:

Update eg:
UPDATE id_mng.id_pair SET segment = array_append(segment,7) WHERE
project_guid = '...' AND id_p IN ( SELECT... )


Table definition:
CREATE TABLE id_mng.id_pair
(
  project_guid character varying NOT NULL,
  id_p character varying NOT NULL,
  type_p integer NOT NULL,
  segment integer[],
  ...
  CONSTRAINT id_pair_pkey PRIMARY KEY (project_guid, id_p, type_p)
)

That inner select return at about  3 sec, but the UPDATE as a whole runs for
minutes (I stopped it after 10mins). On my other system with postgres 9.5.10
with identical data, it finishes after 15sec.

Please advise

Thank you 

Jaroslav Urik


pgsql-bugs by date:

Previous
From: Sandeep Thakkar
Date:
Subject: Re: BUG #14947: Installation Errors
Next
From: Tomas Vondra
Date:
Subject: Re: BUG #14932: SELECT DISTINCT val FROM table gets stuck in aninfinite loop