Named query monitoring/profiling

I’m trying to use named queries with long cache times to ease a connection to an old DB (FoxPro).

However, when looking at the DB diagnostics, I have a feeling that some queries are still fired too often.

Is there some way I can monitor the queries send to the server (preferable via some option I can enable for a few minutes, and later investigate the data)?

I would like to find some data like

  • source of the query (client hostname or ip)
  • Time and duration of the query
  • whether it hit the cache or went to the database
  • parameters passed on

Turning the logger “NamedQueries.executor” to trace will get you information on the parameters, whether it hit the cache or db and the expiration time of cached queries.

1 Like

Ok, I got some time to trace things, and found that most of the time, the cache was hit.

Though I found something weird, how is the cache supposed to stay valid until the year 9377, when I only enabled a cache of 2 minutes on it? I’m using 7.9.9 btw.

how is the cache supposed to stay valid until the year 9377, when I only enabled a cache of 2 minutes on it?

You're living in the future? :flushed:

I'll have our defect analyst take a look at that. Yikes.

The logging is turning a nano-second timestamp into a date - the logic is all fine, but the debug logging is (obviously) incorrect. We'll have to fix it internally.

1 Like