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

2017-12-03 Thread Jorge Gustavo Rocha
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.

Regards,

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  >:
> 
> 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
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2017-12-03 Thread Lbartoletti
  Hi,And what about some snippets/useful query in DB manager like‎ pgModeler ? Regards.Loïc. Envoyé de mon smartphone BlackBerry 10.De: kimaidouEnvoyé: dimanche 3 décembre 2017 09:37À: Jorge Gustavo RochaCc: qgis-developerObjet: Re: [QGIS-Developer] Fwd: My PostgreSQL/PostGIS function to create all missing spatial indexesHi JorgeThis 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...)RegardsMichaël2017-12-01 17:09 GMT+01:00 Jorge Gustavo Rocha :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


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2017-12-03 Thread kimaidou
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 :

> 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
>
>
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2017-12-01 Thread kimaidou
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 :

> Thank you very much!
>
> --
> Sent from my mobile phone
>
> Il 01 Dic 2017 12:01 PM, "kimaidou"  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
>>
>> Regards,
>> Michael
>>
>>
>> ___
>> QGIS-Developer mailing list
>> QGIS-Developer@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2017-12-01 Thread Salvatore Larosa
Thank you very much!

--
Sent from my mobile phone

Il 01 Dic 2017 12:01 PM, "kimaidou"  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
>
> Regards,
> Michael
>
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2017-12-01 Thread kimaidou
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

Regards,
Michael
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer