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 1udExw-0051hk-Fb for pgsql-general@arkaria.postgresql.org; Sat, 19 Jul 2025 21:19:32 +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 1udExu-008Asp-1c for pgsql-general@arkaria.postgresql.org; Sat, 19 Jul 2025 21:19:30 +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 1udExt-008Ash-MX for pgsql-general@lists.postgresql.org; Sat, 19 Jul 2025 21:19:29 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1udExr-008B8V-1n for pgsql-general@lists.postgresql.org; Sat, 19 Jul 2025 21:19:28 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-60789b450ceso6073699a12.2 for ; Sat, 19 Jul 2025 14:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752959966; x=1753564766; 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=+/N7SqhygP0IY73KCK8+jcRPcP0v3T1+T5qKGUJIrSc=; b=IqMG/xFrf9vzJjUuaGK6gtzKzlQ1hTP4iP+1rqPzmt5CzUEbLDGlpIrkqz0f4ZMNdB 3LxzYgkVM4S1NbvxRZu0Es5wJB4ifN/Wj+R0LsO4GnR7dtK+t9r6lYe+VmKaLmY/9KzF QW5h0lsTndd/DKEltvGMBd/3YvESsjLDitBOj9uJwl4f+UY0dyrpBDVO6alGz8NnEC12 wT/vZLq1OBdjntZNIZL0SvU6Jzmv1Da9cLZxZKN38jyQiQTUPiwUdx1R2AQX9SRqIX36 u8qTyc0ZZRE+jQm7w00dP3SJG4ZTWxwaanA9L+OwVfnkz3ijom5h8XQs+cgdWUoTTGvG hYaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752959966; x=1753564766; 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=+/N7SqhygP0IY73KCK8+jcRPcP0v3T1+T5qKGUJIrSc=; b=Pp4LZhciaWwYnrP2RSkUb/nZxXNUJybeR9S4Z/Xf4QlDKmgYX5GAKBhyhUX4ZR5UIf pGZfgeztMMx8XGfACIGLtMht5bGETAKu877PgFpXhewek+IbWvAoHNqW1FZo4wtEEcCs ulc+6RjM/wcAfde1vvhaywpIRsxgJtvhuyOXKmnrjUd2UtY5zY+j4VIJWUXM4KK9VYHM DSryvP0ftEl+ctKZDF8pXdEMpsKYGupIOFL9/bCzghD0/qJlBJh1vrJ8Wra15uBYvvhR MhuBtqGYPJKT1UND9QREmqwQtS27sSvhLhmSca/+P8QzwwHCEi3yJ/si/q/u6oy1NGSd caVg== X-Forwarded-Encrypted: i=1; AJvYcCXzU+iUxz/J6taVcvb02ckyhcuuHjRua51QhltFs43UXODfBIFZ3qzgU+LQTFpk1D5gWR+bYG7RB+jDjRzV@lists.postgresql.org X-Gm-Message-State: AOJu0Yz4Ouk9Ahi1OlmfIwf4+loYPMN/e2LX0pjQrfQO497lGxhkSz09 8tBKJdoVjiytTnhh9NXIycR047igJo1Tp9/oX5y6fCPQm0jaD5ZOMAk89a+iiBNFv6DSG/H6LI3 iHBEuoz4aC3S1s+a5PZ0NiWh6kJkRDtA= X-Gm-Gg: ASbGncuFtLhyofaPB/U67N+ota04i6X59VJWT1ahDoXFYm578D/M6mdnTJRxINtrGNv mBal60T+kCmvyyN5Hyl2O3rh2WSDMlYgEYeb88XDupylUNMtt0jEn46R4W3puGGzzOL6QKbFSzt hIQn2FBvIwmRcjAkUKoFlaaSMgMYcCsYgjQCaCyn7q/4nPx54WgXyLyUTn2bhMTafTrF5yanZO6 ytVzEnvybkTAs7uGzu2xN1LvU5yJuoOPm5Km4UusTapbWAF X-Google-Smtp-Source: AGHT+IFWlVtJZhhoFddsnQVsNekL0tF0HRuC4sXKdFsz6INCL5mkqjt+rK2DdjPnYkt0FeKrywdjVDXN1KHbG5ydea0= X-Received: by 2002:a17:906:eeca:b0:ae0:bd48:b9c2 with SMTP id a640c23a62f3a-ae9cdddb7c8mr1162236966b.21.1752959965729; Sat, 19 Jul 2025 14:19:25 -0700 (PDT) MIME-Version: 1.0 References: <8efa554c-ba95-43d5-953c-def0d53dca9e@aklaver.com> <289f005c-4a80-4098-bf58-f53e06bb7f8c@aklaver.com> In-Reply-To: <289f005c-4a80-4098-bf58-f53e06bb7f8c@aklaver.com> From: veem v Date: Sun, 20 Jul 2025 02:49:14 +0530 X-Gm-Features: Ac12FXxR-oLAZJjobMF26lhNSqyN1Ukq8-dWggKNSvwEYqru0WrQ5LSidtS-6Tk Message-ID: Subject: Re: Performance of JSON type in postgres To: Adrian Klaver Cc: Merlin Moncure , "David G. Johnston" , pgsql-general Content-Type: multipart/alternative; boundary="0000000000001018c4063a4ecc1b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001018c4063a4ecc1b Content-Type: text/plain; charset="UTF-8" On Sun, 20 Jul 2025 at 02:29, Adrian Klaver wrote: > On 7/19/25 13:39, veem v wrote: > > > > I thought you are answered that with your tests above? At least for the > Postgres end. As to the Snowflake end you will need to do comparable > tests for fetching the data from Postgres and transforming it. > > Thank you Adrian. Yes will try to test the load from postgres to snowflake to see if any specific format makes a difference in such a situation(mainly considering JSONB seems postgres native only). Additionally I am unable to test upfront, but few teammates are saying below. Are these really true? Wants to know from experts here, 1)The lack of detailed statistics on data distribution within JSONB columns can hinder the query planner from making optimal choices, sometimes leading to slower execution or a reliance on sequential scans even when indexes exist. Storing extensive or deeply nested structures within a single JSONB document can lead to document bloat. 2)Loss of Formatting and Order: The binary format of JSONB doesn't preserve the original order of keys, whitespace, or duplicate keys in the JSON input. 3)Lack of Type Safety and Schema Enforcement: JSONB provides no inherent schema or type validation. This means you can easily insert inconsistent data types for the same key across different rows, making data management and querying challenging. 4)No Native Foreign Key Support: You cannot directly define foreign key constraints within a JSONB column to enforce referential integrity with other tables. Regards Veem --0000000000001018c4063a4ecc1b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sun, 20 Jul 2025= at 02:29, Adrian Klaver <a= drian.klaver@aklaver.com> wrote:
On 7/19/25 13:39, veem v wrote:
>

