Re: Slow UPADTE, compared to INSERT

From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: Ivar Zarans <iff(at)alcaron(dot)ee>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow UPADTE, compared to INSERT
Date: 2003-12-05 12:49:46
Message-ID: 3FD07EEA.8030007@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ivar Zarans 2003-12-05 13:13:25 Re: Slow UPADTE, compared to INSERT
Previous Message Ivar Zarans 2003-12-05 12:38:43 Re: Slow UPADTE, compared to INSERT