Deleting that many records could tie up the server for a while, because 
each individual delete is being logged.
If you used truncate table, the deletions are not logged, and would cut 
about 99.99% of the time off of the operation.

As to counting  the records, don't select them to count them, do a 
"select  count(*) as N" to get the number..

Al

At 01:12 PM 5/7/2001 -0400, Jon Hall wrote:
>Why are you selecting all of the records to get a recordcount? Selecting
>that many records is going to kill CF. That part should be gotten rid of.
>This is what is causing your server to crash.
>CFLock will not stop other people from writing to the database on other
>parts of the site. It would only keep multiple users from executing the code
>on that one page. If you really really need the recordcount, use a stored
>procedure to return it back to CF.
>
>jon
>----- Original Message -----
>From: "Art Broussard" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Monday, May 07, 2001 11:12 AM
>Subject: cflock?? dead brain, Help!
>
>
> > Ever had one of those weekends that are so great that it makes you forget
>everything come monday morning. I did and now I cant read/understand
>anything about locking.
> >
> > So this is the deal.
> >
> > I need to delete all the records from 3 tables. They can have anywhere
>from 24,000 to 100,000 records in them depending on how long its been since
>they have been cleaned out.
> >
> > This is what Im doing. i do a select all to get a total record count (not
>my idea).
> > Next I do a delete all from table.
> >
> > I do this for each of the 3 tables so this can be a real hog and has a
>problem with killing the server.
> >
> > With all this said, I think I want to use a cflock around each of the
>table cleaning queries to keep the users from writing to the tables. What
>would be the best way to do this?
> >
> > Art
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to