# Understanding --limit in percona toolkit pt-query-digest

**URL:** https://forums.percona.com/t/understanding-limit-in-percona-toolkit-pt-query-digest/32647
**Category:** Percona Toolkit
**Tags:** mysql
**Created:** [August 28, 2024, 7:48am UTC](https://forums.percona.com/t/understanding-limit-in-percona-toolkit-pt-query-digest/32647 "2024-08-28T07:48:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Idan\_Ahal](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/idan_ahal/32/13477_2.png) [@Idan\_Ahal](https://forums.percona.com/u/Idan_Ahal)
#### Post date: [August 28, 2024, 7:48am UTC](https://forums.percona.com/t/understanding-limit-in-percona-toolkit-pt-query-digest/32647/1 "2024-08-28T07:48:40Z")

</div>

I read all the docs and didn’t totally understand how --limit works.  
Why would I want to use the percentage option and not analyze all?  
Also, if I group by user, Will it give me a different result? because the limit runs before the filter?

---

<div class="post-metadata">

### Author: ![Idan\_Ahal](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/idan_ahal/32/13477_2.png) [@Idan\_Ahal](https://forums.percona.com/u/Idan_Ahal)
#### Post date: [August 28, 2024, 7:59am UTC](https://forums.percona.com/t/understanding-limit-in-percona-toolkit-pt-query-digest/32647/2 "2024-08-28T07:59:02Z")

</div>

OK I understand it now. I thought it filters the queries before aggregation but it’s after.
