From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mDsHJf1t3GUlFgEAe85BDQ:P1 (envelope-from ) for ; Mon, 26 Feb 2024 11:54:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id mDsHJf1t3GUlFgEAe85BDQ (envelope-from ) for ; Mon, 26 Feb 2024 11:54:53 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708944893; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=XW6rkJHRVLynLnXU2HJ4EEenBk+PllCWKA7suGkSpek=; b=r/WjNdOQRp2Zv/7BkV2RYLz2bbzeUQS2Sv3A5rHFzptmIgFWAAgdnvBcAfHSEnM7sck7Q7 p2WcpZxmR5dDIZEnpAE+3YzOjF8awhTsqbSzGz9cwVhHMPRH+Hkcs3+a+NMEIeWzhs4GL3 a9nCNuPG+w4e/Nnq2/1tP3HfNZvXURHLgs4T35FVid1xVDYD+5KqRs3diUavKb7lWoIwvD CDQ0Vig6X18/HExP9g8qKceQK2GLzRLdix8xX6Kj/WS8Xrt6ntwjz3H/NC49ctn/HkpE54 nuqd1mJmcBC/NpB9GMCQ/ZGo5ZB5jtjOOAT4YRdqUE6rsEvzn2t1HiDn8Qm3+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708944893; a=rsa-sha256; cv=none; b=smSuzFAonY9EAOY4ATtljzZiTpuQfrRW1vYGEPYMahF4zHcTMp2pbORl2LXQjvuqx7OWLM IoVOZZ0Lp4fn9nSjOZ3KF3aaGYv47BrhUB5J4ocm10T2IxlhhgcaKlDBZv/KSDw8Ay2QXr I9VSqnII1wMRBQnph3NBdPvQEuYHXEGgKBx1aifTwjooxpAIDn+52tK4ZbWvPVSMvO0jWM msWhpkR8ya1ffVAK/mzxXn5xhIIi4S0AlVvmc9oD/YF0FuNpXKsORNqTvEEw+17wEnreUX eNymQsA+nGe0gRlbBu3QEHdqvgMUBPXlAKgOVQwQgQzLyTJuQUKRPXJUFNCbhQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4E45246A9C for ; Mon, 26 Feb 2024 11:54:53 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reYcF-0003An-F6; Mon, 26 Feb 2024 05:53:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reYc5-000338-FM for guix-patches@gnu.org; Mon, 26 Feb 2024 05:53:37 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reYc5-0004Jp-7D for guix-patches@gnu.org; Mon, 26 Feb 2024 05:53:37 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reYcU-0002Un-7W for guix-patches@gnu.org; Mon, 26 Feb 2024 05:54:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69292] [PATCH 4/6] store: database: Stop finalizing prepared statements. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Feb 2024 10:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69292 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: reepca@russelstein.xyz Cc: 69292@debbugs.gnu.org Received: via spool by 69292-submit@debbugs.gnu.org id=B69292.17089448219529 (code B ref 69292); Mon, 26 Feb 2024 10:54:02 +0000 Received: (at 69292) by debbugs.gnu.org; 26 Feb 2024 10:53:41 +0000 Received: from localhost ([127.0.0.1]:54264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reYc8-0002Td-Ma for submit@debbugs.gnu.org; Mon, 26 Feb 2024 05:53:41 -0500 Received: from mira.cbaines.net ([212.71.252.8]:43164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reYc2-0002TK-K0 for 69292@debbugs.gnu.org; Mon, 26 Feb 2024 05:53:39 -0500 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id 424EE27BBE2; Mon, 26 Feb 2024 10:52:38 +0000 (GMT) Received: from felis (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 2e121626; Mon, 26 Feb 2024 10:52:36 +0000 (UTC) References: <4b6a268daab5e0b307dff2229d551a47c9fe1ebc.1708457946.git.mail@cbaines.net> <87y1bcr7ue.fsf@a.a> User-agent: mu4e 1.10.8; emacs 29.1 From: Christopher Baines Date: Mon, 26 Feb 2024 10:50:08 +0000 In-reply-to: <87y1bcr7ue.fsf@a.a> Message-ID: <875xyb8pl9.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.68 X-Spam-Score: -6.68 X-Migadu-Queue-Id: 4E45246A9C X-Migadu-Scanner: mx11.migadu.com X-TUID: rHnAGQsGlgKQ --=-=-= Content-Type: text/plain reepca@russelstein.xyz writes: > Christopher Baines writes: > >> Especially since we're asking for these to be cached. >> >> Management of prepared statements isn't trivial, since you don't want to keep >> them forever as this can lead to poor query performance, but I don't think >> that finalizing them immediately is the right solution. > > guile-sqlite3 arranges for cached statements to only be reset, not > finalized, when sqlite-finalize is called on them (see > https://notabug.org/guile-sqlite3/guile-sqlite3/src/master/sqlite3.scm.in#L283). > The idea behind this admittedly-unintuitive behavior is that it allows > for the caching behavior of a statement to be decided independently of > the code that actually uses it: if it's been decided elsewhere that a > prepared statement is worth keeping around, it will reuse it, but if it > hasn't, it will still properly clean up what it created. > > Perhaps reusing the name 'sqlite-finalize' to make that behavior > transparent wasn't the best choice in the long run. > > I hope that makes the way it was written a bit less baffling. Right, this is something I hadn't realised. I don't think this causes any problems for how I'm using sqlite-finalize though. Thanks for pointing this out. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmXcbXJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XeQNg//SopGtll99qYYhHg3iBVFT49HcJ9CATDz lVa93cxK8gIBnRMVSHo35EFGW2fzpIpCnB100KZMScyoRtfhSwFTUTCHh8EGYYng YA1W7du4b85IbNw4zipMeHd9WZBsyNedyTwtftj3++Ib1egWRHutDBWgUA1AED6M 1IYwWmTKzlbMBnmUn++xmKiinKYg7xDgNW2UWeuWIU6hoIli8CmfsXizQQcohFq7 RMz2LgverA50NMe26IJadFCmsLelxF1wLCz7xbfxFgU5TXB3VOcR9NKuFixhvFV0 zgcYNn6NG+4OQNXewqx3scYxWOEzdDkPzYQr+QATCgKokQ7/LyUG5QPGwPt0ymhF 0uj3oEYTTHLGghxgI8di5EvDT7WBEx4KteBUhgchjj1ir1JPszTahmEk+oiSwCMi SZ6nvac3WcP/2rBDAQ3BkvgRS/SBF11O65lgUs80DA2e8lU5EgS5Xx5UFb5gy0uv pXe1Acseu0fcjZ4xHPuLxzgsMDhEK5DAMrKpW9rgYFjsJBVlZjhE8rhh45DiYlnX E5eVxEQfQ16rIeJHlXFrrMJkC2YZrXrLKMy0c3GeVAPYNqsoi/my9vawCl637N8s Kl0Eiv70pOnL7XrKfgw3ipOQ4skzy5r4kYZjwZjeZ8BBrT4dWs3u0H1LKeiOdvwX IUn8H6Uu5u8= =S9g+ -----END PGP SIGNATURE----- --=-=-=--