Please read the following user tip and restate your question/problem with details:
Writing an Effective Apple Support Communities Question - Apple Community
Include:
What system and Photos versions are you running?
What Model, ModelID and year is your Mac Mini?
How much free space do you have on your boot drive?
How much RAM do you have?
Are you running a "managed" or "referenced" library?
Where is your library located? If on an external HD how is that drive formatted and connected to your Mac?
Do you have iCloud Library enabled? If you do is "Optimize Mac Storage" also enabled?