Skip site navigation (1) Skip section navigation (2)

Re: Slow update query

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: elias ghanem <e(dot)ghanem(at)acteos(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow update query
Date: 2010-01-22 03:22:36
Message-ID: 4B5919FC.1070903@postnewspapers.com.au (view raw or flat)
Thread:
Lists: pgsql-performance
elias ghanem wrote:

> Actually this query is inside a function and this function is called
> from a .sh file using the following syntax: psql -h $DB_HOST -p $DB_PORT
> -d $DB_NAME -U $DB_USER -c "SELECT testupdate()"
> 
>  (the function is called 100 times with a vacuum analyze after each call
> for the table).
> 
> So the average execution time of the function is around 2.5 mins,
> meaning that the update query (+ the vacuum) takes 2.5 mins to execute.
> So is this a normal behavior? (The same function in oracle with the same
> environment (with our vacuum obviously) is executed in 11 second).

It might be worth measuring using psql's \timing to see how long the
update and the vacuum take individually.

--
Craig Ringer

In response to

pgsql-performance by date

Next:From: Craig RingerDate: 2010-01-22 03:46:07
Subject: Re: Data Set Growth causing 26+hour runtime, on what we believe to be very simple SQL
Previous:From: Greg SmithDate: 2010-01-22 00:13:01
Subject: Re: ext4 finally doing the right thing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group