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 1taGSp-000G7X-J4 for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 15:46:52 +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 1taGSo-000cNr-3w for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Jan 2025 15:46:50 +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 1taGSn-000cNi-Qh for pgsql-hackers@lists.postgresql.org; Tue, 21 Jan 2025 15:46:49 +0000 Received: from forward500b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d500]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1taGSk-000kly-1Q for pgsql-hackers@lists.postgresql.org; Tue, 21 Jan 2025 15:46:48 +0000 Received: from mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:de2c:0:640:e39b:0]) by forward500b.mail.yandex.net (Yandex) with ESMTPS id 3010161694; Tue, 21 Jan 2025 18:46:43 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id fkYSIfrOp4Y0-AZFzOXPY; Tue, 21 Jan 2025 18:46:42 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tantorlabs.com; s=mail; t=1737474402; bh=1MJmOoCZijd4xsVFZJ9JCtb4RpBgtfDj9Ong90HUhXw=; h=In-Reply-To:From:Cc:Date:References:To:Subject:Message-ID; b=BZTyAHYrn93JN3eRjKqClsaIVBtM1vtYBUdbF6/G+VZxtcKO8L7DE9zZvkU4bnSqV T/JIWoRHldnEpwbcrbSfd+xa7xuQxpysa4rjhbWM6sLh9b2Mdd17VgEVqjmxNJduAZ ptrbYSYjc5chOcRjd37H+IrkGhSzninum2Lbohro= Authentication-Results: mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net; dkim=pass header.i=@tantorlabs.com Message-ID: Date: Tue, 21 Jan 2025 18:46:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_stat_statements: improve loading and saving routines for the dump file To: m.litsarev@postgrespro.ru Cc: pgsql-hackers@lists.postgresql.org References: <192f7185defa370d083e3a237727b066@postgrespro.ru> <63fd7f0d-2d49-4952-b1ec-fa877bbf0765@tantorlabs.com> <181d7759a2ed7d819add4e0086e7a7f9@postgrespro.ru> Content-Language: en-US From: Ivan Kush Organization: Tantor Labs LLC In-Reply-To: <181d7759a2ed7d819add4e0086e7a7f9@postgrespro.ru> 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 What does this patch give on aglobal scale? Does it save much memory or increase performance? How many times? On 1/21/25 13:51, m.litsarev@postgrespro.ru wrote: >> // Mutex should be last field, as this field isn't copied to dump file > Updated. > >> 2) You didn't take into account the upgrade. Saved in Postgres with >> this byte and try to load in version without this byte. > The PGSS_DUMP_FILE format is defined by PGSS_FILE_HEADER magic number > (the first four bytes in the dump file). Once they does not coinside > (when the file is being read) the statistics are not loaded from the > dump file and set to zero and the irrelevant dump file is skipped. > This is the actual behaviour implemented in the code. > > Respectfully, > > Mikhail Litsarev, > Postgres Professional: https://postgrespro.com -- Best wishes, Ivan Kush Tantor Labs LLC