[QGIS-Developer] Fwd: My PostgreSQL/PostGIS function to create all missing spatial indexes

Jorge Gustavo Rocha jgr at di.uminho.pt
Fri Dec 1 08:09:51 PST 2017


Nice contribution, Michaël! Tested and approved :-)

We might use this query to offer the option "Check missing spatial
indexes" in DB Manager, with an additional checkbox to "Add missing
indexes". Initially just for the Postgis provider, but it can be
implemented for other providers.

What do you think?

Regards,

Jorge Gustavo

On 01-12-2017 11:31, kimaidou wrote:
> I have improved my function.
> 
> Now it returns a table containing the schema, table name and column
> name. You need to use it with
> SELECT * FROM create_missing_spatial_indexes();
> 
> If you would like to only get the informations about missing indexes,
> there is a new "simulate" parameter.
> SELECT * FROM create_missing_spatial_indexes(True);
> 
> URL : https://gist.github.com/mdouchin/cfa0e37058bcf102ed490bc59d762042
> 
> Cheers,
> Michaël
> 
> 2017-12-01 12:10 GMT+01:00 Salvatore Larosa <lrssvtml at gmail.com
> <mailto:lrssvtml at gmail.com>>:
> 
>     Thank you very much!
> 
>     --
>     Sent from my mobile phone
> 
>     Il 01 Dic 2017 12:01 PM, "kimaidou" <kimaidou at gmail.com
>     <mailto:kimaidou at gmail.com>> ha scritto:
> 
>         Hi users and devs,
> 
>         I just created a very simple function [1] to create all the
>         missing spatial indexes on your table geometry columns.
> 
>         It is the 1st version, has no fancy parameter to choose tables
>         or schemas, nor return anything usefull (only notices).
> 
>         Use it with a simple
>         SELECT create_missing_spatial_indexes();
> 
>         [1]
>         https://gist.github.com/mdouchin/cfa0e37058bcf102ed490bc59d762042 <https://gist.github.com/mdouchin/cfa0e37058bcf102ed490bc59d762042>
> 
>         Regards,
>         Michael
> 
> 
>         _______________________________________________
>         QGIS-Developer mailing list
>         QGIS-Developer at lists.osgeo.org
>         <mailto:QGIS-Developer at lists.osgeo.org>
>         List info:
>         https://lists.osgeo.org/mailman/listinfo/qgis-developer
>         <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
>         Unsubscribe:
>         https://lists.osgeo.org/mailman/listinfo/qgis-developer
>         <https://lists.osgeo.org/mailman/listinfo/qgis-developer>
> 
> 
> 
> 
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 

J. Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor


More information about the QGIS-Developer mailing list