# Partial index on an email column

**URL:** <https://forums.percona.com/t/partial-index-on-an-email-column/405>\
**Category:** Other MySQL® Questions\
**Created:** [August 6, 2007, 2:23pm UTC](https://forums.percona.com/t/partial-index-on-an-email-column/405 "2007-08-06T14:23:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cizara](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@cizara](https://forums.percona.com/u/cizara)\
**Post date:** [August 6, 2007, 2:23pm UTC](https://forums.percona.com/t/partial-index-on-an-email-column/405/1 "2007-08-06T14:23:52Z")

</div>

Hi, I have a table with a column email that currently have an index. The data on the table has almost all their emails from [hotmail.com](http://hotmail.com) (like 90% over 40M). I want to do a partial index on that table to search only until the @… Is there a way to do this or I have to do a partial index of for example 12 lenght?

Thanks,  
Cizara

---

<div class="post-metadata">

**Author:** ![Speeple](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Speeple](https://forums.percona.com/u/Speeple)\
**Post date:** [August 7, 2007, 11:31am UTC](https://forums.percona.com/t/partial-index-on-an-email-column/405/2 "2007-08-07T11:31:46Z")

</div>

You can’t make a dynamic length partial index, you must determine the optimal length and then create the index.

To determine the optimal length try something like…

Getting average length of the prefix of the email (anything before @).

If say the average length is 12.7 make the partial index length 13.
