Re: zabbix on postgresql - very slow delete of events

From: Kristian Ejvind <Kristian(dot)Ejvind(at)resurs(dot)se>
To: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: zabbix on postgresql - very slow delete of events
Date: 2019-07-24 08:11:59
Message-ID: B49FEAF9-D93F-4651-9069-3786CD34502F@resurs.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi.

Well, the events table has both a primary key and foreign keys referencing it, which is not possible
on a partitioned table in postgresql 10. How did you work around this issue?

On the other hand, if we can get the deletion of rows from the events table run at normal speed, I
can't imagine we would have a problem with it in a long time. After all, although our Zabbix installation
definitely is larger than "small", it's still far from "large".

I think I would need assistance with debugging why postgresql behaves like it does.
Is there a defect with deleting data from a table that has multiple foreign keys referencing it from a certain table?
Is there a problem with the query optimizer that chooses the wrong plan when working on the foreign key constraints?
How do I inspect how the db works on the deletion of rows from the referencing tables?

Regards
Kristian

?On 2019-07-23, 16:33, "Kenneth Marshall" <ktm(at)rice(dot)edu> wrote:

On Tue, Jul 23, 2019 at 01:41:53PM +0000, Kristian Ejvind wrote:
> Thanks Kenneth. In fact we've already partitioned the largest history* and trends* tables
> and that has been running fine for a year. Performance was vastly improved. But since you
> can't have a unique index on a partitioned table in postgres 10, we haven't worked on that.
>
> Regards
> Kristian

Hi Kristian,

Why are you not partitioning the events and alerts tables as well? That
would eliminate this problem and you already have the infrastructure in
place to support the management since you are using it for the history
and trends tables.

Regards,
Ken

Resurs Bank AB
Kristian Ejvind
Linux System Administrator
IT Operations | Technical Operations

Ekslingan 8
Box 222 09, SE-25467 Helsingborg

Direkt Tfn:
Mobil: +46 728571483
Vxl: +46 42 382000
Fax:
E-post: Kristian(dot)Ejvind(at)resurs(dot)se
Webb: http://www.resursbank.se

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Maxim Boguk 2019-07-24 13:54:26 Re: zabbix on postgresql - very slow delete of events
Previous Message Kenneth Marshall 2019-07-23 14:33:00 Re: zabbix on postgresql - very slow delete of events