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 1iVNW8-0004M8-4w for pgsql-performance@arkaria.postgresql.org; Thu, 14 Nov 2019 22:23: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 1iVNW7-0000uu-07 for pgsql-performance@arkaria.postgresql.org; Thu, 14 Nov 2019 22:23:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iVNW6-0000un-Kg for pgsql-performance@lists.postgresql.org; Thu, 14 Nov 2019 22:23:06 +0000 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iVNW4-0006Ld-8O for pgsql-performance@lists.postgresql.org; Thu, 14 Nov 2019 22:23:05 +0000 Received: by mail-qk1-x735.google.com with SMTP id m4so6472730qke.9 for ; Thu, 14 Nov 2019 14:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=RsmPQ4bAwEKDftsdJKO3ZkIgBHba2SoZe/UmezKbse0=; b=Qj3qk3c5NOZZvqKAFsx7aYxjHN4IwmDFeu+YuX5Nt1Akk71EvmBTAFtbVUV1Xr5UYq JR3eGmGcCgwklHhAl2wa6EX3cXAkAQRdQqi8Ss9tmGpC1i4fIZveBeOLoQy+nd//AAWa QV/++vGrOmSTeN2qAw570qU/clg5SdMI/XDsd1jgMENqPjVdUsNXHcZMbz5RuteqoY1b re5CoUY6KD6eXdj4C1eo8fxTxjJrjwQ8xB0hQIqMWDTTyNSpl/PWHGNKc7VvL3vgK2Ft Asa2r9czruZjZpdWCWk9dFHcxZrcFj+kwyIhQgUs3nljj4J7lQr/db+TqNN5NGBQB/ZJ itLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=RsmPQ4bAwEKDftsdJKO3ZkIgBHba2SoZe/UmezKbse0=; b=Dueq4fQ4KRyB+N6/NkdWRuCpxUY0XTlaNN8C7bUZdz0fCkmkxl9hGpsUqhZzt2aZOZ 3TFH500OSvqyzl4BhrA5ujDyzTeGq91DNpJt5Vj5z9drpTkJc0eTC0w97BQ9YF6HHIkm kTKyGpwP6UJ+4+CdUC/2zrcB7i7Wm11lpF/heCb868Lr1qqDnp2K3X3V4wB0iVlu+yeA ssRhVVe6w8wsRd3Evver3NEzLFrwNQkXEf1ass8k5szhsN2D5cZobznNe6yRFvjMjt2Z 2kkH5nc2V/NDuvaesjxeVbNcbCOYO06HVwXWfOV8AnxWAtEuwsgMo6C7jJn3mHuSNw1W p9og== X-Gm-Message-State: APjAAAVOHhcLJPeAeVqH+ZhMxnpvUJ0hi1BQX9fTajdJtW1+rWe+EC5P YtwYGNY5BbfQgrUo+IQ8HQVPaA== X-Google-Smtp-Source: APXvYqzAJbUAZOTOTBAk4+gifWnvQbUJOrog1eRrqMx4rL/Dpb9PwrZUxUZ41Ihc/zVrfrpfUy1Q2g== X-Received: by 2002:a37:a741:: with SMTP id q62mr10073850qke.435.1573770183563; Thu, 14 Nov 2019 14:23:03 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([172.98.67.9]) by smtp.gmail.com with ESMTPSA id o28sm4099570qtk.4.2019.11.14.14.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2019 14:23:03 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0A3C7300504; Thu, 14 Nov 2019 19:22:59 -0300 (-03) Date: Thu, 14 Nov 2019 19:22:58 -0300 From: Alvaro Herrera To: Craig James Cc: pgsql-performance@lists.postgresql.org Subject: Re: Simple DELETE on modest-size table runs 100% CPU forever Message-ID: <20191114222258.GA23194@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-14, Craig James wrote: > I'm completely baffled by this problem: I'm doing a delete that joins three > modest-sized tables, and it gets completely stuck: 100% CPU use forever. Do you have any FKs there? If any delete is cascading, and you don't have an index on the other side, it'd do tons of seqscans. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services