# Mautic Hangs or Takes forever to open a Large Segment

**URL:** <https://forum.mautic.org/t/mautic-hangs-or-takes-forever-to-open-a-large-segment/27289>\
**Category:** Product Support\
**Created:** [March 8, 2023, 8:55am UTC](https://forum.mautic.org/t/mautic-hangs-or-takes-forever-to-open-a-large-segment/27289 "2023-03-08T08:55:43Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![mauriblint](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauriblint/32/8314_2.png) [@mauriblint](https://forum.mautic.org/u/mauriblint)\
**Post date:** [April 28, 2025, 2:52pm UTC](https://forum.mautic.org/t/mautic-hangs-or-takes-forever-to-open-a-large-segment/27289/21 "2025-04-28T14:52:11Z")

</div>

I’ve solved the Slow Segment “view” when clicking on a Segment in Mautic 4.5.x by adding an Index.

> <https://github.com/mautic/mautic/issues/13090>
>
> \### Mautic Version
> 
> 4.4.x series
> 
> \### PHP version
> 
> 8.0.30
> 
> \### What browsers are… you seeing the problem on?
> 
> Not relevant
> 
> \### What happened?
> 
> Clicking Segments and heading to a segment takes several seconds to load.
> 
> There is a query that takes a whilst to complete, as it sorts by something that doesn't have the conditions in its key, and triggers a table scan in my case.
> 
> \`\`\`
> SELECT el.date\_added - INTERVAL 10 SECOND FROM lead\_event\_log el WHERE (el.object = 'segment') AND (el.bundle = 'lead') AND (el.object\_id = 1) ORDER BY el.date\_added ASC LIMIT 1;
> \`\`\`
> 
> \### How can we reproduce this issue?
> 
> Step 1: Have a lead\_event\_log table with millions of rows
> Step 2: Go to Segments
> Step 3: Click a segment - takes a few seconds to load
> 
> \### Relevant log output
> 
> \_No response\_
> 
> \### Code of Conduct
> 
> \- \[X\] I confirm that I have read and agree to follow this project's Code of Conduct

They suggested this Index:

CREATE INDEX lead\_timeline\_order\_index ON lead\_event\_log (object, bundle, object\_id, date\_added ASC);

And works like a charm for my, now a segment with 30k contacts loads almost in an instant.

[Previous page](https://forum.mautic.org/t/mautic-hangs-or-takes-forever-to-open-a-large-segment/27289.md?page=1)
