Re: ADD COLUMN ts tsvector GENERATED too slow - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: ADD COLUMN ts tsvector GENERATED too slow
Date
Msg-id 155880bb-f9d7-a34b-664b-61763b6e8719@enterprisedb.com
Whole thread Raw
In response to ADD COLUMN ts tsvector GENERATED too slow  (Florents Tselai <florents.tselai@gmail.com>)
Responses Re: ADD COLUMN ts tsvector GENERATED too slow
List pgsql-general
On 06.07.22 10:42, Florents Tselai wrote:
> I have a beefy server (40+ worker processes , 40GB+ shared buffers) and a table holding (key text, text text,) of
around50M rows.
 
> These are text fields extracted from 4-5 page pdfs each.
> 
> I’m adding the following generated col to keep up with tsvectors
> 
> ALTER TABLE docs_text ADD COLUMN ts tsvector GENERATED ALWAYS AS (to_tsvector(’simple', left(text, 1048575))) STORED
> 
> I expect this to be slow, but it’s been running for 18hrs already and I certainly hope I’ve done something wrong and
there’sa smarter way.
 

Maybe it's stuck on a lock?  ALTER TABLE / ADD COLUMN requires an 
exclusive lock on the table.



pgsql-general by date:

Previous
From: Stefan Froehlich
Date:
Subject: unable to understand query result
Next
From: Peter Eisentraut
Date:
Subject: Re: unable to understand query result