]]>SQL Profiler Introductionhttp://www.tkk7.com/javaora/archive/2005/06/28/6810.htmljava涓栫晫鐣呰皥java涓栫晫鐣呰皥Tue, 28 Jun 2005 06:57:00 GMThttp://www.tkk7.com/javaora/archive/2005/06/28/6810.htmlhttp://www.tkk7.com/javaora/comments/6810.htmlhttp://www.tkk7.com/javaora/archive/2005/06/28/6810.html#Feedback1http://www.tkk7.com/javaora/comments/commentRss/6810.htmlhttp://www.tkk7.com/javaora/services/trackbacks/6810.htmlSQL Profiler Introduction
This is a quickly hacked tool to do statistics錛堢粺璁★級 on SELECT queries in order to know where it is most efficient to create indexes. 鐩殑鏄渶鏈夋晥鐨勫垱寤虹儲寮?
This small tool, released under an Apache-based license connects to the P6Spy JDBC logger and displays in real time the queries going to the database. It uses an integrated SQL parser to build statistics on the most accessed tables and columns and can generate SQL index creation files. Other information is also gathered and displayed, such as the request time for a single request, for a class of request, and for all the requests. Sorting may be done on these views to detect(瀵熻) database problems efficiently.
This tool can be very useful when you have a big volume of queries that you need to analyze not one by one涓涓帴涓涓?(meaning that the specific time isn't that much of interest), but rather(鑻ラ潪) when you want to know what "group" of queries is taking a lot of time, such as queries on the same tables and columns but with different query values. The integrated SQL parser (built with ANTLR) is used to analyze the incoming SELECT queries.
The Swing GUI was based on Apache's Log4J Chainsaw, but all the bugs are mine. Also contributors are welcome to test, make new suggestions, give their opinion and submit patches.