3 ms·
We've discussed query hints before at http://news.ycombinator.com/item?id=2179433 http://news.ycombinator.com/item?id=2179433 along with why they don't exist in
by btilly 16y ago
We've discussed query hints before at http://news.ycombinator.com/item?id=2179433 http://news.ycombinator.com/item?id=2179433 along with why they don't exist in PostgreSQL. My opinion is clear from that discussion.
The other feature in this list that I really, really like is session tracing. When I used to work with Oracle I implemented a feature that allowed any web page to have the database session logged if you passed in a magic parameter. This was unbelievably useful in debugging performance problems on the live system as they were happening. In fact it proved so useful that we would turn tracing on for one session for some period of time each day, inserting pointless marker queries at the start and end of each web page. We then ran a script through the log to be able to break it up by web page, looked at the slow web pages, what they did, and thought about how we could make it faster. This exercise suggested optimizations that resulted in something like doubling the capacity of our website on that hardware.
This is invaluable data that you simply cannot collect in any other way. You certainly can't turn on logging for the whole database - the website will crash. Sure you can log things at the application level - I did that as well. But it just says, "We ran these queries and got this timing." It doesn't shed light on what is happening inside of the database.
- someotheridiot 16y agoYes, Oracle's tracing capabilities are awesome. I too have regularly traced individual production sessions. A quick tkprof later (well maybe some dev time too) and that 10 mins report now runs in 10 secs.