From: Florents Tselai <florents.tselai@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: ADD COLUMN ts tsvector GENERATED too slow
Date: Wed, 6 Jul 2022 12:48:34 +0300
Message-ID: <4ABCA676-9635-421E-83DC-609E87E967AC@gmail.com> (raw)
In-Reply-To: <155880bb-f9d7-a34b-664b-61763b6e8719@enterprisedb.com>
References: <03C74523-7947-42CA-8392-B7CB8EFC16D2@gmail.com>
<155880bb-f9d7-a34b-664b-61763b6e8719@enterprisedb.com>
> On 6 Jul 2022, at 12:38 PM, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>
> 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 around 50M 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’s a smarter way.
>
> Maybe it's stuck on a lock? ALTER TABLE / ADD COLUMN requires an exclusive lock on the table.
Looking at pg_locks and pg_stat_activity doesn’t seem like it’s stuck behind something like ACCESS SHARE or similar.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: florents.tselai@gmail.com, peter.eisentraut@enterprisedb.com
Subject: Re: ADD COLUMN ts tsvector GENERATED too slow
In-Reply-To: <4ABCA676-9635-421E-83DC-609E87E967AC@gmail.com>
References: <03C74523-7947-42CA-8392-B7CB8EFC16D2@gmail.com> <155880bb-f9d7-a34b-664b-61763b6e8719@enterprisedb.com> <4ABCA676-9635-421E-83DC-609E87E967AC@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox