Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] Query counting

propel
Discussion topic

Back to topic list

Re: [propel-dev] Query counting

Reply

Author Cameron Brunner <cameron dot brunner at gmail dot com>
Full name Cameron Brunner <cameron dot brunner at gmail dot com>
Date 2007-07-14 01:26:36 PDT
Message I'm tempted to move any query logging support into DebugPropelPDO and
make the 'production' PropelPDO as fast as possible after splitting
this off...

On 7/13/07, Hans Lellelid <hans at velum dot net> wrote:
> Just chiming in to say that all this makes sense to me :) I definitely
> agree that a debug flag is a good idea. I think we should keep the
> default PropelPDO system "production ready". We shouldn't need to swap
> the PDOStatement object for non-debug PropelPDO, right?
>
> I like the idea of moving the query logging into the
> PropelDebugPDOStatement (or whatever it's called) class.
>
> Hans
>
> Cameron Brunner wrote:
> > A - We need to store the entire query in memory if we are to do
> > duplicate query detection.
> > B - If we dont, we incur quite an overhead to do func_get_args and
> > call_user_func etc so if we dont we pay a penalty even in production
> > hence the way i did that
> > C - true, specially if you have unbuffered queries enabled, its just a
> > bit of a guide on what returns a lot of rows. We could also add a
> > memory usage check onto the dtor, that would be about when all rows
> > are hydrated... we could also add the true flag to the memory usage
> > functions, i dont know the difference tho
> > D - We can still add these into PropelPDO and since DebugPropelPDO
> > extends it that will run automatically still... nice and seamless and
> > easy... i have had propel's name cursed at work since we couldnt see
> > the final sql that was being ran easily (having to replace the ?'s by
> > hand)
> >
> > Always plenty of options, i have been wanting a way to automatically
> > profile an application in development and when a 'slow' or 'expensive'
> > (memory wise) query is ran then to display it. I was considering a
> > Smarty debug style popup to be able to be enabled...
> >
> > Anyway, thats where i was going with it. I think i answered everything
> > in your email but im freezing so im gonna go crawl under a blanket
> > instead of sitting here. Hit me up with any questions or thoughts on
> > this.
> >
> > On 7/13/07, Oliver Schonrock <oliver at realtsp dot com> wrote:
> >> Cameron Brunner wrote:
> >> > I would be more interested at this point in offering DebugPropelPDO as
> >> > a connection object type and adding a full array of debug info (query
> >> > timing, counting, dupe query detection) to it and have a flag that
> >> > switches to it when requested. Query timing generally interests me
> >> > more than the count.
> >>
> >> I agree with much of this. Query timing would certainly be useful.
> >>
> >> There are questions about the tactical details, most of which are
> >> stylistic and there is no "right" answer:
> >>
> >> a) do we want a full array of sql strings in an array in memory? Would
> >> this extra information be better in the query log which is already
> >> storing the sql strings (if configured in runtime conf).
> >>
> >> b) Do we want to have a "debug" switch in Propel to tell it which PDO
> >> class to instantiate or just add the functionality to the standard
> >> PropelPDO class and then enable the extra logging/counting with
> >> build|runtime config (similar to log now). If we do want to instantiate
> >> different PDO classes, then would we rather pass a Classname into propel
> >> via the build|runtime config? This would give the Propel user lots of
> >> flexibility
> >>
> >> c) memory usage reporting as implemented in Cameron's patch may be
> >> slightly misleading as the Stmt::execute (et al) calls don't really use
> >> much memory compared to instantiating the objects from the result set.
> >> Even if you have mysql_buffered_query turned on, the memory used for
> >> buffering the query result is not reported by memory_get_usage(),
> >> although you will see your apache process grow in ps|top (substitute
> >> your own tools here for non *nix/apache users).
> >>
> >> d) If we are going to provide a PDOStatement extension as part of
> >> propel, then this gives us the option of moving the Propel::log() call
> >> from PropelPDO::prepare() to the same 3 places where I had incQueryCount
> >> and Cameron had debugQueryLog() (ie 2 places in PropelPDO, and one in
> >> PropelPDOStatement). This would mean we make log file entries when the
> >> query is actually run rather than prepared plus allows the addition of
> >> the extra info (like query time) into the log file.
> >>
> >> Thoughts? Opinions?
> >>
> >>
> >> --
> >>
> >> Oliver Schonrock
> >>
> >>
> >>
> >
> >
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>


--
Cameron Brunner

Want a better web browser?
http://www.spreadfir​efox.com/?q=affiliat​es&id=182780​&t=1

« Previous message in topic | 17 of 36 | Next message in topic »

Messages

Show all messages in topic

translation cysio Krzysio 2007-07-10 09:28:18 PDT
     Re: [propel-dev] translation hlellelid Hans Lellelid 2007-07-10 09:52:07 PDT
         Query counting Oliver Schonrock <oliver at realtsp dot com> Oliver Schonrock <oliver at realtsp dot com> 2007-07-12 05:38:54 PDT
             Re: [propel-dev] Query counting hlellelid Hans Lellelid 2007-07-12 05:43:28 PDT
                 Re: [propel-dev] Query counting Oliver Schonrock <oliver at realtsp dot com> Oliver Schonrock <oliver at realtsp dot com> 2007-07-12 06:40:03 PDT
                 Re: [propel-dev] Query counting Oliver Schonrock <oliver at realtsp dot com> Oliver Schonrock <oliver at realtsp dot com> 2007-07-12 11:25:28 PDT
                     Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-12 14:27:16 PDT
                         Re: [propel-dev] Query counting hlellelid Hans Lellelid 2007-07-12 14:29:11 PDT
                             Re: [propel-dev] Query counting hlellelid Hans Lellelid 2007-07-12 14:32:11 PDT
                                 Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-12 14:34:25 PDT
                                     Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-12 15:02:17 PDT
                                         Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-12 15:04:01 PDT
                         Re: [propel-dev] Query counting Oliver Schonrock <oliver at realtsp dot com> Oliver Schonrock <oliver at realtsp dot com> 2007-07-13 01:47:24 PDT
                             Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-13 04:03:01 PDT
                                 Re: [propel-dev] Query counting Pieter Nobels <pieter at opengate dot be> Pieter Nobels <pieter at opengate dot be> 2007-07-13 04:10:27 PDT
                                 Re: [propel-dev] Query counting hlellelid Hans Lellelid 2007-07-13 06:55:53 PDT
                                     Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-14 01:26:36 PDT
                                 Re: [propel-dev] Query counting Oliver Schonrock <oliver at realtsp dot com> Oliver Schonrock <oliver at realtsp dot com> 2007-07-13 09:32:08 PDT
                                     Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-14 01:40:29 PDT
                                         Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-14 04:22:35 PDT
                                             Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-14 04:36:04 PDT
                                                 Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-16 15:48:32 PDT
                                                     Re: [propel-dev] Query counting Cameron Brunner <cameron dot brunner at gmail dot com> Cameron Brunner <cameron dot brunner at gmail dot com> 2007-07-17 18:53:07 PDT
                                                     Re: [propel-dev] Query counting Oliver Schonrock <oliver at realtsp dot com> Oliver Schonrock <oliver at realtsp dot com> 2007-07-19 04:40:28 PDT
                                                         Re: [propel-dev] Query counting hlellelid Hans Lellelid 2007-07-19 06:42:12 PDT
Page: of 2 « Previous | Next »
Messages per page: