Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bP4A0-0003mM-GA for pgsql-jdbc@arkaria.postgresql.org; Mon, 18 Jul 2016 08:44:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bP49z-0006Xz-S6 for pgsql-jdbc@arkaria.postgresql.org; Mon, 18 Jul 2016 08:44:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bP49V-0005yb-WE for pgsql-jdbc@postgresql.org; Mon, 18 Jul 2016 08:43:50 +0000 Received: from plane.gmane.org ([80.91.229.3]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bP49S-0001Xs-38 for pgsql-jdbc@postgresql.org; Mon, 18 Jul 2016 08:43:49 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bP49M-0004zA-Gw for pgsql-jdbc@postgresql.org; Mon, 18 Jul 2016 10:43:40 +0200 Received: from 185.40.248.10 ([185.40.248.10]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 10:43:40 +0200 Received: from spam_eater by 185.40.248.10 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Jul 2016 10:43:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: Re: Slow performance updating CLOB data Date: Mon, 18 Jul 2016 10:43:32 +0200 Lines: 21 Message-ID: References: <47856758BAE4794A9EC4FCA2E63FC85E37059326@exchange.intranet.efsw.it> <47856758BAE4794A9EC4FCA2E63FC85E370593D0@exchange.intranet.efsw.it> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 185.40.248.10 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 In-Reply-To: <47856758BAE4794A9EC4FCA2E63FC85E370593D0@exchange.intranet.efsw.it> X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Nicola Zanaga schrieb am 18.07.2016 um 10:13: > Here a snippet: > > st= connection.createStatement(ResultSet.*/TYPE_FORWARD_ONLY/*, ResultSet.*/CONCUR_UPDATABLE/*); > ResultSet resultSet= st.executeQuery("SELECT id, data FROM TestClob1 WHERE id = 1 "); > > > resultSet.next(); > resultSet.updateCharacterStream(2, *new*StringReader("hello"), "hello".length()); > resultSet.updateRow(); > resultSet.close(); Did you try resultSet.updateString(2, "hello") instead? > Most of the time is spent in method PgResultSet.isUpdateable because the table has a primary key but doesn't have a "oid" column. > So the code tries to get primary keys from the query, using getMetaData().getPrimaryKeys. But in order to run an UPDATE on the table, the driver will need to retrieve the PK, there is no way around that. I guess using updateString() won't change that Thomas -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc