Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^3: Can DBI modify queries on the fly?

by jfroebe (Parson)
on Feb 18, 2009 at 02:59 UTC ( #744625=note: print w/replies, xml ) Need Help??

in reply to Re^2: Can DBI modify queries on the fly?
in thread Can DBI modify queries on the fly?

Understood. I would advise strongly against doing this in production though. Most DBMSs will have a performance penalty for writing to the errorlog (or any external file). But... it's your code/server.

Jason L. Froebe

Blog, Tech Blog

  • Comment on Re^3: Can DBI modify queries on the fly?

Replies are listed 'Best First'.
Re^4: Can DBI modify queries on the fly?
by kyle (Abbot) on Feb 18, 2009 at 03:08 UTC

    We're not planning to write everything to a log, but there's a "slow queries" log for when something takes too long, and I'd like those entries to have a little more information in them. Unfortunately, I can't always tell ahead of time which queries those will be, so I need to add my special bonus info to everything.

      Instead of writing to the DBMS errorlog, how about writing to a table? It would probably have a smaller performance impact. It would also allow you to determine which queries are most often used.. allowing you to focus your energy on the worst.

      Which DBMS are you using? There might be tools that would identify the slow queries that you could use in conjunction with your code line => query.

      Jason L. Froebe

      Blog, Tech Blog

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://744625]
[Discipulus]: my last linux experience was with redhad 5.6 and occasionally with partedmagic.. i need to relearn everything.. :=(
[choroba]: command line FTW!
[marto]: good morning all, sane dots all round

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2016-12-07 09:13 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (125 votes). Check out past polls.