Re: Bad performance with cascaded deletes

From: Don Seiler <don(at)seiler(dot)us>
To: Haug Bürger <haug(dot)buerger(at)zalando(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Bad performance with cascaded deletes
Date: 2018-06-12 15:51:12
Message-ID: CAHJZqBDvkLTyESVrTGXOX0Tz7rTj=WNdhUGr9dGiu3pa7YmQZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 12, 2018 at 10:48 AM, Don Seiler <don(at)seiler(dot)us> wrote:

> On Tue, Jun 12, 2018 at 2:26 AM, Haug Bürger <haug(dot)buerger(at)zalando(dot)de>
> wrote:
>
>>
>> "availability_cache_ac_session_id_fkey" FOREIGN KEY (ac_session_id)
>> REFERENCES zpg_data.session(id) ON DELETE CASCADE
>>
>>
> Do you have an index on availability_cache.ac_session_id? These fields
> are not automatically indexed and that can lead to horrible performance on
> cascading operations like this.
>

I'm blind apparently, it's your PK.

--
Don Seiler
www.seiler.us

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Stroupe 2018-06-12 16:31:49 Print pg_lsn as a number?
Previous Message Don Seiler 2018-06-12 15:48:23 Re: Bad performance with cascaded deletes