David,
I think your suggested improvements are interesting, particularly if your interest is auditing. As far as breaking it, it seems like you're mostly pointing out that you can query data without statistics if you don't save your query before running. As you point out, many details are missing, like the run option and there's no record of actual SQL run. While all this is true, I think it deserves a separate discussion topic, as I believe the intent of the delivered utility strays from your interest.
Query Statistics is not targeted, but enabled for every query - that's what I'm hoping we can change to improve performance.
The fields in PSQRYSTATS tracked during every named query execution lead me to believe that it is designed to help identify saved queries that run frequently or rarely, were run recently or not, take a long time to run, or have been killed frequently, which would help identify queries that need to be culled or tuned.
As a next step in helping tune queries, you can turn on logging for specific queries. This is stored in PSQRYEXECLOG, which contains a row for each execution, containing who ran it, how long it ran, how many rows, if it exceeded the max rows, and a killed reason.
Perhaps your enhancements would involve another setting "enhanced security auditing" checkbox that enforces much more than the delivered utility, and includes additional fields.
------------------------------
Kevin Shalla
Director of Technology
University of Chicago
------------------------------
Original Message:
Sent: 08-22-2025 09:44 AM
From: David Ehrlich
Subject: Query Statistics - improve performance
A most fascinating discussion I return to after a week away.
We have just turned on Query Stats and are reviewing it. I must say that for the things I'm interested in being able to review / accomplish with such a tool, I was able to "break it" within 3 minutes. No joking. I've spent maybe a total of 5 minutes so far reviewing it.
With that said - what am I interested in with such a tool? A rather robust and complete auditing capability. So, when I said that I could "break it", that is referring to the ease with which I was able to "hide my tracks". Are there additional capabilities which are in the tool that I'm missing / we haven't turned on? Perhaps. I'm sure that more than 5 minutes of investigation would be worthwhile.
Some time ago, I wrote up my cut at the capabilities I'd like to see for auditing / tracking in Query Manager. I'm attaching that document - and would be most interested in thoughts and comments from this community. Has anyone done anything along these lines? (As I take another look at the document, having the ending date / time would also be good - would be nice to know how long the SQL ran for!)
I would appreciate your comments and insights.
Thanks in advance for the time and effort you put into looking at this!
Original Message:
Sent: 8/20/2025 9:55:00 AM
From: Anna Kourouniotis
Subject: RE: Query Statistics - improve performance
voted!
------------------------------
HEUG Community of Practice
Reporting, Analytics, and Data Governance Subcommittee
Anna Kourouniotis MA
Database Analyst II
Duke University
Original Message:
Sent: 08-18-2025 09:43 AM
From: Kevin Shalla
Subject: Query Statistics - improve performance
We want to always run Query Statistics so that we can better manage queries. Specifically, we want to identify:
1) which queries are rarely run or haven't been run in a long time - and perhaps delete them
2) which are run most frequently or take a long time to run - and perhaps tune them for better performance
We turned on query statistics, but we have several queries that run upon login for students, and when we had heavy student traffic, Query Statistics was overwhelmed, and slowed our system dramatically, so we've turned it off since then.
I posted a PeopleSoft Idea to improve Query Statistics Performance, and got some great feedback, though no activity from Oracle. I would much appreciate more upvotes and comments.
------------------------------
Kevin Shalla
Director of Technology
University of Chicago
------------------------------