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 1tieCR-000kIU-VE for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2025 18:44:35 +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 1tieCO-00CQOc-Nu for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2025 18:44:33 +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 1tieCO-00CQOO-DE for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2025 18:44:33 +0000 Received: from sm-r-010-dus.org-dns.com ([84.19.1.238]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tieCM-000fHu-1h for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2025 18:44:32 +0000 Received: from smarthost-dus.org-dns.com (localhost [127.0.0.1]) by smarthost-dus.org-dns.com (Postfix) with ESMTP id 464D5A1242 for ; Thu, 13 Feb 2025 19:44:37 +0100 (CET) Received: by smarthost-dus.org-dns.com (Postfix, from userid 1001) id 3A572A1603; Thu, 13 Feb 2025 19:44:37 +0100 (CET) X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_INFOUSMEBIZ, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received: from ha01s018.org-dns.com (ha01s018.org-dns.com [62.108.32.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smarthost-dus.org-dns.com (Postfix) with ESMTPS id DE388A1242 for ; Thu, 13 Feb 2025 19:44:36 +0100 (CET) Authentication-Results: ha01s018.org-dns.com; spf=pass (sender IP is 146.185.68.202) smtp.mailfrom=thiemo@gelassene-pferde.biz smtp.helo=dummy.faircode.eu Received-SPF: pass (ha01s018.org-dns.com: connection is authenticated) Date: Thu, 13 Feb 2025 19:44:26 +0100 (GMT+01:00) From: Thiemo Kellner To: "pgsql-generallists.postgresql.org" Message-ID: In-Reply-To: References: <8d2dd92a-da16-435b-a38e-fe72191fc9d1@cloud.gatewaynet.com> Subject: Re: Ideas about presenting data coming from sensors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: X-PPP-Message-ID: <173947226927.334574.1207385117967275685@ha01s018.org-dns.com> X-PPP-Vhost: gelassene-pferde.biz X-POWERED-BY: wint.global - AV:CLEAN SPAM:OK List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 13.02.2025 10:54:05 Achilleas Mantzios - cloud : > If we followed a strict normalized approach then we would create addition= ally 11 tables each tag of type c) . And we are not guaranteed that the sam= e tags would have the same structure over the whole fleet/manufacturers. So= we are thinking of putting all semi-structured data of tags of type c) int= o one table with a single col of type jsonb . From what I read timescaledb = plays nice with jsonb (or at least not bad). > > Do you ppl see any gotcha with this approach ? > > For starters we will not convert yet to timescaledb, but store them and h= andle them like normal tables. At least until we grasp the ins and outs of = this. I have not come to see the real advantage of putting data into something li= ke Jason or XML columns. Sue, you make life easier initially saving the tim= e to put them into columns one by one, on the other end you have the hassle= of dissecting the JSON, XML you name it when you retrieve/select the data,= every query. While the query might stay stable the=C2=A0 computational effort dissection will have to be done with every query execution. For c) you could go to 6th normal form, or what number that is, by a table = like TAG(id, tag_name, tag_value). You would have to convert the values to = string to enter them. It is a pain in the butt, imho, retrieving them again= . You can alleviate by having a specific column/table per data type, e.g. T= AG(id, tag_name,tag_value_varray,tag_value_date,...). What is the downside of having each a table for the special tags? More effo= rt in setting up. The upside is less effort in retrieval, and a much more understandable mode= l. If your tag structure is volatile, you might have generic column names on a= table mapping them in a view to speaking names. Taking this further does a= nchor modelling https://www.anchormodeling.com/ .