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.)  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.  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:

getMyRecordset (Records=3848, Time=210ms)
SQL = 
SELECT MyUser_id 
                FROM MyUsersEmail 
WHERE Valid = 0 
                        AND Reason = 'undeliverable'

getTableUno (Records=3848, Time=280ms)
SQL = 
SELECT FirstName, LastName 
                FROM TableUno
WHERE MyUser_id IN (#ValueList(getMyRecordset.MyUser_id)#)

getTableDos (Records=3017, Time=84872ms)
SQL = 
SELECT Subset_id, SubsetName 
FROM TableDos 
WHERE MyUser_id IN (#ValueList(getMyRecordset.MyUser_id)#)

Tyler
email | [EMAIL PROTECTED]

______________________________________________________________________
Get Your Own Dedicated Windows 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=coldfusionb
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