From: thomas at tada.se (Thomas Hallgren) Date: Mon, 14 Apr 2014 21:32:35 +0200 Subject: [Pljava-dev] Is it safe to use multi-threaded PL/Java in single-threaded postgres process? In-Reply-To: References: <30A6B4B499494CED93770BBC4835840C@maumau> <5F50DAFCABA4426FA54E9D8D0B78B38B@maumau> <534AA39A.4010906@tada.se> <1F2A8D3FBCC3447391A3520631ACBD25@maumau> <534BAE6D.9050201@tada.se> Message-ID: <534C37D3.3090000@tada.se> On 2014-04-14 13:54, MauMau wrote: > From: "Thomas Hallgren" >> 3. For a test like yours, the time it takes to execute the actual >> statement is important. The execution may be so slow that the >> overhead imposed by the network call becomes negligible. A test using >> a lightweight "SELECT 1" instead of the heavier "UPDATE testtable" >> would reveal such issues. > > > But I wonder why in-process execution didn't make a big difference. But that's my point. It may well make a big difference but you don't see it because your tests are using an update statement. The update will do index lookups and physical writes to disk! This means that the update consumes perhaps 90% or more of the overall time, regardless of what calling mechanism you use. Its not a good choice if you want to measure calling mechanism differences. - thomas