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

Jorge Gustavo Rocha jgr at di.uminho.pt
Sun Dec 3 03:38:03 PST 2017

Good morning Michaël, Loïc,

Add PostGIS Table(s) dialogue already shows our spatial enabled tables.

We might just add another column to show if that geometry column is
already indexed or not. We can add another action button to create it,
enabled if missing.

I've added a very simple mockup in this gist [1].

This approach is more simple to implement, I think. It can be applied to
other providers as well.


Jorge Gustavo

[1] https://gist.github.com/jgrocha/a51d763fbe702fa3bf84f8192a979923

On 03-12-2017 08:36, kimaidou wrote:
> Hi Jorge
> This feature would be good to have in the DB manager, but I do not think
> we should create a function in any database without warning the user.
> Inside QGIS, we should be less intrusive and only run the SELECT SQL
> inside the function to get all missing indexes, show them in a QGIS
> table view with checkboxes, and a button to create selected indexes.
> I could propose a PR for this if I find time (heavy workload this end of
> year...)
> Regards
> Michaël
> 2017-12-01 17:09 GMT+01:00 Jorge Gustavo Rocha <jgr at di.uminho.pt
> <mailto:jgr at di.uminho.pt>>:
>     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

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