Re: seemingly slow for-loop in plpgsql

From: "Claus Guttesen" <kometen(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: seemingly slow for-loop in plpgsql
Date: 2008-09-03 07:20:29
Message-ID: b41c75520809030020h5235e5c3y1991b21393ed5799@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Why in the world are you using a for-loop for this at all? It would be
> tremendously faster as a single SQL command:
>
> update duplicates set hashcode = rtrim(hashcode, E'\n') where length(hashcode) = 33;

Thank you. I was "caught" in the plpgsql-lane. This is of course much
simpler and much faster.

--
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2008-09-03 07:43:01 Re: How do I get min and max from an array of floating point values
Previous Message Achilleas Mantzios 2008-09-03 06:56:32 Re: order of rows in update