List:General Discussion« Previous MessageNext Message »
From:Benjamin Pflugmann Date:July 23 2002 6:01pm
Subject:Re: faster update
View as plain text  

On Tue 2002-07-23 at 08:35:29 -0700, gregd@stripped wrote:
> Hello, 
> 	 I was wondering if there was anyway for me to speed up my
> update query.  I wanted to index the field that i was searching
> for., but i heard that indexing slows down updates or that some
> information might not that true? thanks for any help.

You should index the column if such queries run often or if they do
not, but you really need a speed improvement.

The statement that indexes slow down updates refers to the fact, that
on each update/insert/replace, each index has to be updated. That
means, that an additional index will speed up the update in question
by magnitudes of order, but will slow down all (other) updates a bit
in exchange.

It is a trade-off and the question is simply if you need the speed for
the update in question bad enough. In my personal experience, the
additional disk usage of new indexes was more of a problem than any
speed decrease. YMMV.



> my update statement:
> UPDATE table SET name='NULL' WHERE email='$email'";

faster updateGreg D .23 Jul
  • Re: faster updateBenjamin Pflugmann23 Jul
  • Re: faster updateDan Nelson23 Jul