On Thu, Mar 15, 2012 at 10:33:43AM +0000, Martin J. Evans wrote:
> 
> Argh, DBD::Oracle tracing is a mess wrt to this discussion:
> 
> ocitrace.h:
> 
> #define DBD_OCI_TRACEON       (DBIS->debug >= 6 || dbd_verbose>=6)
> #define DBD_OCI_TRACEFP       (DBILOGFP)
> 
> #define OCIServerRelease_log_stat(sc,errhp,b,bl,ht,ver,stat)\
>       stat =OCIServerRelease(sc,errhp,b,bl,ht,ver);\
>       (DBD_OCI_TRACEON) \
>                       ? PerlIO_printf(DBD_OCI_TRACEFP,\
>                                "%sOCIServerRelease(%p)=%s\n",\
>                                OciTp, sc,oci_status_name(stat)),stat \
>       : stat
> 
> Every single OCI call uses DBD_OCI_TRACEON which in turn uses
> DBIS->debug and non have a imp_xxx handle so this is a very large
> change. Ensuring the code at each point an OCI call is made has an
> imp_xxh and getting the right one is going to be an awful job
> especially when a load of funcs in oci8.c don't even have a handle. I
> don't see an easy way to automate this change so I'm not sure I've got
> the stomach for this. If I do this will I really "see" some speed up
> as it is a lot of work.

Maybe just do the OCI* function calls that are used in the main fetch
code path, i.e., dbd_st_fetch. Add an imp parameter

-#define OCIServerRelease_log_stat(sc,errhp,b,bl,ht,ver,stat)
+#define OCIServerRelease_log_stat(imp,sc,errhp,b,bl,ht,ver,stat)

        stat =OCIServerRelease(sc,errhp,b,bl,ht,ver);\
!       (DBIc_TRACE(imp,...)) \
!                       ? PerlIO_printf(DBIc_LOGPIO(imp),\
                                 "%sOCIServerRelease(%p)=%s\n",\
                                 OciTp, sc,oci_status_name(stat)),stat \
        : stat

Tim.

Reply via email to