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 1tseRB-003yaI-Rc for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 09:01:09 +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 1tseR9-008Jy6-RG for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Mar 2025 09:01:07 +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 1tseR9-008Jxx-HG for pgsql-hackers@lists.postgresql.org; Thu, 13 Mar 2025 09:01:07 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tseR7-002aLk-2E for pgsql-hackers@lists.postgresql.org; Thu, 13 Mar 2025 09:01:06 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-30bf1d48843so6362161fa.2 for ; Thu, 13 Mar 2025 02:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741856464; x=1742461264; 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=CBn7L+x9Ul9WfHtYYonY7GfUNVQWovkYudMUqitSBeU=; b=OdD428Ad4qS4J04rguXY4ExBcT8kXxVPfTLFP61wX0rWkRqaUxFHgefXiVhBjeAmAM td4tgw0EZwJS56SJ7GQEnz8IZ9q3XVOCY1jxIW5TJb5c2Vb0iN+o6DBpzly6O+E1PkBQ mML8WCBVU760cfmp0cyELZD3plWkFWrcBI5HNi6mG0LTFkmjEX7U8o7tYIReVNfHp71W T1j20u5f5YrAe+i7n5Z4tY8flix9RJfLv12W+wRzjeH75CORBPcDen7zEMSu7hyfetNn l2BUbC/hyNnoDoPEMJkG+NF4Nif6kjDh41eb0QD+EbY2nCk+ddUNw2YutnkX+rEeormB Tquw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741856464; x=1742461264; 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=CBn7L+x9Ul9WfHtYYonY7GfUNVQWovkYudMUqitSBeU=; b=C7ddoUWI+ZxEQvwz2ryGnR+SpXhAKmLDwL9bSIDU8rxyNRg8+mjTQUvEVW4B40rags G6CmFNZZMO01f9kyD2ddz4+w18F4I+da+KG1o2tcSLHR1IOwpJHMgdRm71h5+opCvXj6 EePBaUoZD9A75Ieaj2etNTilkwwplQcsCyKLtpQ22qyhB/KuOjCvJ6ev4Fq5wGx7mIY5 rFEjBlPOXmOVPMSt/CrJfyRQqM1QrxRqdSUN0FS3jHHr1ihOgYgOcA7UCt1k0+i3+r6m HUlaCb9x/KvTuhUO9LtyJRpOmpG/YdZ5xEgEnq6flArylBsY53vuL/csZSb9JGfV+nfa DKPQ== X-Forwarded-Encrypted: i=1; AJvYcCVRjrBEzKkj+voYt2How74R4lopu8mfsVcXnLoADHbhp2us0YGQRUC559Wb7JJT+x72qNaSa6dfh3EEvIC3@lists.postgresql.org X-Gm-Message-State: AOJu0YxWmiBBSJKKLGMiZBTmHpcEephQtS4ho5sNr5rYhKFbjDZkPs7w JHmVs6Z0KM7NQoQxGo+AY5s+pj4tadI62WlDJJap0taRPMzSEgohiMo483x7LluUPD04SxiWB2m 0/R9FLxMo9brm0lHM3SzjeEFbhqx7maCV X-Gm-Gg: ASbGncsdX5cnuTsuOHS+4tD7Okbu/kZBW4FxbAWcUofPt9mMhGK6HQ/UriqG07cE9Y+ ajLLa+KWWjw59tcrbXD+49uK3mqx0ku/rU5MnU3xraEtLxw4n1LDDwMmtttUp/HfcNLaNWeJjEK POB0jg7o5/l1h86TasFdj6rwTjg9dLKoTYWJU7i7ZDn/RvhKtPnptc X-Google-Smtp-Source: AGHT+IFN+MW3rgrFFkZECd0mK/OSz0f8v/fXY26Ob8rfqmtu7Q7YhENTrf6tQy80zM2RiSJZv4w6+R4CEAcud2T1opg= X-Received: by 2002:a05:651c:501:b0:309:2ed:72df with SMTP id 38308e7fff4ca-30bf45eb4e7mr91400931fa.24.1741856464019; Thu, 13 Mar 2025 02:01:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kirill Reshke Date: Thu, 13 Mar 2025 14:00:52 +0500 X-Gm-Features: AQ5f1JoCVC_6TZ842tLftbroUJ7w4-f09YOGq90dKCE8lHTFchn15QnmQqwlaQc Message-ID: Subject: Re: relfilenode statistics To: Bertrand Drouvot Cc: Robert Haas , Michael Paquier , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 3 Jan 2025 at 21:18, Bertrand Drouvot wrote: > As mentioned by Andres in [1], relying on the relation OID would not work to > "recover" the stats because we don't have access to the relation oid during crash > recovery. So, I'm going to resume working on the "initial" idea (i.e having the > stats keyed by relfilenode). > > [1]: https://www.postgresql.org/message-id/xvetwjsnkhx2gp6np225g2h64f4mfmg6oopkuaiivrpzd2futj%40pflk55su36ho > Hmm. While it is true that catalog lookups cannot be performed during crash recovery, is it really necessary to save and retrieve statistics after a crash? Given that statistics are permitted to be outdated and server crashes are anticipated to be infrequent, it looks loke losing a few analysis runs due to server crashes is acceptable. In any case, I am totally OK with the relfilenode-based method because it is generally less restricted (to other postgresql parts e.g. wal- replay ) and simpler. Also, this patch needs a rebase;) -- Best regards, Kirill Reshke