Re: Slow UPADTE, compared to INSERT
Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: Ivar Zarans <iff@alcaron.ee>
Cc: pgsql-performance@postgresql.org
Date: 2003-12-05T12:49:46Z
Lists: pgsql-performance
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