That's an interesting thought.... -----Original Message----- From: Jim McAtee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 02, 2002 12:03 PM To: CF-Talk Subject: Re: Efficient Logging Application
Mark, I follow you now. Sounds like a very good idea. Use the struct to parrallel the database table so that I can avoid checking the table itself before doing an UPDATE. I guess your question about StructKeyExists() really gets down to how structs themselves are implemented in CF and how efficient they are when they grow very large. If need be, I could always create this data structure myself, perhaps using a hash or b-tree. Jim ----- Original Message ----- From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, January 02, 2002 2:49 PM Subject: RE: Efficient Logging Application > Jim, > > Yes those are all issues. 10,000 records doesn't seem like too much > (depending on your hardware and how managed your code is) however. My > structure of symbols grows from 0 to around 18,000 routinely throughout the > day. For you, the first time it is built it will be slow, but after that not > bad (I'm assuming a dedicated server and sufficient ram). Also, I was > suggesting that you go ahead and run an update against the database rather > than update the value into the structure. If the ap crashes or CF is > restarted, the only thing you would need to do to get back on track is > rebuild the structure from your database table. The structure basically > functions as a place holder for key names - the values are irrelavant (in my > scheme). I'm was just trying to get you down from 2 queries to 1. As far > as locking goes, I simply use a read-only cflock around my check of the > structurekeys, and an exclusive lock when adding a new key (in the case of a > page not found). It works very well for us (can't speak to others). > > One thing that occurs to me (now) is to examine how "structkeyexists" works. > does it start at the first key created? If that is the case and you are > creating keys from a query, then sorting the query to put your most commonly > accessed pages at the top may give you an added boost. Perhaps Ray could > inform us as to how that function works. > > Mark > > -----Original Message----- > From: Jim McAtee [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 02, 2002 11:17 AM > To: CF-Talk > Subject: Re: Efficient Logging Application > > > Mark, > > That's a possibility. I'd have to evaluate how much memory that might > require. There could easily be 10,000 distinct records. I think I'd either > need to just keep only a day's worth of data within this application > structure, or else write it out periodically to disk, just in case the CF > server crashes or needs to be restarted. > > Also, I wonder about the issue of needing to do an exclusive application > scope lock on this structure for each page view and how it might affect a > very busy site. > > Jim > > > ----- Original Message ----- > From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Wednesday, January 02, 2002 1:39 PM > Subject: RE: Efficient Logging Application > > > > Jim, > > > > How about an application variable - a structure with all the "current" > > pages that is built from your table. Check the structure > > (structkeyexists( )) to see if the your ap is aware of the page - if it's > > not, do an insert, otherwise proceed to the update. I have used this > method > > before for tracking stock quote history and caching daily data. > > > > Mark _________________________ _________________________ ____________________ 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/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ______________________________________________________________________ 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/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

