To extract the minimum distance between 18 089 points against 104 612 polygons, must be necessary to compute 1 892 326 468 distances.
That can be reduced considerably if you can determine a distance threshold from each point within which to perform the calculations. If you can, comment it.
Both layers must have the same CRS assigned. Reproject them if necessary.
Test this method with a layer with one point. If it works, test it with 100 points. If you can, test it with a layer with 1 000 points. I am not sure if some limit can be reached with your data.
We will create a virtual layer. If you see that all works fine, perform the query to the original layer and export the virtual output layer to a file. Work with the saved layer instead of the virtual one.
There are probably simpler methods than this, and there are certainly better ones. From this method we do not pretend any more than to see if it is possible.
Assuming that you have a point vector layer named "points", with a column named "id" populated with a unique value for each feature.
Assuming also that you have a polygon vector layer named "polygons", also with a column named "id".
Both layers with the same CRS.
You can Create a Virtual Layer with all the point geometries, their ids, the id of their nearest polygon and the distance between them, with the following query:
WITH all_distances AS (
a.id AS point_id,
b.id AS polygon_id,
ST_Distance( a.geometry, b.geometry) AS distance
points AS a
polygons AS b
just_nearest AS (
MIN( c.distance) AS min_distance
FROM all_distances AS c
GROUP BY c.point_id
d.min_distance AS distance
points AS p
just_nearest AS d
ON p.id = d.point_id
With that query we are:
Creating a temporary table named "all_distances". With one row for each combination of point id and polygon id, and the shortest distance between them.
Creating a temporary table named "just_nearest". With one row for each point id, with its id, the minimum distance calculated in the previous table and its corresponding polygon id.
Selecting from the points layer all geometries and creating a virtual layer. With the geometry, the point id, the nearest polygon id and the distance between them.