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

slow update

From: kevin kempter <kevin(at)kevinkempterllc(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: slow update
Date: 2008-05-20 05:56:27
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Hi all;

I have a query that does this:

update tab_x set (inactive_dt, last_update_dt) =
((select run_dt from current_run_date), (select run_dt from  
cust_id::text || loc_id::text in
(select cust_id::text || loc_id::text from summary_tab);

The current_run_date table has only 1 row in it
the summary_tab table has 0 rows and the tab_x had 450,000 rows

The update takes 45min even though there is no rows to update.
I have a compound index (cust_id, loc_id) on both tables (summary_tab  
and tab_x)

How can I speed this up ?

Thanks in advance for any thoughts, suggestions, etc...



pgsql-performance by date

Next:From: A. KretschmerDate: 2008-05-20 06:15:48
Subject: Re: slow update
Previous:From: PFCDate: 2008-05-19 17:14:48
Subject: Re: I/O on select count(*)

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