# enable profiling for a specific user/session

**URL:** <https://forums.percona.com/t/enable-profiling-for-a-specific-user-session/1486>\
**Category:** Other MySQL® Questions\
**Created:** [August 26, 2010, 10:49am UTC](https://forums.percona.com/t/enable-profiling-for-a-specific-user-session/1486 "2010-08-26T10:49:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjuan](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gjuan](https://forums.percona.com/u/gjuan)\
**Post date:** [August 26, 2010, 10:49am UTC](https://forums.percona.com/t/enable-profiling-for-a-specific-user-session/1486/1 "2010-08-26T10:49:24Z")

</div>

Hi,

I have had problems with some sqls generated by an specific user used in an application.

is there a way to enable profiling to that user since my session?

I have enable slow query option and queries not using index but i want to know if i can enable profiling? Or how can i know the resource usage for statements executed during the course of that session.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![justin.swanhart](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/justin.swanhart/32/16904_2.png) [@justin.swanhart](https://forums.percona.com/u/justin.swanhart)\
**Post date:** [August 26, 2010, 11:38am UTC](https://forums.percona.com/t/enable-profiling-for-a-specific-user-session/1486/2 "2010-08-26T11:38:45Z")

</div>

If you use Percona Server you can track usage based on users using INFORMATION\_SCHEMA.USER\_STATISTICS.

[URL][Percona Open Source Software Documentation](http://www.percona.com/docs/wiki/patches:userstatv2%5B/URL%5D)

You can use the slow query log. If you are using MySQL 5.1 (or Percona Server 5.0) you can log all queries to the log by setting long\_query\_time to 0.

You can use mk-query-digest to process the log, and the --filter functionality to look at queries only for a particular user.  
[http://www.maatkit.org](http://www.maatkit.org)

–Justin
