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 1qRXyv-0028uU-A5 for pgsql-admin@arkaria.postgresql.org; Thu, 03 Aug 2023 13:03:09 +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 1qRXys-00DOSt-PB for pgsql-admin@arkaria.postgresql.org; Thu, 03 Aug 2023 13:03:07 +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 1qRXys-00DOSj-Dw for pgsql-admin@lists.postgresql.org; Thu, 03 Aug 2023 13:03:06 +0000 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qRXyk-000KoM-Vw for pgsql-admin@lists.postgresql.org; Thu, 03 Aug 2023 13:03:06 +0000 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1bef8f0904eso650107fac.2 for ; Thu, 03 Aug 2023 06:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691067777; x=1691672577; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=66OlBL14whDv5N0qIiVGQOdmSAexKevtu7nbG6HDWU4=; b=PUQ3zO6uZ9snceCbYfMzbh+VQuD9uCARDSoMOL1fosH5CIP3X5in8i9Z35IW7FxfzE /9xaLkFnUsIdFu7H37YM3/C7vzbsJI6RdTcTbHkeBcK+uzsWkcB6s1ARJ7sXXs9CDhSZ 6fvtFUCFmrtadyn7TvOGmlBZwknwqPtxKBdX0l2QvXgXUzSXZcLGWxszVKln4ZTcUa3U LH2fPU2meiB146Un5WsyiDBjGsgrMFg8SeDZGwTT/2MX8tAdfrBpVFdS/7nPha4JS6Xf 5u+bg0I6clBm5Xg+m970FyBpp5A5uEGNzvsutS+7ZL+yTbrpA8fvYfeyNNBEVrwkygNf Ru3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691067777; x=1691672577; 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=66OlBL14whDv5N0qIiVGQOdmSAexKevtu7nbG6HDWU4=; b=eS+1mCCdE8Eqy68tzt8MP1y1eD8H6G9BIIfq1X/sGafI1y04ndNKUIGWhOGfKaGGFo kqFr+2ctXC77/gYUIPgoBgNafVYrbUut5OPGYCcxUVu5PIqihGDstYx01/qsVQB8Pp0e j09UiEdAeNzG86faRBPLmQj0UJBzbgUgUmn7dGIMj+xHD6OMdZCSNSzV8fc2v/qnBmNm AqUyg6DakIzm3V4LXEHFxibr42u4TrulUzHdLWwVC1BgrN3o4x1PtpcJ4NyD/7vhWofV Pvia+Dh32TjbwfPAMgGZMCko/idwGCNWTlCfneDr8Sak9npFX8kESSmdhSUfJ8E/hRS6 VyWQ== X-Gm-Message-State: ABy/qLZVubnVh+mfSBQMG9Z4ElyW0ZAVKjauBEAERc11FpIQGsefkfe+ nnho9ZGf8o/ZGnc/4PQw9clXqmzVps7IOSisT1xkXfJD X-Google-Smtp-Source: APBJJlGHWluKu+1ryVZGhXSrQhgMqJHb0TdYdzfCmc6j/WdTAiAXrHB0y4MSBa1I+5d5IRHOdn9ZyI9fc1AF9noQG8U= X-Received: by 2002:a05:6870:d28b:b0:1bb:5892:2f76 with SMTP id d11-20020a056870d28b00b001bb58922f76mr19357596oae.4.1691067776663; Thu, 03 Aug 2023 06:02:56 -0700 (PDT) MIME-Version: 1.0 References: <615ccd4a1de716c229cf125260896051b1989608.camel@cybertec.at> In-Reply-To: <615ccd4a1de716c229cf125260896051b1989608.camel@cybertec.at> From: richard coleman Date: Thu, 3 Aug 2023 09:02:45 -0400 Message-ID: Subject: Re: analyze foreign tables To: Laurenz Albe Cc: Pgsql-admin Content-Type: multipart/alternative; boundary="0000000000001e835206020466de" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001e835206020466de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Laurenz, That's great news. Now if only transparent data encryption also arrives in PostgreSQL 16, it will be a time for celebration. rik. On Thu, Aug 3, 2023 at 8:37=E2=80=AFAM Laurenz Albe wrote: > On Tue, 2023-08-01 at 09:47 -0400, richard coleman wrote: > > In PostgreSQL foreign tables are not automatically analyzed and analyze > must be > > specifically called on each table. In the case of sharing tables > between PostgreSQL > > clusters, there is the use_remote_estimate foreign server option. > > > > In some of our multi terabyte databases, manually running analyze on al= l > of the > > foreign tables can take more than a day. This is per database > containing the > > foreign schema. Since we have certain large schema that we have > centrally located > > and share to all of our other database clusters, this really adds up. > > I just saw that PostgreSQL v16 uses remote sampling for ANALYZE on foreig= n > tables. > This is governed by the option "analyze_sampling" on the foreign table or > the foreign > server, and the default value "auto" should be just what you need. > > Yours, > Laurenz Albe > --0000000000001e835206020466de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Laurenz,=C2=A0

That's great news.= =C2=A0 Now if only transparent data encryption also arrives in PostgreSQL 1= 6, it will be a time for celebration.

rik.

On= Thu, Aug 3, 2023 at 8:37=E2=80=AFAM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Tue, 2023-08-01 at 09:47 = -0400, richard coleman wrote:
> In PostgreSQL foreign tables are not automatically analyzed and analyz= e must be
> specifically called on each table.=C2=A0 In the case of sharing tables= between PostgreSQL
> clusters, there is the=C2=A0use_remote_estimate foreign server option.=
>
> In some of our multi terabyte databases, manually running analyze on a= ll of the
> foreign tables can take more than a day.=C2=A0 This is per database co= ntaining the
> foreign schema.=C2=A0 Since we have certain large schema that we have = centrally located
> and share to all of our other database clusters, this really adds up.<= br>
I just saw that PostgreSQL v16 uses remote sampling for ANALYZE on foreign = tables.
This is governed by the option "analyze_sampling" on the foreign = table or the foreign
server, and the default value "auto" should be just what you need= .

Yours,
Laurenz Albe
--0000000000001e835206020466de--