Tyler Silcox wrote:

> What's the best way to delete a group based on a list of primary id's 
> from multiple tables?  Right now, I'm testing out the speed on a few 
> selects statements (I figure they'll be a somewhat accurate estimate of 
> time, although I think deletes operate much faster.)


Good databases should have a way to show the query tree and some 
statistics about the estimated time (EXPLAIN is the word to look for in 
the manual). Using that will probably provide more accurate results.


> I grab the user 
> id's in a select statement and then I use "IN" and CF's ValueList() 
> function to select the users in the other tables.  Is there a better way 
> to do this, because right now, it running miserably slow on only 3800 
> records. 


EXISTS is sometimes significantly faster as IN. Also might want to try 
cascading deletes.


> I also need to add one more query and I'd like to put a 
> cftransaction around the cfquery blocks to make sure all my constraints 
> hold up...here's what I have:

Cascading deletes are perfect for that.

Jochem
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to