I thought you are answered that with your tests above? At least for the Postgres end. As to the Snowflake end you will need to do comparable
tests for fetching the data from Postgres and transforming it.

Thank you Adrian.
Yes will try to test the load from= postgres to snowflake to see if any specific format makes a difference in = such a situation(mainly considering JSONB seems postgres native only).
Additionally I am unable to test upfront, but few teammates are saying= below. Are these really true? Wants to know from experts here,

1)Th= e lack of detailed statistics on data distribution within JSONB columns can= hinder the query planner from making optimal choices, sometimes leading to= slower execution or a reliance on sequential scans even when indexes exist= . Storing extensive or deeply nested structures within a single JSONB docum= ent can lead to document bloat.

2)Loss of Formatting and Order:=C2= =A0The binary format of JSONB doesn't preserve the original order of ke= ys, whitespace, or duplicate keys in the JSON input.

3)Lack of Type = Safety and Schema Enforcement:=C2=A0JSONB provides no inherent schema or ty= pe validation. This means you can easily insert inconsistent data types for= the same key across different rows, making data management and querying ch= allenging.

4)No Native Foreign Key Support:=C2=A0You cannot directly= define foreign key constraints within a JSONB column to enforce referentia= l integrity with other tables.
=C2=A0
Regards
V= eem
--0000000000001018c4063a4ecc1b--