I have a shapefile with ~68,000 polygons, and for all the Sentinel 2 images between two dates (e.g., from July 1st 2021 to August 1st 2021), and for all the Sentinel 2 bands, I would like to compute the mean value of all the pixels contained in each polygon. The output should be a table for each band, where each row corresponds with each polygon and each column with each Sentinel 2 image (+ some attributes corresponding to the polygon included in the shapefile). This output would be exported as a CSV file to be used in the local computer.
I tried to do this for only one band (B3): https://code.earthengine.google.com/476b39b8a93872506bb9bb17dd8705d3 The problem is that it takes so much time to finish the process for these ~68,000 polygons and only one month of data. The idea is to increase the number of polygons to ~2,000,000 and the date range to 3-5 years.
Is there any way to speed up this process?
I guess the process of computing the mean value of each band for each polygon is fast on the server-side; however, the problem must be to get the results from the server-side and write them on a file exported to a drive.