Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpvqm-0004Ae-7a for pgsql-performance@arkaria.postgresql.org; Tue, 23 Jul 2019 14:33:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpvqk-0004m1-Tq for pgsql-performance@arkaria.postgresql.org; Tue, 23 Jul 2019 14:33:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpvqk-0004j3-JB for pgsql-performance@lists.postgresql.org; Tue, 23 Jul 2019 14:33:06 +0000 Received: from aart.rice.edu ([168.7.56.48]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpvqg-0005Iv-P8 for pgsql-performance@lists.postgresql.org; Tue, 23 Jul 2019 14:33:05 +0000 Received: by aart.rice.edu (Postfix, from userid 18612) id AC8F6427F28F; Tue, 23 Jul 2019 09:33:00 -0500 (CDT) Date: Tue, 23 Jul 2019 09:33:00 -0500 From: Kenneth Marshall To: Kristian Ejvind Cc: "pgsql-performance@lists.postgresql.org" Subject: Re: zabbix on postgresql - very slow delete of events Message-ID: <20190723143300.GG21184@aart.rice.edu> References: <3EC00A37-57CF-4B43-A737-968A87B02641@contoso.com> <20190723125803.GD21184@aart.rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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