Comparitive UPDATE speed - Mailing list pgsql-performance

From Josh Berkus
Subject Comparitive UPDATE speed
Date
Msg-id 200210011451.29254.josh@agliodbs.com
Whole thread Raw
Responses Re: Comparitive UPDATE speed
List pgsql-performance
Relative performance question:

I have 2 UPDATE queires in a function.

table_a:  117,000 records
table_b: 117,000 records
table_c: 1.5 million records

 #1 updates table_a, field_2 from table_b, field_1 based on a joining field_3.
Around 110,000 updates
#2 updates table_a, field_5 from table_c, field_2 joining on field_3.
Around 110,000 updates.

#1 takes 5-7 minutes; #2 takes about 15 seconds.  The only difference I can
discern is that table_a, field_2 is indexed and table_a, field_5 is not.

Is it reasonable that updating the index would actually make the query take
20x longer?  If not, I'll post actual table defs and query statements.

--
Josh Berkus
josh@agliodbs.com
Aglio Database Solutions
San Francisco

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Deletes from tables with foreign keys taking too long
Next
From: "Josh Berkus"
Date:
Subject: Re: Comparitive UPDATE speed