There are many factors to consider, but on average I'd say don't bother.
The performance gains you'll see will not be noticeable.  Perhaps doing this
might save you 1/100000 of a second...

The only time you MIGHT take notice of this is if you have millions of
records and many indexes (since the database has to maintain the indexes
when they are updated) but this situation is very rare and I would be
surprised if you are in it.

-----Original Message-----
From: Kola Oyedeji [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 11:27 PM
To: CF-Talk
Subject: Efficient database inserts


Hi

I often have an application which allows a user to edit a record. Even if
the user only updates one field all fields are resaved in the database. Its
occured to me that this may be inefficient. I wondered if I could store the
fields in hidden form fields, check on the update page which fields have
changed and only update the fields that have. I also wondered if this would
be best done in a stored proc on the datebase side but I imagine that the
stored proc would have to call the record, compare the new field values and
then update the neccesary field which be more of a performance hit. Does
anyone know if this is worth doing or are any performance gains going to be
negligble. Also this seems like a feature that databases may already utilise
on a low level but i'm not sure.

Comments anyone?

Thanks


KOla


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to