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 1ticl0-000UpG-T4 for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2025 17:12:10 +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 1ticky-00B71W-Kh for pgsql-general@arkaria.postgresql.org; Thu, 13 Feb 2025 17:12:09 +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 1ticky-00B71I-9s for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2025 17:12:08 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tickw-000cOy-3B for pgsql-general@lists.postgresql.org; Thu, 13 Feb 2025 17:12:08 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 6DBA2114019D; Thu, 13 Feb 2025 12:12:05 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 13 Feb 2025 12:12:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1739466725; x=1739553125; bh=fHzPnGLq3d9w+pLc1nYLFAgCpMA8HyJR1ffe3FEcCBE=; b= OwWZJyF5WLGyiysNQAbWe4if4cyR1L+z9IgmsO+bfcpHLe79haUNeMhM36ihkGzX NCbFLlaR7w3dknYNYU3F9vu7DRt8/D803DGmxoAZL+Jc6KwcsSI5kmXKze5AJ/eH 2IWKt1MLPnK337IeEnS/4L0MbYdMMOeoyCGuatTILALRC7YgWNdvY0nCdv3dvS/A fn1wsdQydc2znVpSP060IFykm4jhTy7KJ8BDi8l/yI+5RCTStNvTTCNaYxx9zXjC jmHffFJbGmIT+9I4nB2YCBJ6yp9Q6LqjKwCuILX1KpGIWmqGYJYQCeB5QbDHFz9i fIBeRs95U56khRPG5Haufg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1739466725; x= 1739553125; bh=fHzPnGLq3d9w+pLc1nYLFAgCpMA8HyJR1ffe3FEcCBE=; b=x ieMjnyi2Tud5YdAgU4VzcAIc1/XyQLCELo2vuDZlMbhKinzz4P+aqhEIcK/1M9cj QnFbdYN+3VWxSPO7cLxVVKGtPeMpFquR+L/Ix5pTf3CTYmTXhna864vBAnMIR08H QYFADJ6+rrys2WPGuAXAiC9jRP6AsXiyLEDIKqGUwXYnwYrEQEK0N7KglqKEs1A5 gd06YOCWkB+qI1ZA0afQIiogyv5dpUSXZTPkC6cjwZcljuNX5GrS/LhjpgUKL5JX dQO7tJozVfUUbddlHHEeCf3DRd7Cc7k7ZqAYsexbgJk90b/ZyGhscx44a7frd5oh kja8qRsCFtyAaTJA87HtA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegjeefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddv jeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvg hrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpefhveeihfevlefffedt hedukeevfefhfedtgeeifeevteffgfefhedtffetudettdenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegr khhlrghvvghrrdgtohhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopegrrdhmrghnthiiihhoshestghlohhuugdrghgrthgvfigrhihnvght rdgtohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhishhtshdrphhosh htghhrvghsqhhlrdhorhhgpdhrtghpthhtohepihhtuggvvhesghgrthgvfigrhihnvght rdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Feb 2025 12:12:03 -0500 (EST) Message-ID: <6a326644-c149-4f6f-874a-0b027f863146@aklaver.com> Date: Thu, 13 Feb 2025 09:12:03 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Ideas about presenting data coming from sensors To: Achilleas Mantzios - cloud , "pgsql-general@lists.postgresql.org" Cc: Achilleas Mantzios References: <8d2dd92a-da16-435b-a38e-fe72191fc9d1@cloud.gatewaynet.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/13/25 01:53, Achilleas Mantzios - cloud wrote: > Now my problem is on the design . We have : > > a) tags that have primitive values, float4 lets say - this is the > majority, e.g. 60% of all tags > > b) tags that contain alarms data also with defined structure, which have > additional data such as time of the initial alarm set, acknowledgement > of this alarm , validity of this alarm. Those represent smth like 35% fo > all tags > > c) tags that are basically polymorphic (about 11 of them all in all), > each one has different structure, and their fields/cols range a few (1) > up to many (25) > > We have a table for a) and a table for b). > > If we followed a strict normalized approach then we would create > additionally 11 tables each tag of type c) . And we are not guaranteed > that the same 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) into 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 ? The only thing I can see at this time is: 'And we are not guaranteed that the same tags would have the same structure over the whole fleet/manufacturers.' That would seem to me to point to a need for a table that maps a structure template to a fleet or manufacturer and a corresponding field in table c) that holds the fleet/manufacturer information. > > For starters we will not convert yet to timescaledb, but store them and > handle them like normal tables. At least until we grasp the ins and outs > of this. > >> >>> >>> Thank you! >>> >>> >>> >>> >> -- Adrian Klaver adrian.klaver@aklaver.com