How to design a database to make the search faster for an entity with many custom attribuate to meet diffirent customer's needs?

I am doing an to-B app which I have to meet the different needs of many customers.For example,such as people,one client has two tags, age and position,the other has a tag habits,but I only has a system. I have tried many methods to solve this question:

  1. Horizontal plus multiple spare fields
  2. EAV model (entity attributes Value)
  3. Stored in json structure

Because I hope that the code is set by the user, I will not use method 1. As for method 2,I tested a million-level data and the query speed is slow, who can give me a better way to solve this? Or directions can be optimized to make method 2 and method 3 better? which database is good for my question? MySQL, MongoDB or other?

My question is that in a to B project, because each customer’s needs are different, multiple custom fields are required. So, how will the database structure be designed and how to make the search better and faster?