Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id B139F9FB26E for ; Sat, 28 Oct 2006 18:26:14 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 79418-08 for ; Sat, 28 Oct 2006 21:26:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 626D79FA66C for ; Sat, 28 Oct 2006 18:26:08 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 115EB30E0E; Sat, 28 Oct 2006 23:26:07 +0200 (MET DST) From: "Carlo Stonebanks" X-Newsgroups: pgsql.interfaces Subject: Re: pg_exec commit causes extremely long delays Date: Sat, 28 Oct 2006 17:25:53 -0400 Organization: Hub.Org Networking Services Lines: 33 Message-ID: References: <20061028160550.13511.qmail@web38906.mail.mud.yahoo.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 To: pgsql-interfaces@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/30 X-Sequence-Number: 6313 >I do something similiar, but I don't see these delays. Do you have more >details about your circumstance? pgtcl version, PG version, how big the >table is, what kind of processing is being done in the script, etc. Have >you tried simply debugging in the script to see where the bottleneck may >lay? For example, doing a simply puts with clock at various points in the >script. The slowdown is nowhere in the script - it's caused waiting for a return from the call pg_exec $cn "commit". The table contains about 400K rows, typically with about 10 columns (this varies, as the nature of the import application is dynamic). pgTcl package appears to be 1.5 (assuming the package folder pgtcl1.5 refers to v1.5). The import program imports a "flattened" import file and normalises the columns to our enterprise database. All calls to pg_tcl functions are wrapped with custom tcl procs we wrote to put a layer of abstraction between the code and the sql calls. In fact, these wrap-around procs can swtich from pgtcl calls to spi calls so that procs can be re-used in pg server-side TCL SP''s. Included in these wrap-around functions is the ability to call logging functions which write to log files, telling me the execution taime and "explains" for every SQL call, if need be. If the slowdowns were within TCL code, I would expect Ctrl-C to abort the script, but in fact that app is unresponsive to Ctrl-C when the process stalls. PG version is Windows 8.1.2 Carlo