If a spatial index for a Shapefile was created by GDAL, you will have a .qix file side-by-side to the rest of the Shapefile's files. And yes, the process is usually very fast.
If you want to see more output and have GDAL tell you about what it is doing, you can enable debug messages using --config CPL_DEBUG ON
. Here is an example:
$ ls -1sh file.*
50M file.dbf
4.0K file.prj
117M file.shp
556K file.shx
$ ogrinfo --config CPL_DEBUG ON -sql "CREATE SPATIAL INDEX ON file" file.shp
Shape: DBF Codepage = LDID/87 for file.shp
Shape: Treating as encoding 'ISO-8859-1'.
GDAL: GDALOpen(file.shp, this=0x5636d708a740) succeeds as ESRI Shapefile.
INFO: Open of `file.shp'
using driver `ESRI Shapefile' successful.
Shape: Estimated spatial index tree depth: 15
Shape: Falling back to max number of allowed index tree levels (12).
SHAPE: Creating index file file.qix
GDAL: GDALClose(file.shp, this=0x5636d708a740)
$ ls -1sh file.*
50M file.dbf
4.0K file.prj
2.3M file.qix
117M file.shp
556K file.shx
If you do the same for an already existing index (mind that GDAL can read .sbn and .sbx indexes) you will get messages about it trying to "unlink" files, that means it would delete them if they did exist.
$ ogrinfo --config CPL_DEBUG ON -sql "CREATE SPATIAL INDEX ON file" file.shp
Shape: DBF Codepage = LDID/87 for file.shp
Shape: Treating as encoding 'ISO-8859-1'.
GDAL: GDALOpen(file.shp, this=0x55e1355ab740) succeeds as ESRI Shapefile.
INFO: Open of `file.shp'
using driver `ESRI Shapefile' successful.
SHAPE: Unlinking index file file.qix
SHAPE: Trying to unlink index file file.sbn
SHAPE: Failed to delete file file.sbn.
No such file or directory
SHAPE: Trying to unlink index file file.sbx
SHAPE: Failed to delete file file.sbx.
No such file or directory
Shape: Estimated spatial index tree depth: 15
Shape: Falling back to max number of allowed index tree levels (12).
SHAPE: Creating index file file.qix
GDAL: GDALClose(file.shp, this=0x55e1355ab740)