Move 50.000 folders with rename

I have the challenge of sorting about 50,000 folders with images in them.

Currently, it is like this. There is a folder “Uploads”. There are 50000 subfolders in it.

Now I want them to be sorted by year/month.
So
uploads/2022/03
uploads/2022/02
uploads/2022/01
etc

Creating the folders for month/year with mkdir and rename for moving the folders is known to me.

My question is rather if rename is the best solution here.

And maybe does someone also have an idea how long such a process takes?

As far as I understand, rename changes the path of the folder. Is the folder on the hard disk of the server “really moved” or is that “only” meta information and rename is done in a few milliseconds?