From: Jenny Zhang <jenny@osdl.org>
To: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: perf-pgsql <pgsql-performance@postgresql.org>
Cc: general-pgsql <pgsql-general@postgresql.org>
Subject: Re: update slows down in pl/pgsql function
Date: Tue, 16 Dec 2003 16:07:26 -0800
Message-ID: <1071619646.10925.19.camel@ibm-a.pdx.osdl.net> (raw)
In-Reply-To: <20031216155342.J28271@megazone.bigpanda.com>
References: <1071618760.10925.17.camel@ibm-a.pdx.osdl.net>
<20031216155342.J28271@megazone.bigpanda.com>
Oops, I named the var name the same as the column name. Changing it to
something else solved the problem.
Thanks,
Jenny
On Tue, 2003-12-16 at 15:54, Stephan Szabo wrote:
> On Tue, 16 Dec 2003, Jenny Zhang wrote:
>
> > I have stored procedure written in pl/pgsql which takes about 13 seconds
> > to finish. I was able to identify that the slowness is caused by one
> > update SQL:
> >
> > UPDATE shopping_cart SET sc_sub_total=sc_subtotal, sc_date=now()
> > WHERE sc_id=sc_id;
>
> Umm, is that exactly the condition you're using? Isn't that going to
> update the entire table?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: jenny@osdl.org, sszabo@megazone.bigpanda.com, pgsql-general@postgresql.org
Subject: Re: update slows down in pl/pgsql function
In-Reply-To: <1071619646.10925.19.camel@ibm-a.pdx.osdl.net>
References: <1071618760.10925.17.camel@ibm-a.pdx.osdl.net> <20031216155342.J28271@megazone.bigpanda.com> <1071619646.10925.19.camel@ibm-a.pdx.osdl.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox