Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tdzmG-00BEQ5-DH for pgsql-performance@arkaria.postgresql.org; Fri, 31 Jan 2025 22:46:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tdzmF-0037mD-0b for pgsql-performance@arkaria.postgresql.org; Fri, 31 Jan 2025 22:46:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tdzmE-0037m4-J4 for pgsql-performance@lists.postgresql.org; Fri, 31 Jan 2025 22:46:18 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tdzmB-002bbG-0f for pgsql-performance@lists.postgresql.org; Fri, 31 Jan 2025 22:46:17 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-38632b8ae71so2127913f8f.0 for ; Fri, 31 Jan 2025 14:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20230601.gappssmtp.com; s=20230601; t=1738363574; x=1738968374; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fwR0tlhjDBtKIO6wZSeByYgiDN3vjTr7mKV5lO00g8Y=; b=P/7WtaIGFMNx/gy7aypbJ2rPzQPVpSnKOsXVYAwFeFz9Bq6h0ktbX8MOSqner14t8A H36EyRg4IO29JthMwz/NdVMkZ3OSBt5w/S3oBd50rJf+x3IZLHtdtjh+Yq2o849n1QI9 6bOkobznQvTZvd8ezMdT0I5V1PXpNu/9vfJmv5lGfESXfEFej/06mJgaOLgQwLQP8mb/ 2fkGiWdg1XxpH9Sq9EnVoyrmGmiUl14wbjJoO2SS3zUr+XXidoo5bVfFGC+By4SBmcDX k8lrE393+93DuBEEGKDMvDA+ZbcZIn4lVIzMHTmnYwpSsKmDDNP3UtXQXFYychHrPfEf ZfYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738363574; x=1738968374; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fwR0tlhjDBtKIO6wZSeByYgiDN3vjTr7mKV5lO00g8Y=; b=iSY+TcbI3YcD9f6iEt7Yauzq/UPokjIesvSudi96EJ7YZZpncUwp3E/rXrQtRyXz6c WOJmCDqNTSzOLdhgJMZVfdBA9zycIQqacj0DteseYFK+OuyBv32kOCDbsHdY0xNY2ybm jPRod5ay5JsImQOvZGd8WkFTerbyoWLbaLlvfbllPX17K3jPSmzEqgp9gRioit7cKek1 Vxv+zhYVw9GoPIgbtkOMgr6uiNGVUiMGiis4Koch/H3tNGGjvJkV0yJlfstTz4pLsQB8 rVp3vYSv/O7seWFRWG/KGx/Mf+viJfKAnyrlE+nq/6KucPkjNUDEWI6svInLkPEXSM40 Ie1w== X-Gm-Message-State: AOJu0YwITQ7+Er3mCjL+b226BqrOZ/AhqDF3QTYEEDRdD6tNmuEUG3rk 2INju8fmhe/ir5fn0ryglYieTnAPrs3ft1nJexkGhbnB31LvqNc5PA2Lq8WdNLm3ytJSEhmySyW 6iZgvO26dy6roOVD/QCgXe0Zd2EMv5iAPOd/olA== X-Gm-Gg: ASbGncvBZzyE723LI0fEDyG/z6a0w/nfNehA8SvV71HZuZWflm4qMDUI4DWeKyr/Y5r MXeEHhiZmuMiTBj6lbsFPJRxZBVAPYTPDwns6o22+239j74oJNB5ReW4VS1lkO85ZrBWBHorm X-Google-Smtp-Source: AGHT+IFMOiasyF+N+PASZ2Dtoas8czwU1+OSsVe5xKkO2pzk0Edg9xldvfaBvR/+QxAC+wBU/ULCI0MH4SO9R9P1pPY= X-Received: by 2002:a5d:6d06:0:b0:38a:a11e:7af6 with SMTP id ffacd0b85a97d-38c5194f38bmr10831194f8f.6.1738363574296; Fri, 31 Jan 2025 14:46:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Geoghegan Date: Fri, 31 Jan 2025 17:45:48 -0500 X-Gm-Features: AWEUYZki53ayYxjwyL5CY9zNGUqziTu9FkIT9aAwH-KlrPoMU0GmFXPvboSKXv8 Message-ID: Subject: Re: High System CPU Usage on Selects Seemingly Caused By Vacuum of Same Table To: Joshua Banton Cc: pgsql-performance@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 31, 2025 at 5:28=E2=80=AFPM Joshua Banton w= rote: > The issue mostly manifests near the end of the "scanning heap" phase of v= acuuming of one of our largest tables, we'll call table1. RDS Performance I= nsights reports that selects on table1 start to wait on cpu, where previous= ly it didn't even show up in the top 25 queries by wait. It doesn't always = happen, but if there is a larger than usual number of selects on table1 it = is more likely to happen. Does this database also have many tables? As in thousands of tables? I am reminded of this issue: https://www.postgresql.org/message-id/flat/da3205c4-5b07-a65c-6c26-a293c646= 4fdb%40postgrespro.ru I've heard of this happening when an aggressive VACUUM updates relfrozenxid on a larger table. --=20 Peter Geoghegan