Well, this small code snippet create a file datastore that include all csv files starting with 'd' or 'D' from the current folder and all subfolders.
Not sure how large your data sets are, but you can give it a try:
folderPath = 'C:\Users\AsV\Documents\Matlab';
filePattern = fullfile(folderPath, '**', 'd*.csv');
fDatastore = fileDatastore(filePattern,'ReadFcn',@readtable,'ReadMode','file');
disp('Files in the data store:');
In my understanding fileDatasore is specifically created in Matlab to efficiently handle large datasets.
Not really sure how to make it even more efficient in Matlab. Perhaps some other programming language would be a better match.