Re: Slow UPADTE, compared to INSERT - Mailing list pgsql-performance

From Shridhar Daithankar
Subject Re: Slow UPADTE, compared to INSERT
Date
Msg-id 3FD07EEA.8030007@persistent.co.in
Whole thread Raw
In response to Re: Slow UPADTE, compared to INSERT  (Ivar Zarans <iff@alcaron.ee>)
Responses Re: Slow UPADTE, compared to INSERT
Re: Slow UPADTE, compared to INSERT
List 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


pgsql-performance by date:

Previous
From: Ivar Zarans
Date:
Subject: Re: Slow UPADTE, compared to INSERT
Next
From: Ivar Zarans
Date:
Subject: Re: Slow UPADTE, compared to INSERT