Re: [PERFORM] Slow update statement

2005-08-08 Thread Tom Lane
Patrick Hatcher <[EMAIL PROTECTED]> writes: > Here's the table layout. It's the first time I noticed this, but there > is a PK on the cus_nbr and an index. Does really need to be both and > could this be causing the issue? I thought that if a primary key was > designated, it was automatically

Re: [PERFORM] Slow update statement

2005-08-07 Thread Patrick Hatcher
At the time this was the only process running on the box so I set sort_mem= 228000; It's a 12G box. Tom Lane wrote: Patrick Hatcher <[EMAIL PROTECTED]> writes: Hash Join (cost=1246688.42..4127248.31 rows=12702676 width=200) Hash Cond: ("outer".cus_num = "inner".cus_nbr) -> Seq Scan o

Re: [PERFORM] Slow update statement

2005-08-07 Thread Tom Lane
Patrick Hatcher <[EMAIL PROTECTED]> writes: > Hash Join (cost=1246688.42..4127248.31 rows=12702676 width=200) >Hash Cond: ("outer".cus_num = "inner".cus_nbr) >-> Seq Scan on bcp_ddw_ck_cus b (cost=0.00..195690.76 rows=12702676 > width=16) >-> Hash (cost=874854.34..874854.34 rows=

Re: [PERFORM] Slow update statement

2005-08-07 Thread Patrick Hatcher
Sorry went out of town for the weekend. The update did occur, but I have no idea when it finished. Here's the actual query and the explain Update: cdm.bcp_ddw_ck_cus = 12.7 M cdm.cdm_ddw_customer = 12.8M explain update cdm.cdm_ddw_customer set indiv_fkey =

Re: [PERFORM] Slow update statement

2005-08-07 Thread Patrick Hatcher
Sorry went out of town for the weekend. The update did occur, but I have no idea when it finished. Here's the actual query and the explain Update: cdm.bcp_ddw_ck_cus = 12.7 M cdm.cdm_ddw_customer = 12.8M explain update cdm.cdm_ddw_customer set indiv_fkey

Re: [PERFORM] Slow update statement

2005-08-06 Thread Tom Lane
Patrick Hatcher <[EMAIL PROTECTED]> writes: > I'm running an update statement on about 12 million records using the > following query: > Update table_A > set F1 = b.new_data > from table_B b > where b.keyfield = table_A.keyfield What does EXPLAIN show for this? Do you have any foreign key refere

Re: [PERFORM] Slow update statement

2005-08-06 Thread John A Meinel
Patrick Hatcher wrote: > [Reposted from General section with updated information] > Pg 7.4.5 > > I'm running an update statement on about 12 million records using the > following query: > > Update table_A > set F1 = b.new_data > from table_B b > where b.keyfield = table_A.keyfield > > both keyfield

[PERFORM] Slow update statement

2005-08-06 Thread Patrick Hatcher
[Reposted from General section with updated information] Pg 7.4.5 I'm running an update statement on about 12 million records using the following query: Update table_A set F1 = b.new_data from table_B b where b.keyfield = table_A.keyfield both keyfields are indexed, all other keys in table_A we