Partial index on an email column

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 (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?


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.