Or, for a little more comfort, we could examine the first 1000 geometries:
```java
"SELECT MIN(ST_DIMENSION("+ geomFieldName + ")) dim FROM (SELECT * FROM "
    + location.toString() + " LIMIT 1000);"
```
This takes less than 50 ms and gives approximately the same degree of confidence as if we examined all geometries.