I am trying to divide the bounding box of a country into smaller 1km square polygons to be able to speed up my queries against millions of points (get all polygons within a radius of a selection then only query against points that are within those polygons)
I am using the following query to divide the bounding_box of the country but I only get 1 row returned from this query
SELECT (ST_Subdivide(bounding_box, 1000)) FROM ref_countries WHERE name = 'United Kingdom';
When I expected many rows of smaller polygons
I have checked that the geometry type is a polygon using:
SELECT ST_GeometryType(bounding_box) FROM ref_countries WHERE name = 'United Kingdom'
which returns "ST_Polygon"
I have also checked that the geometry is valid using:
SELECT ST_IsValid(bounding_box) FROM ref_countries WHERE name = 'United Kingdom'
which return "true"
I have also tried using ST_DUMP (ST_Dump(ST_Subdivide(bounding_box, 10000))).geom as this seemed to be a possible soultion, but still no luck.