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 1sotWy-00EbxH-90 for pgsql-admin@arkaria.postgresql.org; Thu, 12 Sep 2024 23:47:21 +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 1sotWx-003w7h-TL for pgsql-admin@arkaria.postgresql.org; Thu, 12 Sep 2024 23:47: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 1sotWx-003w7S-Ha for pgsql-admin@lists.postgresql.org; Thu, 12 Sep 2024 23:47:19 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sotWt-000tUV-UF for pgsql-admin@postgresql.org; Thu, 12 Sep 2024 23:47:18 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3e04552579cso121346b6e.2 for ; Thu, 12 Sep 2024 16:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726184835; x=1726789635; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=dFyCk4ezIjilr9Nn5lO3vZIr8gQ/MJreFCcf3v12mxY=; b=k23s5uzwhQzLdFUY0IQnqAG2H6AtSmfijrTnoAgB7wqN34Oc1+RYri7lS+olZIzYv1 4j6qFvZQFlOaaX2g3tWq23x/YlV+844/GJaL+Erc3e6SW61YEUMHafIFcvwUR7gC9QSS E2l0kZT5WrkJ0NbXbzyDH1I/bYE7AlhvUheiNhVwD9XNxIXMvXN19y3ibYTXcXKL3OPg dRKjA5NqaoQg1Fa0p+714Y4Rfc4oN66bSwznImxV5F69btGb3w05uP/PEFRqlyQNEd94 +S8tsfRR7XomZAzDHhngmTGeRtB8EfmPpLptSs+42DVHLoZTcMIgeIS0a7oZ2b8qwAs2 Lh5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726184835; x=1726789635; h=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=dFyCk4ezIjilr9Nn5lO3vZIr8gQ/MJreFCcf3v12mxY=; b=H6uwkD9j3Yurvb/ti+UhAbNZb1YK26vz95Al1BEgtIoFTxjCBfgv5rt1g9vys9QHdt GyaMaE9mB4qJqaKkTXpjxj4FWxdztBw+wtyIjlVIaxOKsffRNbiag5UHCtZcdR756wCT MT6ZPLPn6lwt6S8mOs+fv8Om993kIQJ3+ErWYe3PVmJPiGQoPDqnBx0C/wzDManWXaje OojtUBI3IzW35IZsSidAyQ/bP/uO5Con5iW6JcQwKtPS4l7Nw0uPpXSQAu9qvEtULExI BZM4ATLDiZL5MzVBGrH2VpZpyOQVMlRZPguGzffYL+5vPTm4OQzyan0Vu1g/C3TLFeFZ MsLw== X-Gm-Message-State: AOJu0YwxHPOhg68B2LFLayfQOeE6XIIsP8eYDX9nJOhSMUFBkAW/auCG ZJ+ewk/6t5pLAP3fSUQxxm8sZsPoioNzOW2ANx9aR/LikZlqYHSTxpYzcp4kt+JX6N0SL0DlFBp TmwsYWJhdmglMEPM6TzpAWVTEG1gcLQ== X-Google-Smtp-Source: AGHT+IGcM3xoc+uPB8RKofCeUc08rmU/2OFbgoE8Bmjzrq+q8FlKQNQX6kcC564L/3uFdk6fWjRMWSv4R1KNPSAtuRs= X-Received: by 2002:a05:6808:3207:b0:3e0:6ae1:3e8f with SMTP id 5614622812f47-3e07a16c91dmr519127b6e.29.1726184834755; Thu, 12 Sep 2024 16:47:14 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Thu, 12 Sep 2024 19:47:03 -0400 Message-ID: Subject: Re: Query plan getting less efficient over time with frequent updates and deletes.. To: pgsql-admin Content-Type: multipart/alternative; boundary="000000000000e476630621f4b943" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e476630621f4b943 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 12, 2024 at 6:52=E2=80=AFPM Wells Oliver wrote: > Hi all: we have a table which receives frequent daily updates and deletes > on the order of 100-600k. The overall row length is approximately 80m. Th= is > table has 50 indexes and 303 columns and is quite frequently queried by > humans and applications. > > I've been in the habit of using pg_repack maybe once a month on this tabl= e > because I can't quite figure out why querying gets bogged down. The vacuu= m > and analyze thresholds are set such that the table is both auto vacuumed > and analyzed every night. > 1. You're absolutely positive that the VACUUM and ANALYZE complete every night? 2. Nightly may not be often enough. --000000000000e476630621f4b943 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Sep 12, 2024 at 6:52=E2=80=AFPM W= ells Oliver <wells.oliver@gmai= l.com> wrote:
Hi all: we have a table which receives frequent daily updates and del= etes on the order of 100-600k. The overall row length is approximately 80m.= This table has 50 indexes and 303 columns and is quite frequently queried = by humans and applications.

<= div style=3D"font-size:small">I've been in the habit of using pg_repack= maybe once a month on this table because I can't quite figure out why = querying gets bogged down. The vacuum and analyze thresholds are set such t= hat the table is both auto vacuumed and analyzed every night.
=C2=A0
1. You're absolutely positive that the= VACUUM and ANALYZE complete every night?
2. Nightly may not be o= ften enough.

--000000000000e476630621f4b943--