Comparitive UPDATE speed

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Comparitive UPDATE speed
Дата
Msg-id 200210011451.29254.josh@agliodbs.com
обсуждение исходный текст
Ответы Re: Comparitive UPDATE speed  (Ron Johnson <ron.l.johnson@cox.net>)
Список 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 по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Deletes from tables with foreign keys taking too long
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Comparitive UPDATE speed