very slow update query

From: Ilija Vidoevski <ilija(dot)vidoevski(at)yahoo(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: very slow update query
Date: 2012-07-30 17:50:53
Message-ID: 1343670653.9249.YahooMailNeo@web113112.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I need to update one table in my database with simple code

This is the script

 update finarh
 set vid = left(nalog,1)

Table has 177714 rows.

First execution time was : 00:02:39 minutes
Repeated execution time: 00:01:03 minutes.

Explain query plan is:

"Update on finarh  (cost=0.00..12049.99 rows=177714 width=172)"
"  ->  Seq Scan on finarh  (cost=0.00..12049.99 rows=177714 width=172)"

Why execution time is so loooong ?

Thank's
Ilija Vidoevski

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Kretschmer 2012-07-30 18:04:50 Re: very slow update query
Previous Message James David Smith 2012-07-30 17:06:13 Re: LOOP Functions - where to start?