Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agXmG-0001dr-2G for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 13:15:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agXmF-0006sx-Kq for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 13:15:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agXlb-00053G-HK; Thu, 17 Mar 2016 13:15:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agXlX-0003Hy-Td; Thu, 17 Mar 2016 13:15:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u2HDEwiL024778; Thu, 17 Mar 2016 09:14:59 -0400 From: Tom Lane To: Fabien COELHO cc: Tatsuo Ishii , tharakan@gmail.com, PostgreSQL Bugs List , PostgreSQL Developers Subject: Re: [HACKERS] pgbench -C -M prepared gives an error In-reply-to: References: <20160317.103830.1233779880042690680.t-ishii@sraoss.co.jp> <1563.1458181806@sss.pgh.pa.us> <20160317.114321.169671826955986940.t-ishii@sraoss.co.jp> Comments: In-reply-to Fabien COELHO message dated "Thu, 17 Mar 2016 08:57:24 +0100" Date: Thu, 17 Mar 2016 09:14:58 -0400 Message-ID: <24777.1458220498@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Fabien COELHO writes: >>> Is a connection per transaction really a sane case to consider? >> Yes, I would think. This case reveals the connection overhead. We >> already are able to handle the simple query cases. Why not for >> extended query cases? > Probably it can be made to work, but it is much less useful to prepare a > statement which is known to be needed just once, so I think it would be > fine to simply forbid "-M prepared" and "-C" together. It's certainly a bug that the combination of the switches doesn't work, and I already fixed it (47211af17a). My question was more towards whether -C is a useful benchmarking option at all. I cannot imagine a situation in which, if someone said "I'm doing only one transaction per session, and I have a performance problem", I would not answer "yes, and you just explained why". What I found out when I looked into it was that pgbench had simply failed to consider *at all* whether it needed to reset any state when dropping a connection and replacing it with a new one. That's a really fundamental problem, even if the only symptom we've found so far is "-M prepared" not working. And it's been there since -C was invented, AFAICT. The fact that the bug went undetected this long says a lot about the amount of real-world use the switch gets. So I think it's fair to consider whether we should not eliminate a whole class of future bugs by removing a switch that gets no use. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs