Re: Update too slow !!!
Posted in 1998
Douglas Wilson — — source: Informix-list mailing list archive (1991-1998)
On Fri, 24 Jul 1998 14:24:18 GMT, "Hung Phi" <hphi@amtelco.com> wrote: >Hi >t1.id is indexed primary key. It has 1,000,000 rows. >t2.recid is indexed primary key. It has 50 rows. >I have tried several queries below. They all take more than 3 minutes >to update 50 rows in table t1. >update t1 > set col1 = 'A', > col2 = 0 >where t1.id in (select recid from t2) This one shouldn't be bad with only 50 rows in t2 and an index on t1.id. And it not a correlated subquery like the other ones you list (those'll be slow). Maybe you need an 'update statistics' on the tables. Hope that helps, Douglas Wilson