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 1v9dPg-0049XK-4I for pgsql-general@arkaria.postgresql.org; Fri, 17 Oct 2025 05:54:03 +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 1v9dPe-0006VC-No for pgsql-general@arkaria.postgresql.org; Fri, 17 Oct 2025 05:54:01 +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 1v9dPe-0006V4-D9 for pgsql-general@lists.postgresql.org; Fri, 17 Oct 2025 05:54:01 +0000 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v9dPb-002E60-2X for pgsql-general@lists.postgresql.org; Fri, 17 Oct 2025 05:54:00 +0000 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-7814273415cso13863907b3.1 for ; Thu, 16 Oct 2025 22:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760680439; x=1761285239; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=FFVfxG+xePdD+u2Ik4h5ykknuoo1NvPbfr5SkwVpXL8=; b=Ag4F0Z0Qj3dRHry19+h9JWvG7hOuTA6VKsyv9QVLfJPa9f1DYj8bxTxgbh8K1ZCVFl cqSQVDlnpFYkt5HohmdrIBToz8a7WPI08aEX5y4AEjQfRw29Qs99qkpqUI41AlTPgyJf NTxe9KY5uphU8Vl8m0xBrzLSCifwcyuTwFJTPQGJ4kbZ//MxcXL3URZqlxvMgYYjN2LT sRZJTRCjTJaJtVFn2sfPgxCRpbrMwBge6qi2thaYDj3dXD0kvkmsJYsP/hp8s4EFra65 xvLiJTvLOAGGgA3T7wifysLhWl+vruHh/aYuqZ/zG/EEaWtSEBTsIMAmgFtBeAZWt0st shzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760680439; x=1761285239; h=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=FFVfxG+xePdD+u2Ik4h5ykknuoo1NvPbfr5SkwVpXL8=; b=UnkBIIiEWCJnX4vj6DbIsP2o7TqHcTCOPvRAgEbvdyrm8coMmT1UZjIcqZAUZA9/Ii tiUxR4l6l+kF6+tXtsWOQDrgecg7VDEFYRJ75mH0FXJPc9gaef6vrRcy7UoJrP+IMcfO /Y+fzBJN69IPim8rJhkFblMoCMZcV17fsaM4Mlw9hnzijatObN2og+eYo+x4FFEQtvg4 3an1k/gbZTAN2YGI8VMUP54KWOvbXx+mLtqnj7W3983/Y3Iap+LjBzKDugrqbJ1xhEM7 46l1jMPu9IOQzHOZnnXZUERyjTyh8AtAUrVE/NfJsWbxphv7/HdsHJ/ri8TF/2ZUxYOP KZTw== X-Gm-Message-State: AOJu0Ywm1DT1qMvpwXy3nEZMoNxMRExkOj1mC8dclnXOHUISRqgsWS3X jg+OUOKeTPzZdj8T2VuTWgTDMwqsSsqhApzjuJxyS1vDWYFkcEQFneauQynkBz6eBbbcf1UHoWf +aPR+BXaSiqd9zNpjJtgsnQKB+QXYgUxYVu5K X-Gm-Gg: ASbGncvxQSf6Q1TrVhkcC7SNe70P7sgmXl2cJKihjWW/Foa12TyMY797IFStobM1e8Q q6ceM6DJbVhhrsTFJd7/Ou8eCpFKP9OWEIpTU5KWjA+TxIV4MCtleeNiKHE0qtXy3mDFYmFgk68 DEOG9PUKE5IdLAXRPSChMEWvcSSUMNUkiI/JV74V9nwKlz7y1pMi/eqhAanQ0XdeLs3WyPCbjr7 SzeRqWOmHSdl/z0a/12Am/Rc5HzBo82+NwDikg+EZhdL7SkjnrE9QNF12O4J+ieQ8+Kz7SU X-Google-Smtp-Source: AGHT+IGb6awp4qZVFfK6n1AnDUkBa57TrhI+VE9OI1yci0mDN1sjucvMx0rutnR0XLTF0XYRFBoKKiPQnOZ5ylTG6DU= X-Received: by 2002:a05:690e:12c5:b0:636:195e:bdc3 with SMTP id 956f58d0204a3-63e16109ecfmr2261305d50.17.1760680438505; Thu, 16 Oct 2025 22:53:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Chanukya SDS Date: Fri, 17 Oct 2025 11:23:47 +0530 X-Gm-Features: AS18NWDB7BCbgLfsq95oYz_LvdMyMhD15PhK-L8mmz28lbpO9bBUsn60GqqFs6U Message-ID: Subject: pg_running_stats - mergeable running statistics (Welford/Chan) extension for postgresql To: pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000019a87e0641545ca7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000019a87e0641545ca7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, I=E2=80=99d like to share a new PostgreSQL extension called pg_running_stat= s. It implements mergeable, numerically stable running statistics using the Welford and Chan algorithms. Unlike the built-in aggregates such as avg(), variance(), and stddev(), which require scanning the entire dataset, pg_running_stats maintains a compact internal state that can be updated or merged incrementally. This makes it well-suited for: 1. streaming or real-time analytics where data arrives continuously, 2. incremental computation over large tables, 3. parallel or distributed queries that need to merge partial aggregates efficiently. The extension computes: mean, variance, standard deviation, skewness, kurtosis, and min/max all in a single pass. It=E2=80=99s written entirely in C, depends only on PostgreSQL headers, and= builds cleanly on macOS (Homebrew) and Linux using PGXS. Source and documentation: https://github.com/chanukyasds/pg_running_stats Any feedback, testing, or suggestions for improvement would be very welcome= . Thanks, Chanukya --00000000000019a87e0641545ca7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

I=E2=80=99d like to share a new Post= greSQL extension called pg_running_stats.

It implements mergeable, n= umerically stable running statistics using the Welford and Chan algorithms.= =C2=A0
Unlike the built-in aggregates such as avg(), variance(), and st= ddev(), which require scanning the entire dataset, pg_running_stats maintai= ns a compact internal state that can be updated or merged incrementally.
This makes it well-suited for:
  1. streami= ng or real-time analytics where data arrives continuously,
  2. <= li>incremental computation over large tables,
  3. = parallel or distributed queries that need to merge partial ag= gregates efficiently.

The extension compu= tes:
mean, variance, standard deviation, skewness, kurtosis, and min/max= all in a single pass.

It=E2=80=99s written entirely in C, depends o= nly on PostgreSQL headers, and builds cleanly on macOS (Homebrew) and Linux= using PGXS.

Source and documentation:
https://github.com/chanukyasds/pg_runn= ing_stats

Any feedback, testing, or suggestions for improvement = would be very welcome.

Thanks,
Chanukya

--00000000000019a87e0641545ca7--