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 1uwTuz-002zh3-3V for pgsql-general@arkaria.postgresql.org; Wed, 10 Sep 2025 23:08:01 +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 1uwTux-003vAV-C9 for pgsql-general@arkaria.postgresql.org; Wed, 10 Sep 2025 23:07:59 +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 1uwTuw-003vAN-RM for pgsql-general@lists.postgresql.org; Wed, 10 Sep 2025 23:07:59 +0000 Received: from bumble.birch.relay.mailchannels.net ([23.83.209.25]) by makus.postgresql.org with smtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uwTuv-001jzU-0P for pgsql-general@postgresql.org; Wed, 10 Sep 2025 23:07:58 +0000 X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CCC8184501; Wed, 10 Sep 2025 23:07:54 +0000 (UTC) Received: from pdx1-sub0-mail-a233.dreamhost.com (100-107-7-150.trex-nlb.outbound.svc.cluster.local [100.107.7.150]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 71AEF84549; Wed, 10 Sep 2025 23:07:54 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1757545674; a=rsa-sha256; cv=none; b=GngD4xcnokBxsJimukFYz8EnZik1Y/N8gbWaBG+fjybDGBu3V5IjGxtBjEGjcxHY6snxed YduCdJaUkQ7+mKA2R/mX0gm8xEx6b07DR8c7rIdDiP9S3SYFNHLrT6DhcgDs7uke5ta8Pa zW+vTY+8Zkak0GIf1HyNBizwedsuD87WUw3pG7z5gJ+6zsmJewbd/NsjOL4NIz/GNhZkUK 0pdm1H3YgxaLRDzmZNugvc+b0SlZnDIC9RXe3+RnH3+Hxkt11G05orXYBW2VbNGKSxlkOx Qh7nHXnxcF9LY2YCnVWRWmCZqshOl3WJnEerunDo2xVcWf/WyVgbZjQQRr8WKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1757545674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=h/ho1b/8cqk4mUtbUzxQs6inBNU1hFk8Zt0HMSzNB+s=; b=I11Gtu1jqBXZlybVugTE5YD70e4JO8N+qg4EH2sDyuk654wBaLl+YeML5JqaPXRPe7TPet a+Gam3jhcbE6MZnIltJCWiUiizh82wSFtf5rKWAOz7GzqkJ3y1KuGeTGOjUWMBzwgKeTSt dc+mQnrKHY0sAQDShX/7hRzfaNlg2ax3NSqHicg4Ir6/EYtvjd1l/slvxt7+0UZcFw4Ow4 OqgVHRuXJzhAaa8dey+AGjThnyguaCNcwajA6mtYZGBH1jQ9TumvDOrns/v6qhatlfyPaM QHwR0rmLxbcM49O+S2fcHlBYmrGHkvr3+eeQmurVozqw5oeEFjKJwY8xyKB3Vw== ARC-Authentication-Results: i=1; rspamd-54bcd779b6-7mvtd; auth=pass smtp.auth=dreamhost smtp.mailfrom=nico@cryptonector.com X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com X-MailChannels-Auth-Id: dreamhost X-Average-Shrill: 3d293f2606bed496_1757545674720_2507321942 X-MC-Loop-Signature: 1757545674720:2523455595 X-MC-Ingress-Time: 1757545674720 Received: from pdx1-sub0-mail-a233.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.107.7.150 (trex/7.1.3); Wed, 10 Sep 2025 23:07:54 +0000 Received: from ubby (syn-075-081-095-064.res.spectrum.com [75.81.95.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a233.dreamhost.com (Postfix) with ESMTPSA id 4cMbvF5TXKz6d; Wed, 10 Sep 2025 16:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1757545674; bh=h/ho1b/8cqk4mUtbUzxQs6inBNU1hFk8Zt0HMSzNB+s=; h=Date:From:To:Cc:Subject:Content-Type; b=pSyFOdMQP8eC+JTbAJU8PZYixYvj1hBu9Om/ggb/LVjQjLk0T9N/TetJ8kaCyLeCu JDGaL+3VkG/9/Cb3EZ0Jqi1gdOOUOJkMM/dRw4EcbE3JquoBXand3J8EkBQSguFOqB iGffEB+l67Pfw71NpBxXTFVcDZskA4KOxkEFWg/cg5uNVODkrzRYSbSV9RKj2iHswH P+5f05IxChKfFPcV3wLS7LNEHUs93kKvxPAHy/e6StjaeNnfv7z5mxg5l7cAQ/pCHI TJE1dcXW2sbjKFCZvpFYI22Rl8C86GwvCWPh4WSul++i6ZF1NK9o6+zx2aMFRb9peY DiPDCp0wKEfmg== Date: Wed, 10 Sep 2025 18:07:51 -0500 From: Nico Williams To: Justin Cc: Merlin Moncure , Ellen Allhatatlan , pgsql-general Subject: Re: MVCC and all that... Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Sep 10, 2025 at 06:20:18PM -0400, Justin wrote: > I am not following you here, Databases are going to be bound somewhere at > some point, Disk,IO, Network IO, Memory, or CPU bound. Which one is > causing the bottle neck just depends on the workload and size of the > database. > > The number of idle sessions does not really matter it is just > wasting resources across the entire application stack. Idle sessions do cost something, but I agree it's not much. The point is that if you've got a thread- or process-per-client/request architecture then you can easily make the per-client memory footprint (and cache pressure) of the service much higher than if per-client/req state was minimized (by not spreading it over the stack). If you do that you might go from I/O-bound to memory-bound, though frankly I doubt it. Instead the likely cost of PG's architecture is just that you need more memory per (active) client, which is probably a fine price to pay considering how featureful PG is and how active the PG community is. > > I would really like out-of-band hints. These would be hints not > > specified in the SQL itself but to be sent separately and which address > > table sources or joins by name, like this: > > > > psql> SELECT .. FROM x x1 JOIN y y1 ON .. JOIN y y2 ON .. WHERE ..; > > ...> \hint y1 indexed by .. > > ...> \hint y2 indexed by .. > > ...> ; > > I humbly disagree, the point of SQL being a 4th generation language is, I > tell it what I want, not how to go get what I want. This debate will go on and on. And query planners will continue to plan some queries very poorly. And telling users to deal with it sucks for them. Nico --