Of course it can. Your hardware must be appropriate for the use-case.
If querying the attribute is a frequent use-case, it has to be indexed. Your hardware must be appropriate for the use-case.
It may or it may not is it use-case specific. If you are stressed with the amount of RAM, you should take the time to compare the different approaches. There is no solution that fits all. It is really easy to add more RAM. Is it easier and faster than trying to came up with the perfect solution.
Continuous improvement is better than delayed perfection. – Mark Twain
Make it work correctly then make it work fast.
A excellent idea that can be used with the attribute pattern is Atlas Search to return all the applicable filters for a given search query without specifying - #2 by Erik_Hatcher.