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 1vC680-008xS9-Io for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Oct 2025 00:57:59 +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 1vC67z-00CuNQ-8C for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Oct 2025 00:57:58 +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 1vC67y-00CuNG-VF for pgsql-hackers@lists.postgresql.org; Fri, 24 Oct 2025 00:57:57 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vC67w-003RxG-1D for pgsql-hackers@lists.postgresql.org; Fri, 24 Oct 2025 00:57:57 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-63c12ff0c5eso3138457a12.0 for ; Thu, 23 Oct 2025 17:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761267470; x=1761872270; 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=/WtQGfMQqDuzPgosgSpwD1GHiZz/41cTEP1QNqqR4eg=; b=MIG/yKI9OV47pES5p0AfhBzE2eNZk31VWv13G9oItynLGB3v803CbeuLktMNYLCzEp ZWBYWgKZEpL80W/z3EJUXHXjjv1hGnOvtuN2shDg+haspXx7fS8iHlCuUYMcEYNzdwRU ELVLIUJsIC7ppx9na6DF5e5tLKpREj+UR0OMeKHB6SRFb4qS7G8A3Xz/nKayHkjH2VvV oOpeG24/IUViDnmXfx2ZXxWVoX9/JkX7JsdPJmobq1FiOYGV3u+GMBSRLG+viCSi6SQw BXSKHg2w0fT/d4o9czs97swOIJO0URS5WJGELlKtXcaaNv4K5tpqf/Ze9CBb/k+x+ed0 v4mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761267470; x=1761872270; 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=/WtQGfMQqDuzPgosgSpwD1GHiZz/41cTEP1QNqqR4eg=; b=hpjtM5su1dx7bNLYyl4FUYYI1w91GwK5shxGxhUpdhXvLBdihud28IAMpMnnFKiJvM PImkBUr1gie4RKh/Ptrbp+nApbiQukDoHDzwrlQdV/UYmFydNzKcshPMKHnOXKNsvEL0 8YpoH8gl2hQ7jZicuZkqgrX6Akje+HinoE9kirpfGVq6c9hQfe9B0Z5VlQMhShFPwPvY WhLaIyeRtBuJtdM37UCXRnwEdY5ZqrK/VYN2Bpoj6ZFhqfGpGbPIHTNGxBQCsIy6NIy7 KKLpdYT+YoKWe8aZlTr3kLFMUhKbULPSasrGpMWJLhu27X4CQGxD19n040JSerVAvTmV 0TYQ== X-Gm-Message-State: AOJu0Yyn1QpZ2xu8FysubDBH9fPKBZWGceK/S4d0GRqqu8ucYCVesgMw uFJFeJGjdXPKILUQhAsShWCOsIBGUQ3oHeykJJLCdE/FCs0/O4tSf5sNtDWY30fjS9LMmgyelJI gH30Mb2uEWGjijOre5KamMs05T8JkRG0= X-Gm-Gg: ASbGncuxQm2kdd17McZfOTZ3heAwv6jffv6eKCHI0ac7WSBOFqr5ciUpFSkfb/NS8p+ A0O/3pIFKJgAlFTM3WQm+fJyAScOeWjKMfa3OHInqzdHNLamigxt5RoJEqaphqOLz7Z6mvOdCkx IrCgRF03EeFQRMTdnq400B01k1ySdJIia5TDzHiyPsqcUWol8WA92WxPweZvQONeHCxPh1PevlK tNv+ItsAdTFpaztBOiUzVYu6EWlgwy/nUJsuR+InNBkHVDBOkfLWZYzHSSkD1ZggbSK3yA= X-Google-Smtp-Source: AGHT+IGQALG3GmEV2wZjJmAEogmQdLBAuYMoOthaAxd0toCLmcYVfER/cO6Qy2FChbEaZP17aIN/6gM2lsERptn9us4= X-Received: by 2002:a05:6402:352:b0:63c:274a:4f16 with SMTP id 4fb4d7f45d1cf-63e5eb4b568mr524086a12.16.1761267469694; Thu, 23 Oct 2025 17:57:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Thu, 23 Oct 2025 19:57:38 -0500 X-Gm-Features: AWmQ_bkDtq4XFR1OZh-t7VW4PtgcvTaQrPhMOdRXHwTk4RI1BTtqKVeaFocyCxA Message-ID: Subject: Re: [Proposal] Adding callback support for custom statistics kinds To: Michael Paquier Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Thu, Oct 23, 2025 at 04:35:58PM -0500, Sami Imseih wrote: > > Perhaps if someone wants to have separate files for each different > > types of data, > > we should be able to support multiple files. I think we can add an > > option for the > > number of files and they can then be named "pgstat..1.stat", > > pgstat..2.stat", > > etc. I rather avoid having the extension provide a set of files names. > > So as arguments to the callback, besides the main file pointer ( as > > you mention below), > > we also provide the list of custom file pointers. > > > > what do you think? > > My worry here is the lack of flexibility regarding stats that could be > split depending on the objects whose data needs to be flushed. For > example, stats split across multiple databases (like our good-old > pre-v14 pgstats, but on a per-kind basis). So I don't think that we > can really assume that the list of file names should be fixed when we > begin the read/write process of the main pgstats file. I was trying to avoid an extra field in PgStat_KindInfo if possible, but it's worthwhile to provide more flexibility to an extension. I will go with this. -- Sami Imseih Amazon Web Services (AWS)