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 1uoleN-009qoE-3q for pgsql-general@arkaria.postgresql.org; Wed, 20 Aug 2025 16:27:00 +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 1uoleM-009fkp-Hv for pgsql-general@arkaria.postgresql.org; Wed, 20 Aug 2025 16:26:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uoleM-009fkg-51 for pgsql-general@lists.postgresql.org; Wed, 20 Aug 2025 16:26:58 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uoleK-000sC1-14 for pgsql-general@lists.postgresql.org; Wed, 20 Aug 2025 16:26:57 +0000 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-88432e6ca05so411959539f.3 for ; Wed, 20 Aug 2025 09:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755707216; x=1756312016; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UkuRy9DdQUQ5ZbdEPwsTQdrRUTlXJsFLCcxcbnKUfaw=; b=IuemJyxnugD1Sd3o7gQ7UnkYf4seKFZ85trVukxjivfJwyphm1uT6I5Wsm3d4ybQb7 96RmRbakGM+sCry2lP7bJsRkrSV6n1HlF6DLIT3bBQ/LprDfLEwOo97oz+ufewiyUnZQ pYzGqpXbZpoDO8XdwoDgf/vgNeNGNqW6dtn4PRVQizYuqLzkW5KpNmIBP8zNcY/0V6R9 MKXSbswNNySIT3VbWljkDkuBpq9M1qqodIi6AXS/ytC1WUVO7C12Izrn8qBX7ujvaor9 M7ofDPG8N3T6UxY1vLqsantDxrSUiSym+GblzrWBa7OG22rFtFbY9FQmXAkdbA+5/WG/ SpwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755707216; x=1756312016; h=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=UkuRy9DdQUQ5ZbdEPwsTQdrRUTlXJsFLCcxcbnKUfaw=; b=hqEzuP1Lq/GbvbmiM29if4jRpleICQ8XZvD2jKsM2BHF/FDyG0cl65CzXa5mLWQUa3 sSP/IaUu4ubr4amOVdQxBww6UhRnolMAJELI4iifZJf51PDEb1KjwAQpaE8NJP1CTfRQ jcsBNFdlD97357NQ3hXCVb7QcPjmPlPZnr3P7IV3i5mW2YG+f1RBLBtrcabqXnXEryYR ThjNQdEQifvn0reS8Bj+c+9uQcAvA30EkwLnCZUT+gHvK4JDoHDZGYV3M1EnU1nCeqVF lVI6a4nfs7hLl6mLZdRSw8rTLw9PntQqoitiDCWvJFICWltQCHzt/lwEk082GRk+1VB1 HYSQ== X-Forwarded-Encrypted: i=1; AJvYcCW9mGXUG06v5VSr+nErXZs6MjND27qU7EvfZ72s35S3Z5hlqNf9jXgvrNjf2eFMyvgL5j+j7mCDJqo5zG0C@lists.postgresql.org X-Gm-Message-State: AOJu0YzIGFPsjuCvMOZ6haJ322EX7rSlaDRmxvPmILNpCftLsXGkvmCP iWCa2hMwMXjHjv8ggDkalO0OuYE7r3ts+avXMThdMA2kfOGeJ07JfBlj0V7v1TKj5B9j8Ch4J7m hWlU68i4xkG4ZC+8aC5DLEz/gxPmHqnc= X-Gm-Gg: ASbGncvW/YLOED7NKKFHyt3tXqnPqEe3PFaMLkb1yTkVOoViYF7NmY9SdeMTq/Xv7Ly k0B9pudKsO0TWv1N6vNBKNQRoJUyyxIo6ItwGmifIFk33sVsh73kHdBzrGHo0d4G11Jnqi6WoFs CQcuvyu9IoooPFlWdlFNpLrXPQGwb6KAZl1CbbLGCBpg3K6lqeXkRTF3ZYfVegUDlcrMTMlOk0B zKvPtix8ToFsigZx9JKZl+MqSQN8s3aZjAGBqt+DQ== X-Google-Smtp-Source: AGHT+IHmFv54kvy7Zqd6iVB1bCwC4JrjqI6qZoHemYEjy+JbFflz/Y3pIDC82fQl1Xrbke/YgLFkQ+mC0R8TJUwAeu4= X-Received: by 2002:a05:6e02:148e:b0:3e5:5af7:7c99 with SMTP id e9e14a558f8ab-3e67c9a6c1amr65215055ab.3.1755707216023; Wed, 20 Aug 2025 09:26:56 -0700 (PDT) MIME-Version: 1.0 References: <601313.1755627596@sss.pgh.pa.us> In-Reply-To: From: Greg Sabino Mullane Date: Wed, 20 Aug 2025 12:26:19 -0400 X-Gm-Features: Ac12FXxbN_Ry5YPat89qYypUKHbsl5DzvYBIOWmlVoE7tB-Ygl4IQa925Oms448 Message-ID: Subject: Re: vacuum analyze query performance - help me understand To: Scot Kreienkamp Cc: Tom Lane , "pgsql-generallists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000f0e1c9063cce7054" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f0e1c9063cce7054 Content-Type: text/plain; charset="UTF-8" Moving forward advice: * Run the query more than once before doing a manual vacuum to rule out caching. * Change your flags for the vacuumdb from --quiet to --verbose and we can see exactly what vacuum has done. Ideally have cron append to a file on disk * Similarly, set log_autovacuum_min_duration to 0 (which logs all autovacuum activity). * As mentioned upthread, use explain (analyze, buffers, settings) for better output * Using the pg_buffercache extension can show you exactly what is in shared buffers (for future debugging) Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support --000000000000f0e1c9063cce7054 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Moving forward advice:

<= /div>
* Run the query more than once before doing a manual vacuum to ru= le out caching.
* Change your flags for the vacuumdb=C2=A0from --= quiet to --verbose and we can see exactly what vacuum has done. Ideally hav= e cron append to a file on disk
* Similarly, set log_autovacuum_m= in_duration to 0 (which logs all autovacuum activity).
* As menti= oned upthread, use explain (analyze, buffers, settings) for better output
* Using the pg_buffercache extension can show you exactly what is = in shared buffers (for future debugging)

Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

--000000000000f0e1c9063cce7054--