Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1po5yF-0002Vj-UR for pgsql-performance@arkaria.postgresql.org; Sun, 16 Apr 2023 17:15:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1po5yE-00044u-Ik for pgsql-performance@arkaria.postgresql.org; Sun, 16 Apr 2023 17:15:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1po5yE-00044k-5z for pgsql-performance@lists.postgresql.org; Sun, 16 Apr 2023 17:15:22 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1po5y7-003Gok-3R for pgsql-performance@postgresql.org; Sun, 16 Apr 2023 17:15:21 +0000 Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7606d443bb2so53226939f.1 for ; Sun, 16 Apr 2023 10:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20221208.gappssmtp.com; s=20221208; t=1681665313; x=1684257313; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vgDZ6gcyyCEdLBGdRzfQUcfpCSJA8uj99bC3ZUP1UGA=; b=rFFdq8Kn4QlbUej7WFdT8AMXKeVXd1YWRTobB/YMG2FtuES8x8vxvbd12XAIsvmzYg EwSuBhC68t6nMtYZKGYZjmBjnELd+LRTtrqrrg56+JlUymVLnXe2muaoTZNn5sQUcUIU 4qZuzVP+UUVQBSxATTs14Q8PGArgnw5sQsKlpVRiEFRUPHdBktqm0b96rUqch9TbRrXt YWsMKrZ2dU24dhyoGWEpDEwncSPYK9Kp33vhZyXNUyoUumyVioGjjX3QUJyUN4D4ESM6 RfPvoJoSDp7oP+2+7wBKn6fS8HFNJUwFtNUpDYm9ExCwlkOIyTh7nx8aJyqXeVVw22bj 80Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681665313; x=1684257313; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vgDZ6gcyyCEdLBGdRzfQUcfpCSJA8uj99bC3ZUP1UGA=; b=aDTrYUkZy7OmB/d1sFjBilzDHwFQkeIIBDp4iVZY+NmeWDZ4PVobHbGaWiHepaxtJ5 osj1MskURJpmR4I3M0RziFbClb9D/t03+xCvZhECjC94PokDrWgX5tfjAAXKY3NBJxGp 7TFSoNw0dEI5g6NsnILvabLrYJk4hBN7NgO/GbNGQeDuZLWv7eQuj9C1eRfWZtIpSqdn ayAQ7n6Ft7L9Eg4ORRLgYjJ9sr8SxR++ZeyMiomFciaEcDZFgQ4vHCf2hLUYa0lht3hy aayawnYS+PUaXg/mBR6CeoFairI35AmKHPp6RHsGkYBqBQ9z8AUwUapH7Nfi2xJyEtME 9Yyw== X-Gm-Message-State: AAQBX9fJco8JoJU8Hp+vpeqsrhM6hhj3G925Or/0MOYK6nLOzzNHlSTp CI5MvrgLoOWW1++k9S5hZORy0Q== X-Google-Smtp-Source: AKy350YFgmpOaSO/rAmmpQLoM+YK8UqekkiVrIXenQ9itUiCzG1ITk1MksG2cUVfPo+5gbB6PrLxdQ== X-Received: by 2002:a92:c088:0:b0:310:c6f7:c1e9 with SMTP id h8-20020a92c088000000b00310c6f7c1e9mr8787655ile.5.1681665313117; Sun, 16 Apr 2023 10:15:13 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id s20-20020a056e0210d400b0032722299321sm2674694ilj.21.2023.04.16.10.15.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Apr 2023 10:15:12 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 2AA128006C1; Sun, 16 Apr 2023 12:15:11 -0500 (CDT) Date: Sun, 16 Apr 2023 12:15:11 -0500 From: Justin Pryzby To: Clemens Eisserer Cc: pgsql-performance@postgresql.org Subject: Re: speeding up grafana sensor-data query on raspberry pi 3 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Apr 16, 2023 at 07:00:33PM +0200, Clemens Eisserer wrote: > Hi, > > I am currently trying to migrate an influxdb 1.7 smarthome database to > postgresql (13.9) running on my raspberry 3. > It works quite well, but for the queries executed by grafana I get a > bit highter execution times than I'd hoped for. Suggestions: - enable track_io_timing and show explain (analyze,buffers,settings) - or otherwise show your non-default settings; - show \d of your table(s) - show the query plan for the 6 months query . The query plan may be different, or (if you can run it with "analyze") it may be illuminating to see how the query "scales". - consider trying postgres 15 (btw, v16 will have a beta release next month) https://wiki.postgresql.org/wiki/Slow_Query_Questions -- Justin