Re: Deleting takes days, should I add some index? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Deleting takes days, should I add some index?
Date
Msg-id 20201127150512.GA21099@alvherre.pgsql
Whole thread Raw
In response to Deleting takes days, should I add some index?  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: Deleting takes days, should I add some index?  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-general
On 2020-Nov-27, Alexander Farber wrote:

> Referenced by:
>     TABLE "words_chat" CONSTRAINT "words_chat_gid_fkey" FOREIGN KEY (gid)
> REFERENCES words_games(gid) ON DELETE CASCADE
>     TABLE "words_moves" CONSTRAINT "words_moves_gid_fkey" FOREIGN KEY (gid)
> REFERENCES words_games(gid) ON DELETE CASCADE
>     TABLE "words_scores" CONSTRAINT "words_scores_gid_fkey" FOREIGN KEY
> (gid) REFERENCES words_games(gid) ON DELETE CASCADE

Make sure you have indexes on the gid columns of these tables.  Delete
needs to scan them in order to find the rows that are cascaded to.

> So I ctrl-c (surprisingly not a single record was deleted; I was expecting
> at least some to be gone)

Ctrl-C aborts the transaction, so even though the rows are marked
deleted, they are so by an aborted transaction.  Therefore they're
alive.



pgsql-general by date:

Previous
From: Hemil Ruparel
Date:
Subject: Re: How to debug authentication issues in Postgres
Next
From: Adrian Klaver
Date:
Subject: Re: How to debug authentication issues in Postgres