![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to search and replace a particular line in file with sed command | sshah1001 | UNIX for Dummies Questions & Answers | 2 | 05-30-2009 10:45 PM |
| Command to search for a file | harikamamidala | Shell Programming and Scripting | 3 | 07-30-2007 08:04 AM |
| passwd command search | shahnazurs | SUN Solaris | 5 | 06-19-2007 07:59 AM |
| command to search for a wod in a line | Srini75 | Shell Programming and Scripting | 2 | 06-16-2006 02:44 PM |
| In Search of a Command | radimus | UNIX for Dummies Questions & Answers | 2 | 08-10-2001 12:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
so any command that show top n query time file is as follow # Query_time: 2.562404 Lock_time: 0.000018 Rows_sent: 509 Rows_examined: 509 use testanalytics; SET timestamp=1238053872; SELECT * FROM `testanalytics`.`anlytcs_mt_dt`; # Query_time: 12.080983 Lock_time: 0.000034 Rows_sent: 1270 Rows_examined: 2540 SET timestamp=1238116828; SELECT * FROM `anlytcs_mt_dt` ORDER BY `anl_evnt_id` DESC; # User@Host: root[root] @ [10.157.205.10] # Query_time: 18.391643 Lock_time: 0.000017 Rows_sent: 22296 Rows_examined: 22296 use test_analytics; SET timestamp=1238455961; SELECT /*!40001 SQL_NO_CACHE */ * FROM `test_analytics`.`dim_tm`; # Query_time: 17.690604 Lock_time: 0.000018 Rows_sent: 22296 Rows_examined: 22296 use test_analytics; SET timestamp=1238461385; SELECT /*!40001 SQL_NO_CACHE */ * FROM `test_analytics`.`dim_tm`; any command for result top n Query_time: Last edited by kaushik02018; 06-22-2009 at 08:47 AM.. |
|
||||
|
let me update
Query_time: 2.562404
In this field, is there any space, if space is there , u can cut the exact field through awk command like awk '{print $field name}' <file> After that u can get the first 10 Query_time by head command. |
|
||||
|
only top 10 time
---------- Post updated at 06:38 AM ---------- Previous update was at 05:59 AM ---------- Quote:
grep "Query_time" /home/slow-log-new.log | sort -n -k3 -r > /tmp/queries_sorted_by_time & |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|