X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 247CBD1B48E for ; Fri, 5 Dec 2003 12:50:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 47259-02 for ; Fri, 5 Dec 2003 08:49:53 -0400 (AST) Received: from smtp.pspl.co.in (unknown [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 9A015D1B454 for ; Fri, 5 Dec 2003 08:49:48 -0400 (AST) Received: (from root@localhost) by smtp.pspl.co.in (8.12.9/8.12.9) id hB5CnwOX026523 for ; Fri, 5 Dec 2003 18:19:58 +0530 Received: from persistent.co.in (daithan.intranet.pspl.co.in [192.168.7.161]) (authenticated bits=0) by persistent.co.in (8.12.9/8.12.9) with ESMTP id hB5Cnvhe026485; Fri, 5 Dec 2003 18:19:57 +0530 Message-ID: <3FD07EEA.8030007@persistent.co.in> Date: Fri, 05 Dec 2003 18:19:46 +0530 From: Shridhar Daithankar Organization: Persistent Systems Pvt. Ltd. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ivar Zarans Cc: pgsql-performance@postgresql.org Subject: Re: Slow UPADTE, compared to INSERT References: <20031204185751.GA15893@alcaron.ee> <20031205014514.GA21079@alcaron.ee> <20031205020728.GA21440@alcaron.ee> <200312051008.20317.dev@archonet.com> <20031205123843.GA27170@alcaron.ee> In-Reply-To: <20031205123843.GA27170@alcaron.ee> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/122 X-Sequence-Number: 4982 Ivar Zarans wrote: > It seems, that PyPgSQL query quoting is not aware of this performance > problem (to which Cristopher referred) and final query, sent to server > is correct SQL, but not correct, considering PostgreSQL bugs. Personally I don't consider a bug but anyways.. You are the one facing problem so I understand.. > Finally - what would be correct solution to this problem? Upgrading to > 7.5 CVS is not an option :) One possibility is not to use PyPgSQL > variable substitution and create every query "by hand" - not very nice > solution, since variable substitution and quoting is quite convenient. > > Second (and better) possibility is to ask PyPgSQL develeopers to take care > of PostgreSQL oddities. > > Any other suggestions? I know zero in python but just guessing.. Will following help? qry = "UPDATE table1 SET status = %s WHERE recid = '%s'" cursor.execute(qry, status, recid) Just a thought.. Shridhar