Re: Help understand why DELETE is so slow

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Ping Yao <ping(at)optigo(dot)net>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Help understand why DELETE is so slow
Date: 2023-12-04 21:40:18
Message-ID: CAHyXU0yzTjJ1oZknujB5BwRp-gAbXYCpuMcO40PVWVyX1_LkUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Dec 1, 2023 at 11:48 AM Ping Yao <ping(at)optigo(dot)net> wrote:

> Hello All.
>
> First timer here, long time user though. Thank you in advance.
>
> Can someone help me understand why my simple DELETE query is so slow to
> run?
>

Not familiar with citus to diagnose any citus issues. Having said that,
can you confirm that all tables that have a foreign key reference to this
table have an index on the field referencing?

For example, if you have a table customer, with a column 'customer_id', a
table 'customer_employee' might refer to the customer table if it has
'customer_id REFERENCES customer', which would be very slow with deletes on
customer. that may not be happening here with the citus stuff, hard to
tell. Something to rule out though.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ping Yao 2023-12-04 21:42:47 Re: Help understand why DELETE is so slow
Previous Message Andrew Dunstan 2023-12-04 20:06:31 Re: Emitting JSON to file using COPY TO