I don't really think that running all of the queries at once will save u much overhead, unless you have a slow db connection, or an extremely high number of queries.
If the connection overhead really is too much, consider using SQLITE. If you want to go ahead with your current plan, cake already stores the queries for you in an array, so you can grab them and write them to a file. However I'm pretty sure you will have to modify core cake methods to use cake to assemble your queries, but then prevent it from executing them. And then you will have to make your own batch query processor, cause I don't think cake has a function to execute multiple queries in one call. Sounds very messy! In short, it would be much simpler to use SQLITE, or put all of your stats in log or xml files. Then have a maintenance script to send all of the logs to your DBMS Good Luck, cook On Mar 14, 1:57 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello everyone! > > I have created my hole app "but", I need to reduce the number of > connections to the database. This is what I have in mind. > > I want to catch all the queries my application asks to the DB (the > ones that goes throught Model->save), append this SQL queries to a > flat file, and run all the queries together using just one connection. > > There is no problem about timming or answers from the DB, since this > is just a stats application, basically I just need to log every call > to my DB. > > What I don't have idea is how to catch the query before it goes to the > database server. Anyone? > > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
