You just have to ensure, that the external volume is always mounted, when you are signed into your user account, even when you are not working with Photos. The background processes, like the photosanalysisd need always access to the Photos Library.
And do not forget to add the external drive with your photos Photos Library to your regular Time Machine backups.
Buy an external volume that is large enough to hold your future photos as well - a Photos Library tends to grow quickly. Buy a volume with at least twice as much storage as you are expecting to be using in three years or so. Photos will need a lot of extra free storage, when it repairs the library or upgrades it to a different system version. And you will need the extra storage to be able to create a safety copy of your library, before you repair it or upgrade it. The volume for your Photos Library cannot be large enough.