Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQxPY-0001Vk-Ut for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Oct 2020 18:46:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kQxPW-0006LP-2O for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Oct 2020 18:46:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQxPU-0006LH-5g for pgsql-hackers@lists.postgresql.org; Fri, 09 Oct 2020 18:46:33 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQxPR-0001zw-5p for pgsql-hackers@postgresql.org; Fri, 09 Oct 2020 18:46:30 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BB4DF5C00B9; Fri, 9 Oct 2020 14:46:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 09 Oct 2020 14:46:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=vWphwiAbhUEHTWQIDHTvRQFLbuT gE5jTSjMAIbCE3NM=; b=MNf5CIWy6nlk9byQzC71c+McXBN0siU1PzblXwDvnzN KIW2Le4wZeOMiOSEqmtMguHoJFriqaUpOCw9hlutclo8JF1wx/dj2mITk+R0plMs jLl5INdHsP41uFQGgGOfjI3vlbEZhfC703rS22p0ieYKOQ6FP9+LKJOnYC98qWyt XhCMUasrmUXkeUq8eGxOXETNudGe8toO9SgH1kMwG07kxcrUEuigdPCRWwz7s8dW xleBlpqkV9MMw9ELBMZEeGfL7+SR2ktSSUgoF10K22pfs4WNhDjO+lLCLVzc7Wp+ /U1s5d8ypt1VF/FFzn8R1ZICGYGJvwbmD+GCasZaB3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=vWphwi AbhUEHTWQIDHTvRQFLbuTgE5jTSjMAIbCE3NM=; b=dVGv9nqYvP7aFwe/rg1/y5 lUOF3RPdS5/h1vrSKccfFzNMhI+ijshX7E3RiVeOXF+9UNYxsfhTiU9PrDBev7sX 0rAlmizrsv6N39z/Xbwi1uhHVfB6E684+8046EUrijFzNovyjhxXcNbcpXjRXFmZ vwtaiVBNPvXPtcP3LguEwZr2rFgSxX2i4MEkZxPCayfwA6iwTLrD3bDNXcrg2QF6 vHezkDJRSPQnxMLVBLzTES+nEzDtaF5ddTbU+jc22QApnSKZLr37g5W4XFPn4Rmi UIMQ+uGUdMYWXpI6vUuPZ4RSqlPHfkNPBpm2GF7RGwgJWZq/gq9yAh+cmwmkicfQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrhedugddufedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucfkphepieejrdduiedtrddvudejrddvhedtnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdr uggv X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 20AC63064610; Fri, 9 Oct 2020 14:46:27 -0400 (EDT) Date: Fri, 9 Oct 2020 11:46:25 -0700 From: Andres Freund To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: dynamic result sets support in extended query protocol Message-ID: <20201009184625.4hfgpcxzd6jfredb@alap3.anarazel.de> References: <6e747f98-835f-2e05-cde5-86ee444a7140@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e747f98-835f-2e05-cde5-86ee444a7140@2ndquadrant.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-10-08 09:46:38 +0200, Peter Eisentraut wrote: > New would be that the server would now also respond with a new message, say, > > S: DynamicResultInfo > Now, if the client has seen DynamicResultInfo earlier, it should now go into > a new subsequence to get the remaining result sets, like this (naming > obviously to be refined): Hm. Isn't this going to be a lot more latency sensitive than we'd like? This would basically require at least one additional roundtrip for everything that *potentially* could return multiple result sets, even if no additional results are returned, right? And it'd add at least one additional roundtrip for every result set that's actually sent. Is there really a good reason for forcing the client to issue NextResult, Describe, Execute for each of the dynamic result sets? It's not like there's really a case for allowing the clients to skip them, right? Why aren't we sending something more like S: CommandPartiallyComplete S: RowDescription S: DataRow... S: CommandPartiallyComplete S: RowDescription S: DataRow... ... S: CommandComplete C: Sync gated by a _pq_ parameter, of course. > I think this would all have to use the unnamed portal, but perhaps there > could be other uses with named portals. Some details to be worked out. Which'd avoid this too, but: > One thing that's missing in this sequence is a way to specify the desired > output format (text/binary) for each result set. Is a good point. I personally think avoiding the back and forth is more important though. But if we could address both at the same time... > (I suspect what would be more useful in practice is to designate > output formats per data type.) Yea, that'd be *really* useful. It sucks that we basically require multiple round trips to make realistic use of the binary data for the few types where it's a huge win (e.g. bytea). Greetings, Andres Freund